6 ms·
Like Clippy but for the CLI
- DiabloD3 3y agoGiven 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"
- fragmede 3y agobut 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.
- DiabloD3 3y agoUnfortunately, I have seen GPT give a response equivalent to the insanity I described above; it gave a very real, very working answer that was extremely harmful and was entirely inappropriate for the question. `tailscale export` is probably the more common form of hallucinating, totally harmless wishful thinking that doesn't work.
- TeMPOraL 3y agoWorst I've personally experienced so far is GPT-4 guiding me step-by-step on how to upgrade the Python version in my Ubuntu to something more recent - a process I then spent an hour undoing, after it broke apt (OS package manager), which led me to discover an obscure Stack Exchange post explaining you should never ever do that as Ubuntu relies (for some incomprehensible reason) on system Python being exactly the version it shipped with.
- seba_dos1 3y agoHonest question - did you expect any other outcome? If so, why? > (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.
- dvh 3y ago# rm -rf ./build Clippy: would you like to delete /boot instead? [Y/n]
- williamcotton 3y agoI’ve been using the GitHub Copilot CLI tool that is in beta for about 6 months. 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.
- Daviey 3y agoThanks 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!
- CR007 3y agoFor PHP there's the option of binary distribution using php-micro, sadly not all devs are into it as "just brew". They don't realize that the end user isn't a PHP dev and that having to install the runtime is an annoying step. https://github.com/easysoft/phpmicro https://github.com/easysoft/phpmicro
- teruakohatu 3y agoJust use brew to install it in your home directory. There is nothing unsafe about PHP.
- Daviey 3y agoI 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.
- teruakohatu 3y agoHomebrew works well on Linux (or wsl2) these days if that helps.
- Daviey 3y agoYou are missing the point.. I am not happy to install PHP on my local system, even php-cli. Finding ways to help me install it, doesn't meet the base requirement. EDIT: Thanks teruakohatu for trying to help tho!
- teruakohatu 3y ago> I also do not have access to an Apple device where I could use brew. Sorry, just trying to help.
- unhammer 3y agoThat seems handy, maybe this way I can keep using jq on the command line without ever having to learn jq's syntax. 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.
- deleted 3y ago[deleted]
- imgabe 3y agoIt’s weird to me that everyone is describing their AI helper as “Like Clippy for X!” Did we all forget that everyone hated Clippy?
- whatsakandr 3y agoI was expecting it to be an annoyance program that ran in the background and gave unhelpful suggestions. Instead, I'm trying to figure out if I can use this at work.
- TeMPOraL 3y agoClippy was some two decades ahead of its time. If they took the same design, but implemented it via GPT-4, the result would not only be genuinely useful, but likely superior to O365 Copilot - floating ambient-aware agent beats a chat sidebar.
- tempaway334751 3y agoif [[ $input == dear* ]]; then echo "It looks like you're writing a letter"
- jmull 3y agoExactly! That, and it was obscure how it could be fully disabled.
- Grimblewald 3y agoI loved clippy, and found it super helpful. Granted, I was a child and fascinated with the idea of artificial intelligence, which clippy was the closest thing to at that point in time. It was a useful tool, and it's at times irrelevant suggestions got me exploring things I would never have learned through school or casual exposure. All in all it was a fun, quirky, at times useful and all around great tool, just not for the target audience.
- rigid 3y agoGood example of software supporting teachers in education. Fascinating kids for hours without any teacher time. We need a clippy for math. :-)
- deleted 3y ago[deleted]
- Borg3 3y agohttp://borg.uu3.net/~borg/?fun/vim http://borg.uu3.net/~borg/?fun/vim
- phito 3y agoFirst time I see a CLI tool written in PHP, not sure how I feel about this...
- tambourine_man 3y agoThere are plenty of them. I feel like you should broaden your view.
- Minor49er 3y agoPrecisely. Not to mention that with PHP 7/8 improving a lot of the language, chances are that we are going to see way more PHP CLI projects popping up
- gbolcer 3y agosince the 80s, I've always kept a ~/.cryptic file that I would add commands for which I could never remember the format. It would be cool to use that as a localized fine-tuning.
- krisgenre 3y agoHow is this different from ShellGPT - https://github.com/TheR1D/shell_gpt https://github.com/TheR1D/shell_gpt ?
- simondebbarma 3y agoI was curious so I studied them briefly. Please take it with a grain of salt. 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.