From d781c2b4be9c3202a3dc8408078af086eb82ec3c Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 24 Mar 2023 13:36:27 +0800 Subject: Update --- bin/gpt/shellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 bin/gpt/shellrc (limited to 'bin/gpt/shellrc') 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 @@ +# Ask GPT what's wrong with the last command +h() { + printf '%s\n\n%s' "$(fc -s 2>&1 >/dev/null)" "Tell me what's wrong with the command above" | \ + gpt --skip +} +trap 'echo -e "\e[31m---Error: press h to get help from AI---\e[0m"' ERR -- cgit v1.2.3-70-g09d2