Unable to load image

Get your very own AI assistant for linux :marppy:

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 :marseywholesome:

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:

https://i.rdrama.net/images/16841361387119594.webp

https://i.rdrama.net/images/16841361390907795.webp

https://i.rdrama.net/images/1684136139545239.webp

https://i.rdrama.net/images/1684136140069456.webp

https://i.rdrama.net/images/16841361404385724.webp

/images/16719547334161484.webp

33
Jump in the discussion.

No email address required.

Executing the commands directly is better than echoing the user how to execute them.

Uhhhhhh

Jump in the discussion.

No email address required.

It'd keep doing stuff like echo "ls" lol

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

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.