ai-shell icon indicating copy to clipboard operation
ai-shell copied to clipboard

How difficult would it be to have fix command?

Open jodusan opened this issue 1 year ago • 3 comments

Common case of using ai to help is to fix terminal command issues and dont have to copy error from command line (like this project https://github.com/shahnk19/gpt-comrade)

where if previous command fails command as "comrade fix" would right there in terminal suggest resolution. How difficult woudl be to add this?

jodusan avatar Jul 25 '24 09:07 jodusan

oh thats a neat idea, always open to pull requests! an ai fix command could be a great idea and i don't think would be complicated to implement

steve8708 avatar Jul 25 '24 23:07 steve8708

I was looking for a solution for this one. When you run a node app in a terminal, the node app itself doesn't have access to the current terminal history, if you run "history" command using execa it will run it on a new terminal with no ( or different ) history .

Accessing .bash_history could be a solution, but it might be more complicated on non-Unix shells.

I think passing the command as an argument is a good approach. Something like ai fix "npm install react". Someone could simply define an alias to automatically pass the last command to ai fix "$0" if they prefer.

I'm going to work on this.

RezaRafia avatar Sep 17 '24 13:09 RezaRafia

Any update on this?

Emasoft avatar Dec 02 '24 06:12 Emasoft