mdembed
is a command line tool to embed file contents in Markdown.
go install github.com/croaky/mdembed
cat example.md | mdembed
See examples directory.
I wanted the following workflow in Vim:
- Open
tmp.md
in my project. - Write a prompt for an LLM (Large Language Model).
- Reference other files, or subsets of files, in my project.
- Hit a key combo (
Space+r
for me) to send all the contents to an LLM. - Open a visual split to render the LLM's response.
mdembed
handles step 3.
I use mods for the LLM steps:
go install github.com/charmbracelet/mods@latest
So, my Vim config runs the following Unix pipeline in a visual split:
cat example.md | mdembed | mods
MIT