[HN Gopher] Show HN: Interact with the terminal in plain English...
       ___________________________________________________________________
        
       Show HN: Interact with the terminal in plain English using GPT-3
        
       Author : dylanjcastillo
       Score  : 74 points
       Date   : 2023-01-27 15:23 UTC (7 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | Kronopath wrote:
       | 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...
        
       | graiz wrote:
       | 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?
        
         | dylanjcastillo wrote:
         | 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.
        
       | tiku wrote:
       | What could go wrong!
        
         | blacksmith_tb wrote:
         | 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?
        
           | dylanjcastillo wrote:
           | Great idea. Providing links to the relevant manpages makes a
           | lot or sense.
        
       | mzs wrote:
       | 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
        
         | dylanjcastillo wrote:
         | What's wrong about it?
         | 
         | It seems to get the result I want, but not sure if I'm missing
         | something.
        
       | bluecoconut wrote:
       | https://news.ycombinator.com/item?id=34102363
       | 
       | Another very similar tool / thread
        
       | [deleted]
        
       | submeta wrote:
       | 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.
        
       | [deleted]
        
       | joehogans wrote:
       | Have you tried Warp for mac, provided with Ai. Build with Rust.
       | 
       | https://www.warp.dev/
        
         | hbn wrote:
         | 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
        
         | dylanjcastillo wrote:
         | Haven't used it. Will check it out, thanks!
        
       | quartz wrote:
       | 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.
        
         | bamboozled wrote:
         | Looks cool? Won't be that cool when it decides to delete random
         | shit off your computer.
        
           | dylanjcastillo wrote:
           | 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.
        
             | woolcap wrote:
             | Ask GPT-3 for its opinion, "does this command look
             | potentially dangerous?"
        
           | kris_wayton wrote:
           | I suppose you would have to know to run "list all files
           | that..." prior to "delete all files that...".
        
             | jacquesm wrote:
             | 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.
        
         | dylanjcastillo wrote:
         | 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 :)
        
           | jacquesm wrote:
           | Suggest renaming it to 'please'.
        
         | phonescreen_man wrote:
         | Kind of wish the command was just "genie" though
         | 
         | Rename the binary? Or create an alias in your shell profile
        
       | thealch3m1st wrote:
       | What could go wrong ?
        
         | Ruq wrote:
         | "I'd like you to do X"
         | 
         | AI: "Okay: rm -rf --no-preserve-root"
        
       ___________________________________________________________________
       (page generated 2023-01-27 23:02 UTC)