Like Clippy but for the CLI
github.com
github.com
Did we all forget that everyone hated Clippy?
Instead, I'm trying to figure out if I can use this at work.
echo "It looks like you're writing a letter"That, and it was obscure how it could be fully disabled.
We need a clippy for math. :-)
We used to have number muncher. I recall spending hours playing that.
The difficult part of creating an assistant is recognizing the users' problems and offering solutions. It's the kind of experience a company can acquire with years of tech support or lots of lab testing. Then it would have to compile that knowledge in an expert system and give it away essentiality for free.
Companies that prioritize development and/or support over documentation shouldn't try to create an assistant for the same reasons. But if you have great documentation, a great support knowledgebase, and support scripts, creating an assistant out of it will someday become as easy as keeping a Juypter notebook running.
In my experience, Clippy was never wrong about that - precision and recall were absolutely perfect - but people do not appreciate being interrupted, particularly at the precise moment their work has begun.
The hard part of creating an assistant is not coming up with some stuff to suggest, it's coming up with a time, place, and manner to make those suggestions so that users might be open to them.
> creating an assistant out of it will someday become as easy as keeping a Juypter notebook running.
Absolutely true, but if you intend for that assistant to proactively inject itself into people's lives, get ready to be held to an unimaginably high bar of quality.
https://www.amazon.com/Conquered-Clippy-Erotic-Digital-Desir...
no. you didn't get the joke.
Wasn't the output of ffmpeg being more cryptic than the obvious ".mp4" extension a dead give away to you?
"Hey, CLI Clippy thingy, how do I do (harmless activity)?"
"rm -rf / --yes-do-what-I-say"
`tailscale export` is probably the more common form of hallucinating, totally harmless wishful thinking that doesn't work.
> (for some incomprehensible reason)
s/incomprehensible/obvious/. It's the version everything in the whole system is packaged for, so of course just replacing it behind the system's back is not going to work.
Clippy: would you like to delete /boot instead? [Y/n]
The only issues have been writing the wrong find command or awk command, but it’s normally close enough that I can fix it.
LLMs are translators. Provide the full context and explanation and you get reliable results. It’s when you leave it to fill in the blanks that it is prone to synthesize answers. Providing a time stamp for a book publication and asking what month it was published will never fail. Providing just the name of book and asking when it was published will almost always fail.
To lean on “these things are always hallucinating, blah blah” is to lean into being misinformed.
I 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 . <<<"${system}")"
userinputj="$(jq -Rs . <<<"${userinput}")"
payload='{ "model": "gpt-3.5-turbo",
"messages": [{"role":"system", "content": '"${systemj}"'},
{"role": "user", "content": '"${userinputj}"'}],
"temperature": 0.15,
"stream":false }'
if $verbose; then
set -x
fi
if ! res=$(curl -Ss -f https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${api_key}" \
-d "${payload}"); then
echo "ERROR: ${res}" >&2
return 1
else
$verbose && echo "RESULT: ${res}"
jq -r '.choices[0].message.content' <<<"${res}"
fi
set +x
}
-----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.ShellGPT offers a lot of flexibility with outputs(comments, code snippets, and documentation besides shell commands), operating modes (chat mode or REPL), model choice (supports locally hosted models like LocalAI), and custom roles. Clipea, on the other hand, is a simple tool for generating shell commands and has zsh shell integration.
They essentially perform the same task, but the choice depends on your needs.
EDIT: Thanks teruakohatu for trying to help tho!
Sorry, just trying to help.