efugier / smartcat

Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.
https://crates.io/crates/smartcat
Apache License 2.0
77 stars 9 forks source link

Adding terminal logs (and more) into context #20

Closed knyazer closed 3 months ago

knyazer commented 3 months ago

Hey! Nice project

I was wondering if you think adding an option to add past terminal commands/logs/environment etc into context is meaningful? Also giving tools to llm, like cat/ls sounds fun. So that, for example

> git push
# blah blah add remote
> sc "fix" --terminal

Would work. I guess it might be outside of the scope, but smartcat is the closest tool I found to support this. And yeah, I just would love to see this tool evolve to get a sort of "general cli ai" vibe: like it gets current session or tmux for example, and fetches all the transitions/actions you did in there recently. Sounds fun. But maybe out of the scope...

Thanks for the project, again!

efugier commented 3 months ago

Hey, thanks a lot for the interest!

I was wondering if you think adding an option to add past terminal commands/logs/environment etc into contex

I don't know of a terminal-agnostic way to get both inputs and outputs from the previous commands :thinking: That would be useful for sure though. What I may implement pretty is reading clipboard.

knyazer commented 3 months ago

Actually, I spent some time thinking about it, and I think I came up with a way to do something like what I want in an extremely general way: just use tmux!

It provides both with history of everything that was in the session, plus allows to show small popups all around the place. And, of course, knows the position of the cursor. And you can just directly send keycodes to any application running inside tmux.

The only problem that the default popups are ugly, but there should be a way around it.... I will try to build a prototype ASAP! But yeah, attaching to tmux goes well beyond smartcat scope, sadly...

efugier commented 3 months ago

attaching to tmux goes well beyond smartcat scope, sadly...

I think so too!

What you can do to avoid mistakes altogether eval $(sc "command to echo a three times")

I'll close the issue but happy to see updates on your end, you can keep commenting on this issue :slightly_smiling_face: