11 ms·
Show HN: Whiz – A copilot for your terminal
- wendyshu 3y agohttps://github.com/TheR1D/shell_gpt https://github.com/TheR1D/shell_gpt already exists
- programmarchy 3y agoI was able to understand the Whiz source (~200 lines) in about sixty seconds, which is a big win in my opinion. The shell_gpt code is more convoluted. Would be interesting to compare how they perform.
- swah 3y agoAnd I love just typing a key combination to get the suggestion, almost like I can change my mind during the command...
- pplonski86 3y agoIt is quite similar to https://github.com/KillianLucas/open-interpreter https://github.com/KillianLucas/open-interpreter Such terminal tools are quite like AI agents, it should think about steps and then execute one by one.
- searchableguy 3y agoThat's a cool project. I built this after copy pasting the same git command to list all the recently committed branches from chat.openai.com. I have a couple more functions that I want to add to the CLI like [0] translating novels, web scraping or LLM powered grep. 0] https://gist.github.com/searchableguy/436933aa9f95a423d2f89d36a92d6259 https://gist.github.com/searchableguy/436933aa9f95a423d2f89d...
- programmarchy 3y agoI was wondering if Whiz was using agent-style planning prompts, but it's much simpler and passes a single `function` parameter named `shell` to the OpenAI API. I thought that was clever, because shell commands are highly composable, so it's likely that something can be done in "one shot". It will also be way more efficient with token usage.
- jingles_dev 3y agoThis is cool
- vinni2 3y agoHow does it compare to gorilla cli? https://github.com/gorilla-llm/gorilla-cli https://github.com/gorilla-llm/gorilla-cli
- imsurajkadam 3y agoI tried this but when I am running commands like wz can you install beautifulsoup and such things then it is giving me the syntex error: JSON command is: "wz can you install bs4"
- searchableguy 3y agoI can reproduce this. The issue is ChatGPT hallucinating a function that doesn't exist. I'm figuring out how to rail guard against this. Thanks for trying it out and reporting with an example. If I switch to ChatGPT 4, it works fine.
- imsurajkadam 3y agoI too am using the ChatGPT4 and yet this is the issue. Do i need to make any changes?
- searchableguy 3y agoI updated the instructions and added a feature to change the model used by whiz. Could you please update whiz_cli using npm and add `export WHIZ_LLM_MODEL=gpt-4` to your shell. instructions are available in README now: https://github.com/searchableguy/whiz#installation https://github.com/searchableguy/whiz#installation
- dventimi 3y agoWhat does it do
- binary_wizard01 3y agoI've built a similar shell script a while ago and still use it quite frequently: https://github.com/Luanf/cligpt https://github.com/Luanf/cligpt
- searchableguy 3y agoI love yours. It is entirely in shell script. I recommend using chatgpt functions for more reliability. I'm making use of them[0]. I wanted to use javascript to extend it with a plugin system, haha. 0] https://github.com/searchableguy/whiz/blob/main/src/completion.ts#L21 https://github.com/searchableguy/whiz/blob/main/src/completi...
- deleted 3y ago[deleted]
- ctenb 3y agoNice. It would be cool if something like this existed for nushell. Chatgpt4 struggles with that language unfortunately
- mellosouls 3y agoA reminder to users of Github CoPilot who may be unaware, there is also a terminal version you can install included in your subscription. It's ok. (Edit) There is a waitlist. https://githubnext.com/projects/copilot-cli https://githubnext.com/projects/copilot-cli
- hiatus 3y agoThis seems to require joining a waitlist to gain access.
- samanator 3y agoYup, I've been on the waitlist since May
- mellosouls 3y agoYes, I've updated my comment.
- fortyseven 3y agoHighly recommend it, too. I've found it invaluable. Especially for some of the more arcane ffmpeg incantations.
- brentm 3y agoI'd consider using something besides 'list all files' as first example in the gif. I'd think anyone who opens a terminal knows how to do that so listing files in a directory and hitting a spinner isn't very inspiring. The second curl example is better since plenty of people won't know that off the top of their head.
- jstummbillig 3y agoMeh. I am fairly certain the number of people who would both use this and also fail to consider possible use cases half a second into the ls demo is zero.
- rcthompson 3y agoI think the point of the demo is to start with something dead simple that "everyone" knows and get more complex with each example.
- kitd 3y agoCan it create regexes? That would be the thing that would sell it to me via a demo.
- danielvaughn 3y agoThere's also https://www.warp.dev https://www.warp.dev I've been using it for the past few weeks and it's really sleek. I actually don't use the AI features very often because I'm fluent in the terminal, but it's nice to know it's there if I need it. Some people get weirded out by the fact that it's VC funded and they collect telemetry, but I think you can turn that off.
- bitwize 3y agoAgain, business model: Juicero for bash. Collecting telemetry, and being able to tie it with people's GitHub profiles, is why Warp was able to secure millions of VC dollars to build a fucking mOdErN terminal emulator.
- kunalgupta 3y agoi love warp.
- red_hare 3y agoI loved Warp for it's speed, but the keybindings and lack of configuration didn't work for me. For example, it doesn't support "ctrl+x ctrl+e" which I use daily for editing long prompts in vim. I recently switched to Kitty (https://sw.kovidgoyal.net/kitty/ https://sw.kovidgoyal.net/kitty/) and I don't think I'm ever going back. It's not flashy and doesn't have any AI features. It's just a donation-funded, wickedly fast, highly configurable, dotfiles-friendly, modern terminal emulator.
- danielvaughn 3y agoI tried kitty and it had a noticeable lag on startup. It bothered me at a gut level so I stopped using it, but I should probably give it another look.
- sgarland 3y agoThe only thing holding me back from loving Kitty was its behavior when ssh’ing, even if ssh was aliased to kitty +kitten ssh. Namely, that if you sudo’d to another user, the TERM settings were lost and so backspace became space (among other things). Today, I finally figured out to export XTERM before sudo, which fixes it. Hallelujah.
- o_1 3y agothis should be called terminator
- daniel_sushil 3y agoPretty neat use case. I like it
- ramesh31 3y agoSeems like a perfect use case for local models. Not sure I want to be sending my .bash_profile or .bash_history (or local env vars...) to OpenAI. And I can't imagine doing anything in the terminal that llama2-code-7b couldn't make sense of. That can trivially run on an M1 with 8GB.
- danenania 3y agoPretty easy to see in the code that it is not sending any of that to OpenAI. It's only sending the prompt, OS info, and shell type: https://github.com/searchableguy/whiz/blob/main/src/commands/shell.ts https://github.com/searchableguy/whiz/blob/main/src/commands... https://github.com/searchableguy/whiz/blob/main/src/completion.ts https://github.com/searchableguy/whiz/blob/main/src/completi... That said, OP, it's perhaps worth making this extremely clear in the README as it's a reasonable concern.
- searchableguy 3y agoThanks. I will add a note on privacy.
- programmarchy 3y agoI was surprised that Whiz could use tools like ffmpeg even though it tells ChatGPT to only use available shell commands. I asked it to "convert demo.mov to an mp4" and "cut the first five seconds of demo.mp4" and it came back with the correct commands. I guess that was enough to allow it to assume ffmpeg is probably installed. Pretty cool!
- danenania 3y agoLooking at the code, the system prompt says "You MUST NOT use functions that are not available." but apart from the OS info, it's not giving GPT any info on what commands are/aren't available, so I'd imagine it's a bit of a crapshoot.
- gorenb 3y agoGitHub copilot has created something (still in beta) that does this.
- bitwize 3y agoThis kind of reminds me of the database Q&A, which used SRI's NLP tech to allow you to query databases with "plain English".
- 5350-uiop-1130 3y agonice idea but anything written in node/deno/whatever will definitely stop working < 6 months unless its heavily maintained.
- mike986 3y agoAll of the alternatives commented so far have the same downside, you got a LLM response and you can either run it or abort. https://github.com/tom-doerr/zsh_codex https://github.com/tom-doerr/zsh_codex ^ This is much nicer as it hook into zsh completion so you got a response that drop right into the shell input (enter to execute or edit away) Also you can write shell script directly in prompt and use it to auto complete the rest
- isuckatcoding 3y agoWhat are the security implications of this? If you ask it something like “pipe the output of <CLI> using <MY_SECRET_TOKEN> to grep to find XYZ”
- livrem 3y agoWe need good locally installed LLMs (and cheap hardware to run it). I hope there can be some kind of breakthrough for this similar to what Stable Diffusion made for image-generators. I tried to generate some simple code using a few of the llama-models small enough to run on my computer and it did surprisingly well, but still far from good enough to be useful.
- syntaxing 3y agoFor people who use terminal a lot, I find shell gpt a good mixture [1]. Flexible enough to pipe commands, generic enough to ask questions. [1] https://github.com/TheR1D/shell_gpt https://github.com/TheR1D/shell_gpt
- rd 3y agoHow is this different than https://fig.io/ https://fig.io/?
- lusus_naturae 3y agoIt appears whiz is foss, while fig is not.