Skip to content

A Zsh helper to auto-correct the current command via ChatGPT

License

Notifications You must be signed in to change notification settings

seqizz/oh-my-gpt-correction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oh-my-gpt-correction

A Zsh helper to auto-correct the current command via ChatGPT.

Just compile the go code to executable.

Code is written badly but it does its job Code is now edited with ChatGPT, since it's better than me in golang 💩

  • Looks for an API key in CHATGPT_API_KEY environment variable
  • It accepts one argument, intended to get a whole command inside this argument
  • Exit codes are:
    • 1: Chat completion error (remote or lib-wise issues)
    • 2: No API key given
    • 3: Can't find an issue with given command
    • 4: No command given
  • In case of a suggestion, it prints 2 lines:
    • First line is colored diff from original command
    • Second line is the original suggestion
  • We are catching this output on ZSH part and utilise accordingly

Demo

A simple demo

About

A Zsh helper to auto-correct the current command via ChatGPT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages