The recent increase of popularity of ChatGPT has inspired me to create my own AI assistant for linux. To use it you're first going to have to generate an OpenAI token: https://beta.openai.com/account/api-keys. Note that this is only free for 3 months, if you want to use it after that you're going to have to become openAIs special little pay piggy
Here's the source code, I am hereby releasing it under public domain, meaning you can claim it's your own and sell it on e-bay if you want:
#!/bin/bash
TOKEN="GET_YOUR_OWN_POORCEL"
while true;
echo "How can your linux assistant help you? "
do read input;
output="$(curl -s https://api.openai.com/v1/completions -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" -d '{ "model": "text-davinci-003", "prompt": "Act as a linux AI assistant. The current system is an arch linux system, with many commands such as ls, firefox, qualc, wa (wolfram alpha), date, xdg-open, mpv + more. Respond a single bash command that can be executed. Executing the commands directly is better than echoing the user how to execute them. Task: '"$input"'", "max_tokens": 4000, "temperature": 1.0}' --insecure)";
# Uncomment for deboogering:
# echo $output;
command="$(echo $output|jq -r .choices[0].text)"
echo "Would you like to run the following command? $command
press enter to confirm";
read;
eval "$command"
done;
Some cherrypicked examples:
Jump in the discussion.
No email address required.
Uhhhhhh
Jump in the discussion.
No email address required.
It'd keep doing stuff like
echo "ls"
lolyou still need to confirm to execute though
Jump in the discussion.
No email address required.
Just don't run it as root I guess lol...
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context