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.
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
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.
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.
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.
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?
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?