You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
||2 weeks ago|
|.gitignore||2 weeks ago|
|LICENSE||2 weeks ago|
|README.md||2 weeks ago|
|demo.gif||2 weeks ago|
|example.zsh||2 weeks ago|
|go.mod||2 weeks ago|
|go.sum||2 weeks ago|
|oh-my-gpt-correction.go||2 weeks ago|
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