Like Clippy but for the CLI
github.com
Like Clippy but for the CLI
1–10 of 41 posts
Re: Like Clippy but for the CLI
#2"Hey, CLI Clippy thingy, how do I do (harmless activity)?"
"rm -rf / --yes-do-what-I-say"
Re: Like Clippy but for the CLI
#3Given how much GPT models hallucinate perfectly realistic commands, this sounds super dangerous. "Hey, CLI Clippy thingy, how do I do (harmless activity)?" "rm -rf / --yes-do-what-I-say"
Re: Like Clippy but for the CLI
#4Re: Like Clippy but for the CLI
#5Thanks for sharing, but I am really not happy to install PHP (or using it) on my local system. I see you state you may re-write it in Python, if this happens I look forward to trying it!
Re: Like Clippy but for the CLI
#6Given how much GPT models hallucinate perfectly realistic commands, this sounds super dangerous. "Hey, CLI Clippy thingy, how do I do (harmless activity)?" "rm -rf / --yes-do-what-I-say"
but the hallucinations don't look like that, because rm -rf is a real command. a hallucinations is more likely to be something like "to export your tailacale config, try: tailscale export" but which unfortunately doesn't exist.
`tailscale export` is probably the more common form of hallucinating, totally harmless wishful thinking that doesn't work.
Re: Like Clippy but for the CLI
#7Thanks for sharing, but I am really not happy to install PHP (or using it) on my local system. I see you state you may re-write it in Python, if this happens I look forward to trying it!
Just use brew to install it in your home directory. There is nothing unsafe about PHP.
Re: Like Clippy but for the CLI
#8Earlier quoted context omitted.
Just use brew to install it in your home directory. There is nothing unsafe about PHP.
I didn't ask how to install it, and made no reference to safety. I also do not have access to an Apple device where I could use brew.
Re: Like Clippy but for the CLI
#9I made a pure bash version since I don't always have php installed:
gpt () {
api_key=$(cat ~/.config/openai.key)
verbose=false
if [[ $1 = -v ]]; then
verbose=true
shift
fi
userinput="$*"
# shellcheck disable=SC2016
system='You are an interactive shell command line shell agent.
You just get things done, rather than trying to explain.
Do your best to respond with 1 command that will meet the requirements.
Start a line with `$ ` to have it sent directly to the shell VERBATIM.
All other output is just echoed.
Favor 1 line shell commands.
Be terse.
Important: Every command you output will automatically be executed in this env: bash'
systemj="$(jq -Rs . &2
return 1
else
$verbose && echo "RESULT: ${res}"
jq -r '.choices[0].message.content'
-----I even tried using GPT to help me develop it!
$ gpt -v get the actual completion from an openai /completions request using jq
RESULT: {
"id": "chatcmpl-8IZvb4lQaFgcDdnSnsU4t6zhFRrbN",
"object": "chat.completion",
"created": 1699438703,
"model": "gpt-3.5-turbo-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "$ jq '.choices[0].text'"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 116,
"completion_tokens": 9,
"total_tokens": 125
}
}
… there's probably a lesson in there.