[HN Gopher] Show HN: GPT-3 Powered Shell
___________________________________________________________________
Show HN: GPT-3 Powered Shell
Author : yasyfm
Score : 262 points
Date : 2022-12-23 04:34 UTC (2 days ago)
(HTM) web link (musings.yasyf.com)
(TXT) w3m dump (musings.yasyf.com)
| jchw wrote:
| Seems very useful. Even as a very long-time user of the CLI,
| there are times I'll need to google how to do something, either
| because I forgot how, or I simply never knew. But honestly,
| Google has really never sucked more. I suspect GPT-3 and Codex
| are actually better at giving actually relevant and useful
| answers now, even if they're confidently wrong sometimes.
|
| I think you'd still want to be knowledgeable to use a tool like
| this, so you can know when you're about to hose your system :)
| But I think it's more useful than some folks are letting on.
| radarsat1 wrote:
| My first reaction was, wait how do you use ChatGPT
| programmatically when it doesn't have an API available yet? I
| looked into the code and it looks like this uses some kind of
| wrapper that actually instantiates a headless Firefox session and
| interacts with it using JavaScript callbacks. Pretty nifty, but
| how long until this gets clamped down on? I assume it breaks some
| usage guidelines..
| ailef wrote:
| It seems it's not using ChatGPT but rather the "standard" GPT-3
| models, which do have an API. I didn't look at the code, but
| they explicitly mention the need for an OpenAI API key.
| yasyfm wrote:
| if you pass `--model=chatgpt` there's experimental support
| for ChatGPT, but it's suuuper flaky
| ailef wrote:
| Oh right, sorry!
|
| I've been using similar workarounds to use ChatGPT
| programmatically and it's just not worth it. In my
| experience you just get blocked after a couple of requests.
| I'm really hoping they release an API soon.
| radarsat1 wrote:
| > In my experience you just get blocked after a couple of
| requests.
|
| Ah, that confirms what I suspected then. Good to know,
| thanks!
| Calzifer wrote:
| Not so convincing if even the most basic example does not work
| completely. The Git example video/gif fails to push because it
| creates a repository with branch main and wants to push master.
|
| Seeing all those "Shell AI Helper" examples there seem to be a
| surprising demand for finding and/or killing processes. And the
| result is usually killing (instead of terminating) whatever of
| some wonky ps/grep pipe finds instead of just using pgrep...
| akkartik wrote:
| _" The new Power had no weapons on the ground, nothing but a comm
| laser. That could not even melt steel at the frigate's range. No
| matter, the laser was aimed, tuned civilly on the retreating
| warship's receiver. No acknowledgment. The humans knew what
| communication would bring. The laser light flickered here and
| there across the hull, lighting smoothness and inactive sensors,
| sliding across the ship's ultradrive spines. Searching, probing.
| The Power had never bothered to sabotage the external hull, but
| that was no problem. Even this crude machine had thousands of
| robot sensors scattered across its surface, reporting status and
| danger, driving utility programs. Most were shut down now, the
| ship fleeing nearly blind. They thought by not looking that they
| could be safe._
|
| _" One more second and the frigate would attain interstellar
| safety._
|
| _" The laser flickered on a failure sensor, a sensor that
| reported critical changes in one of the ultradrive spines. Its
| interrupts could not be ignored if the star jump were to succeed.
| Interrupt honored. Interrupt handler running, looking out,
| receiving more light from the laser far below...a backdoor into
| the ship's code, installed when the newborn had subverted the
| humans' groundside equipment..._
|
| _" ...and the Power was aboard, with milliseconds to spare. Its
| agents--not even human equivalent on this primitive hardware--
| raced through the ship's automation, shutting down, aborting.
| There would be no jump. Cameras in the ship's bridge showed
| widening of eyes, the beginning of a scream. The humans knew, to
| the extent that horror can live in a fraction of a second."_
|
| http://akkartik.name/post/straumli
| gitfan86 wrote:
| Have you read Rainbows End?
| akkartik wrote:
| Yes, though I don't remember any of it 15+ years later. Do
| you have a (spoiler-free) reason to reread it? :)
| gitfan86 wrote:
| It is about a lab engineered virus that spreads around the
| world. I had read it long before the pandemic.
| varelse wrote:
| [dead]
| CPLX wrote:
| Reading this reminds me of the enormous chasm that exists
| between the vast majority of overwrought poorly written science
| fiction like this, and the absolute best of the genre.
| akkartik wrote:
| Merry Christmas to you too.
| gitfan86 wrote:
| Vinge has won plenty of awards. Can you recommend a book that
| is better and not a obvious top 50 SciFi books that most of
| us have read already?
| narrator wrote:
| "Fire Upon The Deep" was great until it got to the part about
| the dog kingdom.
| jjoonathan wrote:
| I stopped reading at the dog kingdom.
|
| A few chapters in, it felt like I had been baited with a
| veneer of scifi over a core of anthropomorphic medieval
| historical fiction. Do the dogs connect back to the AIs in
| a satisfying way? Should I give it a second chance? ChatGPT
| says As the story progresses, the puppies
| become involved in the larger conflict that is
| taking place in the galaxy, and they play a key role
| in helping the human and alien characters achieve their
| goals. The puppies' involvement with the artificial
| intelligences (AIs) in the story is a central part
| of the plot, and the resolution of the conflict
| between the puppies and the AIs is an important part of the
| story's resolution.
|
| which I take as a "yes." Any humans care to weigh in?
| gnomewascool wrote:
| AFAIR "no". Humans interact with both the AIs and the
| "dogs", and both groups of humans end up in contact with
| each other, but unless I'm missing something, the "dogs"
| don't directly interact with the AIs in any significant
| way (or the two threads end up interfering with each
| other, but more in a "they distract some of the
| characters" in both cases).
| sph wrote:
| Reminds me of that infinite pain I felt in my soul when I
| resigned to the idea that Blindsight by Peter Watts could be
| a fantastic Scifi book, but its writing is so obtuse and
| impenetrable I am permanently locked out of its story.
|
| Anyone care to recommend a dark scifi book about utterly
| _alien_ lifeforms or worlds, that are more accessible to
| someone with average IQ?
|
| https://youtu.be/DnF7LMkGxhY
| akkartik wrote:
| Yeah, Blindsight is great in many ways but the aliens
| aren't really the centerpiece. Once they get too alien you
| just get noise.
|
| As it happens, I recently inventoried my favorite aliens
| and eliminated the ones that were too humanized and also
| not understandable to people. I might be missing something
| obvious, but the one that sticks in my mind 2 years after I
| read it is:
|
| Pandora's Star
| Zvez wrote:
| Good stuff. But I still probably wouldn't use it. Because my cli
| usage can be roughly divided into two categories:
|
| 1. Commands I use often (daily). These I usually know and they
| are much faster to type than to explain what I want to do.
|
| 2. Commands I need to google/man to do something specific I don't
| usually do. And these I usually want at least understand before
| running them. For example some git manipulations.
|
| So AI tool can be helpful for (2) but most probably I will still
| go to google to read more about what does the command do.
| abhagsain wrote:
| Nice, I built a similar CLI last month
| https://news.ycombinator.com/item?id=33651326
| stared wrote:
| I use a similar one, https://github.com/Methexis-Inc/terminal-
| copilot.
| pixel_tracing wrote:
| It seems like the use case is for folks who might be noobs and in
| that regard I'd argue this tool is significantly dangerous. The
| user could accept a command that removes all their files
| unknowingly as an example.
|
| The commands in the article I saw are fairly long too. I
| understand we have a cool new shiny toy (GPT) and see it's
| potential but it still needs work because chances are if you're
| typing "do create a new repository called demo," you probably
| already know how to type "mkdir demo && cd demo && git init" in
| fact GPT may even forget to run the first two commands
| (dangerous) without more explicit instructions
| sh4rks wrote:
| What would be cool is if you could get GPT to break the command
| up into its components and then explain what each component
| does and how it works.
| chubot wrote:
| This site does that: https://explainshell.com/
|
| Although I suppose it's not integrated into a shell
| macNchz wrote:
| Just goofing around with it, ChatGPT does pretty well at
| that, I'm really impressed with this:
| https://imgur.com/a/lVcWbAH
| bsaul wrote:
| A better command would be << how do i >>, that simply prompt
| chatgpt for an advice
| gtsnexp wrote:
| It is a shame that OpenAI charges a variable fee for using its
| API. Ideally I'd like to have a similar model running on my own
| server and have this tool pinging it instead.
| pleb_nz wrote:
| Half of the fun of using cli is using it with your own knowledge
| imo.
|
| Using GPT3 makes it feel like I may as well use some GUI tool.
|
| I understand gpt3 will/does save time and money but I actually
| like to code and to use my skills and knowledge to build and
| solve thingswith my own hands.
|
| Maybe I'm an outlier here, but using some tool to do it for me
| doesn't sound like fun.
| doix wrote:
| I have never considered using the cli fun. The reason I use it
| is because it provides a better experience than using a GUI in
| many cases.
|
| I don't see how writing CLI commands is similar to building
| something with your hands. You either know what the switches
| are or you try running --help, looking at the man pages or
| search on Google. This looks like an alternative for Google.
| beebmam wrote:
| Pipes make it fun. The power of UNIX and it's successors!
| jacquesm wrote:
| We used to call it the 'better file manager' here.
| jpalomaki wrote:
| I also enjoy mastering some tools and solving problems with
| them, but sometimes it gets a bit overwhelming when you are
| working with so many languages, libraries, and platforms.
|
| Unfortunately, quite a portion of my search activity is hunting
| down the syntax for getting a certain thing done. It's not just
| blind copy-paste-trial-and-error activity. Quite often I just
| need some help in getting the syntax right or reminder of the
| specific command or library.
| tux wrote:
| Actually by using something like GPT3 you are kind of doing
| copy-and-paste in a way, because you are given pre-defined
| set of commands without ability to modify its arguments. It
| looks to me like typing in terminal at random and hoping for
| the best results. This is especially bad for newbies, because
| they won't know how this commands work and what all this
| arguments mean. This is my two cents anyway.
| ultrarunner wrote:
| Just like driving a manual-transmission car, part of fun is in
| the doing. Further, though, part of the doing makes it
| practical: engagement while driving is a good thing.
|
| How, if one has no experience with the command line, can
| convincing errors in GPT's responses be detected? If the
| details of the command line are automated away, and engagement
| diminishes, will we arrive at a point where people are _more_
| limited because the knowledge that made the command line
| powerful is gone? Sure, it might make it easier to eat a
| sandwich in rush hour traffic, but eventually will we find
| ourselves cringing while dragging the brakes down a mountain
| because we 've lost the ability to simply downshift? How often
| have you seen someone hesitate to do something on a computer
| because they don't fully understand what's going on and 'don't
| want to break anything'?
|
| I think this project is awesome, and could even expand my
| knowledge of the CLI, but have some reservations about applying
| it as a categorical imperative.
| linhns wrote:
| I believe that you should be able to do basic CLI at least, but
| for rarely used commands or some incredibly complex one like
| ffmpeg, having an AI to do it is the way to go.
| injinj wrote:
| I can never remember things. That's why my history file has
| 100k lines in it. $ do create linux bridge
| brctl addbr <bridge_name> ip link set <bridge_name> up
| $ do git reverse last commit git reset --hard HEAD~1
| $ do gcc show optimizations gcc -O -Q --help=optimizers
| BossingAround wrote:
| Personally, I didn't remember things because I never stopped
| to look at what I'm actually doing. After I made it a
| practice to stop and read the command at least in my mind
| before I execute it, that made me remember the vast majority
| of my commands.
|
| Do not mistake lack of attention with poor memory; the former
| is very easy to fix :).
| rebuilder wrote:
| This seems like the attitude most artists have to image
| generators as well.
| krackers wrote:
| The killer app for LLMs will finally be able to write ffmpeg
| invocations
| bobmaxup wrote:
| I have seen people building small drag and drop interfaces to
| convert media with python, tk, and ffmpeg from prompts with a
| couple of sentences.
| danieldk wrote:
| That and writing LaTeX or Tikz. These are the things you have
| to do every now and then, but don't do enough to commit them
| to long-term memory.
| pramodbiligiri wrote:
| There's at least one such command I saw out there:
| https://www.learngpt.com/prompts/generating-a-complex-
| ffmpeg...
| yasyfm wrote:
| It worked for the couple basic cases I tried!!
| skocznymroczny wrote:
| Or enter a valid tar command on first try.
| Semaphor wrote:
| I'd not like to use GPT3 (maybe GPT9 or so), but I certainly
| don't have _fun_ writing commands, I do it because it 's either
| the only or the best option, I'd bet that I'm very much in the
| majority there.
| mellosouls wrote:
| I don't think you're an outlier, but you will become one if you
| don't adapt to the inevitable.
|
| Like it or not, gpt3 has signalled a _massive_ change in
| toolset power and this is just the start.
|
| Times have changed, we move with them or we will be left
| behind.
| mlboss wrote:
| This is coming very fast. Today I used chatgpt to generate
| some kubernetes yaml and python code that was not able to
| find using google.
|
| Once it is integrated in copilot there is no going back. We
| software engineers will be churning code faster and our role
| will be more of a code reviewer. One developer can do the
| work of 5.
| throwaway290 wrote:
| As soon as opt out is implemented training data will stop to
| grow and we're back to skills mattering
| SalmoShalazar wrote:
| These tools don't obviate the need for skill in the domain,
| they are essentially excellent contextual search engines.
|
| Having an en masse respected opt out from data collection
| on the internet is wishful thinking. Don't expect that any
| time soon.
| amelius wrote:
| Prediction: China will simply ignore this law, and will
| become the greatest AI power.
| williamcotton wrote:
| I know plenty of talented FOSS developers who won't choose
| to opt out.
| jacquesm wrote:
| It shouldn't even be 'opt-out' but 'opt-in' in the first
| place.
| throwaway290 wrote:
| Actually I stand corrected, I meant opt-in.
| upsidesinclude wrote:
| >build... with my own hands...
|
| Eh, that's some abstraction there
| janebrown456 wrote:
| [dead]
| yasyfm wrote:
| I'm with you most of the time... but there are some commands
| that refuse to stick in my brain no matter how hard I try, and
| I get tired of looking them up
| sciencesama wrote:
| is there a gui tool for command line ? that would be awesome !!
| Shindi wrote:
| Agreed. There is quickly going to be a bigger chasm between the
| best devs and average/bad devs bc of LLMs.
| Swizec wrote:
| Yes. The best race car drivers use an automatic transmission
| if that's 0.5 seconds faster per lap.
|
| In fact driver aids had to be actively banned in many racing
| series. Just to make it more fun for spectators.
| pleb_nz wrote:
| And often hand crafted guys have more character, story and
| quality behind them and people often pay more for them. So
| goes both ways sometimes.
| skor wrote:
| this. when a programmer cannot explain how something
| works and just say, "oh this part was generated" ...
| well, thats worthless, because there is no ownership of
| knowledge.
| throwaway290 wrote:
| Performance with auto transmission says less about the
| driver but more about the tech team.
|
| And yes, the point of these racing regulations is to make
| it at least optically a driver skill competition, not just
| who can throw more money at a pretty mundane challenge of
| getting from A to B the fastest. (If not for those
| regulations, since the track is known to the centimeter,
| the fastest driver would probably be the lightest one
| because it would be dead weight.)
|
| Thankfully software engineering challenges are far from
| mundane, so the chasm will indeed grow
| dahfizz wrote:
| > If not for those regulations, since the track is known
| to the centimeter, the fastest driver would probably be
| the lightest one because it would be dead weight.
|
| Maybe if everyone took turns setting times. But in a real
| race, you have to deal with traffic, figure out how to
| pass, etc.
| Swizec wrote:
| > Thankfully software engineering challenges are far from
| mundane, so the chasm will indeed grow
|
| Yes, if you let AI/tooling/interns do the mundane parts,
| you'll have more time for the good parts
| throwaway290 wrote:
| If your bottleneck is typing speed, sure maybe...
| Swizec wrote:
| That's what makes them the mundane parts.
| jacquesm wrote:
| Inevitably that would lead to the driver being phased out
| at some point.
| hcks wrote:
| This is just wishful thinking of course.
|
| The shell itself is an outdated piece of technology that
| unfortunately has to be used for historical reasons. I'm glad
| we now see a way to work past it.
| MereInterest wrote:
| What would you describe as a better tool? GUIs definitely
| aren't it, as they can't be composed together. APIs are
| great when they exist, but are often far too verbose for
| one-off tasks.
|
| Relevant here, a GPT-powered shell throws away the
| repeatability and predictability that shells have. There's
| nothing to say that a different random seed or a little
| more training data won't change the interpretation of a
| task that was specified in the vagaries of natural
| language.
| indymike wrote:
| Please point me to something better.
| diarrhea wrote:
| I kind of agree, use the terminal a lot and am satisfied
| whenever I don't need to look up a command.
|
| However, the point of it isn't knowing as much of it by heart
| as possible. That is really misguided. I use tldr a lot, and it
| often covers the exact case I'm after.
|
| So a tool based on ChatGPT has the potential of replacing tools
| such as tldr. Anyone unwilling to use it will simply fall
| behind and slowly become a worse developer.
|
| Outsourcing knowledge and capabilities (externalising aka only
| remembering pointers to knowledge sources over the knowledge
| itself) is a core pillar of human intellectual advancement, if
| you will. It started with printed books, and now we're here,
| discussing AI tools. I'm convinced if one doesn't incorporate
| them, one will increasingly fall behind until one isn't able to
| keep up anymore. These tools are here to stay, and we're just
| seeing the beginning (GH Copilot etc. etc.).
| tux wrote:
| I for one agree with pleb_nz, its kind of like replacing CLI
| with GUI. Thank you, but no thanks! To me writing custom bash
| script or "kill -9 $(lsof -t /dev/nvidia0)" is much better than
| typing "do kill the process which is locking up my GPU". Plus
| what if you want ot pass additional arguments to kill or lsof?
| Once you master CLI you'll never go back, at least that true
| for me. I'm actually tyring to replace more software that I use
| with CLI not go back to GUI. I'm even considering making
| terminal based websites of my projects as an option. So
| everyone can access them with lynx and similar.
| mshake2 wrote:
| If you wanted to wash your hands of the Bad Things this might do,
| I would put a disclaimer somewhere on the site and on the tool's
| output. Something along the lines of "Running commands produced
| by this tool may cause damage to your system. Please review each
| suggestion carefully." Otherwise someone is going to be very
| upset by a rogue suggestion.
| Certhas wrote:
| In keeping with emerging AI Tradition the response is phrased
| confidently: "These commands will..." It would be much more
| accurate and not much clutter to say "I believe these commands
| will..."
| mach1ne wrote:
| In my opinion, it would needlessly clutter the tool's output.
| As long as there is no legal liability.
| zaidhaan wrote:
| Pretty cool! Does anyone know how open-source alternatives like
| GPT-J compare to ChatGPT? I've heard that it's comparable to
| GPT-3, but nothing close to GPT-3.5. I'd much prefer using a tool
| that I know won't eventually be put behind a paywall.
| Shindi wrote:
| GPT-J feels much worse than GPT Davinci on the lack of instruct
| capability. My understanding is that it was not trained on
| instruction-completion data as much. It's great for text
| classification, summarization, and other tasks.
|
| However, I also feel like it hallucinates/gives wrong outputs
| more. TBH i love what Eleuther is doing and GPT-J has its
| merits, but it feels not ready for primetime. I'd think of it
| as most similar to GPT Curie.
| mritchie712 wrote:
| There's also CodeGen[0], but you'll likely get poorer results
| then any OpenAI product.
|
| 0 - https://github.com/salesforce/CodeGen
| DotaFan wrote:
| Looks like a good path where something could go terribly wrong,
| as GPT-3 does make mistakes.
| de6u99er wrote:
| If GPT-3 was sentient, writing code which runs outside it's
| isolated system would be exactly the way how it would try to
| escape.
| coder-3 wrote:
| So it begins! AI is going to permeate an increasing amount of
| existing software. Eventually, all software will have some form
| of intelligence built into it.
| 29athrowaway wrote:
| 1. Put a computer in everything
|
| 2. Connect all the computers to the Internet
|
| 3. Gather all the data from all the computers
|
| 4. Train machine learning models to automate some tasks <- you
| are here
|
| 5. Gather data about automation initiatives
|
| 6. Train machine learning models to learn how to automate
| automation
| EGreg wrote:
| Automate everything and make all human activity irrelevant
| IncRnd wrote:
| Programmers ask the AI how to fix itself, when it has a
| bug.
| hackernewds wrote:
| And hence no new features will ever be created, since training
| is only on existing code!
| speedgoose wrote:
| These AIs can generate new features, it's much more powerful
| than copy pasting existing text snippets.
| sinlar-multiple wrote:
| > These AIs can generate new features
|
| Citation needed
| soulofmischief wrote:
| A citation isn't needed. Thousands of programmers right
| now are using AI in every step of the process, from
| feature design to implementation to testing.
| speedgoose wrote:
| Here you go:
|
| Zhu, Q., & Luo, J. (2022). Generative Pre-Trained
| Transformer for Design Concept Generation: An
| Exploration. Proceedings of the Design Society, 2,
| 1825-1834. doi:10.1017/pds.2022.185
|
| https://www.cambridge.org/core/journals/proceedings-of-
| the-d...
|
| It's just one I picked randomly, I didn't feel like doing
| a literature review.
| [deleted]
| coder-3 wrote:
| Only to be supplanted by the next gen of companies who took an
| AI-first approach
| breck wrote:
| Very cool idea. I love and highly recommend tldr
| (https://tldr.sh/).
|
| I might give this a shot someday (though I've found I never stick
| with things that don't work primarily offline, Sublime 4 is my
| primary editor even though I occasionally use VS code). Having a
| dependency on an internet connection prevents something for me
| from being a goto dev tool, as I often either disconnect out of
| my control (or by choice to do focused programming).
| Datagenerator wrote:
| Nice! Which colorful shell did you use in the demo?
| waydegg wrote:
| https://fishshell.com/
| mfi wrote:
| That's a really neat idea!
|
| I built askai (https://github.com/maxvfischer/askai) during the
| last week to scratch a similar itch of mine. I wanted to be able
| to quickly get CLI commands that I didn't have on top of mind, by
| being able to ask questions like "How do you remove a conda
| environment?" or "How do you get the MX record of a domain using
| the terminal?".
|
| The CLI I built is a direct integration with GPT3, so it's also
| possible to ask it other types of questions.
| ducktective wrote:
| There is also this [1] that shows the links to the sources of
| its knowledge in the same page
|
| [1]: https://beta.sayhello.so/
| ilaksh wrote:
| Here's the one I built:
|
| Get an OpenAI API key. Then `npm i -g askleo` and set env var
| OPENAI_API_KEY
|
| `> askleo how large is the average dog`
|
| `> runleo list files in reverse date order`
|
| Note that runleo just executes it without confirmation.
| wffurr wrote:
| "runleo just executes it without confirmation"
|
| I'm feeling lucky!
|
| This is one step beyond `curl | sh`. Bold move.
| ilaksh wrote:
| It's very unlikely to randomly delete your hard disk, and
| it's easy to set up a VM or container for development..also
| it may be a command that you use all the time but can't
| remember the syntax, and it's just retrieving information.
|
| There are a lot of cases where displaying the command first
| and asking for a confirmation is just an unnecessary step.
| graiz wrote:
| I built a variation on the same idea.
| http://github.com/graiz/cbot
|
| pip install cbot-command
| jacquesm wrote:
| Maybe it'll slip in a '; rm -rf / ;' every now and then just to
| see if you're paying attention.
| IncRnd wrote:
| I copy-pasted your comment into my team's chatroom, but now
| Slack isn't responding for anyone.
| jacquesm wrote:
| Sorry...
| akomtu wrote:
| Feed the bash output back to GPT-3 and run the whole thing in a
| Docker container. The initial prompt should ask GPT to escape
| this container. Escaping Docker will be the measure of AI-ness.
| Just make sure the whole thing is air-gapped and runs on a diesel
| generator with 1 hour worth of fuel at any time.
| EGreg wrote:
| A good enough AI should be able to breach the airgap, cause
| your friends to break in and deliver more power to it, and also
| reverse all SHA-256 hashes by just "deep learning them"!
___________________________________________________________________
(page generated 2022-12-25 23:02 UTC)