diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/gpt/shellrc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/gpt/shellrc b/bin/gpt/shellrc new file mode 100644 index 0000000..5d70dc6 --- /dev/null +++ b/bin/gpt/shellrc | |||
@@ -0,0 +1,6 @@ | |||
1 | # Ask GPT what's wrong with the last command | ||
2 | h() { | ||
3 | printf '%s\n\n%s' "$(fc -s 2>&1 >/dev/null)" "Tell me what's wrong with the command above" | \ | ||
4 | gpt --skip | ||
5 | } | ||
6 | trap 'echo -e "\e[31m---Error: press h to get help from AI---\e[0m"' ERR | ||