efugier / smartcat

Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.

Home Page:https://crates.io/crates/smartcat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding terminal logs (and more) into context

knyazer opened this issue · comments

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!

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 🤔
That would be useful for sure though. What I may implement pretty is reading clipboard.

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...

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 🙂