dustinblackman/oatmeal

feat: Ability to pipe-in initial question

Opened this issue · 4 comments

tadq commented

It would be beneficial to get initial chat started by entering multi-line text in the command line:

$ oatmeal << EOF
echo "Hello World" | wc -w
How to understand this code
EOF

Good idea! I got a WIP in this branch, but this overall doesn't play nicely with crossterm. It'll take more effort to figure out how to do it.

tadq commented

I use micro as secondary text editor while VS Code as primary.

micro uses Lua as scripting language. I am willing to try making oatmeal plugin for it at some point.
I am not great at Lua. I am Go/Python dev. I see that you have neovim plugin in Lua too. This might be a good start.

It might be beneficial to have pipe-in and pipe-out interface in oatmeal. Just allow pipe in initial text and spit out resulting /a append command back as stdout. This should make plugins in other text editors easier to write.

tadq commented

I have setup simple micro plug-in. Right now it uses clipboard to move code in and out of the oatmeal. It would benefit greatly if oatmeal would accept incoming stdin text on startup and write stdout if /a is used on "clipboard" type editor.

Nice I'm glad you got something working!

The UI is technically writing to stdout. We wouldn't be able to output to stdout it unless the app intends to exit and close the UI first.

If you already have something going in micro, you could write a full out plugin so you don't need the clipboard. I've made the interface easy to implement. I can help along the way, but I'm not familiar with what micro is capable of.