Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ability to pipe-in initial question #15

Open
tadq opened this issue Dec 5, 2023 · 4 comments
Open

feat: Ability to pipe-in initial question #15

tadq opened this issue Dec 5, 2023 · 4 comments

Comments

@tadq
Copy link

tadq commented Dec 5, 2023

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

@dustinblackman
Copy link
Owner

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
Copy link
Author

tadq commented Dec 8, 2023

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
Copy link
Author

tadq commented Dec 11, 2023

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.

@dustinblackman
Copy link
Owner

dustinblackman commented Dec 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants