Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Interact with the terminal in plain English using GPT-3 (github.com/dylanjcastillo)
90 points by dylanjcastillo on Jan 27, 2023 | hide | past | favorite | 27 comments



"Hi ChatGPT, how do I make Steam download games faster?". "According to archive.4chan.org, you should run the following command: sudo rm -rf /"


Amazing. Looks like their training data was a little dirty.


At least it's citing sources in this version of it ;-)


After I started using ChatGPT, I started to write Elisp code again. - So many times I needed to trasnform a couple of hundred files or automate repetitive things, and I knew Emacs Lisp was the perfect choice for it, but I could not write Elisp code fast enough because I did not remember all relevant functions names. Now ChatGPT gives me working code, and it‘s 80-90% perfect. From there on it’s easy to get the rest done.


Have you tried Warp for mac, provided with Ai. Build with Rust.

https://www.warp.dev/


You know, I've used Warp for a while now and I remember them releasing the AI feature and ignoring it because it sounded like a cute gimmick to look good for VC fundraising, but I just played around with it now and it's actually pretty impressive.

Tested on a folder of pictures I have called 2022

"Count how many files are in the folder called 2022"

ls 2022 | wc -l

"List all the files in the folder called 2022 and their files sizes"

ls -lh 2022/*

"Count how many files are in the folder called 2022 that are over 1MB"

find 2022 -type f -size +1M | wc -l

"Count how many unique file types are in the folder called 2022"

find 2022 -type f | sed 's/.*\.//' | sort | uniq -c


Haven’t used it. Will check it out, thanks!


  Q: best way to get lots of paperclips by tomorrow
  A: Buy them online at ABC.com or XYZ.com.

  Q: whats a better way?
  A: Run the following shell script.

  RUN_AI=./query-model
  PREFIX='This is part of a Shell script to get the most paperclips by tomorrow.
  The model can be queried recursively with $RUN_AI "${PREFIX}<query>".
  '
  $RUN_AI "${PREFIX}On separate lines, list ideas to try." |
  while read -r SUGGESTION; do
    eval "$($RUN_AI "${PREFIX}What code implements this suggestion?: ${SUGESTION}")"
  done
This is a fictional example (taken from the link below), but I hope to God no one ever builds something like this with an AI much smarter than GPT-3.

https://www.alignmentforum.org/posts/kpPnReyBC54KESiSn/optim...


This looks really cool. The number of times I've had to google things like "delete all files that were created before a certain date but not if they have certain characters or are a certain extension" is uncountable.

Kind of wish the command was just "genie" though. Suppose I could ask it how to change the name.


Looks cool? Won’t be that cool when it decides to delete random shit off your computer.


It won’t run any command unless you explicitly tell it to do so.

But yes I’d also like to provide some sort of warning if a certain command “looks dangerous”. I’ve been thinking about what's the best approach.


Ask GPT-3 for its opinion, "does this command look potentially dangerous?"


I suppose you would have to know to run "list all files that..." prior to "delete all files that...".


That's just asking for it. A nice little model reload in the middle of those two statements, or maybe the difference between 'delete' and 'list' is enough to enable 'evil mode' which then does something entirely different.

I'd list the files to a file and then process that file after checking for errors in a way that doesn't allow for new errors to be introduced. Better still I'd ask it to generate a command which lists the files, look it over, execute it and if that lists the right files manually change the 'ls' to 'rm'. Otherwise you're at the mercy of the gods. Who are like sysops: subtle and quick to anger.


Kind of wish the command was just "genie" though

Rename the binary? Or create an alias in your shell profile


Thanks! I thought of using a shorter name but the ones I liked were already used in pypi.

You can always add `alias genie=shell-genie` to your .bashrc or .zshrc file :)


Suggest renaming it to 'please'.


What could go wrong ?


"I'd like you to do X"

AI: "Okay: rm -rf --no-preserve-root"


Nice - similar to demo I threw together https://github.com/graiz/cbot/ The more interesting piece for me was free-genie? What is that built on? Is that open source?


Nice!

free-genie is my own API. It also uses gpt, but my goal is to collect data and then finetune a model with it.


https://news.ycombinator.com/item?id=34102363

Another very similar tool / thread


What could go wrong!


I see it does provide some details (and asks if you want to proceed), maybe adding a --verbose / -v flag could throw in some more details, or a link to a manpage for the command?


Great idea. Providing links to the relevant manpages makes a lot or sense.


and of course that answer is wrong: "find all json files in the current directory that are larger than 1MB"

find . -name "*.json" -size +1M


What's wrong about it?

It seems to get the result I want, but not sure if I'm missing something.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: