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.

It always amazes me at how much people suck at bash.

Jump in the discussion.

No email address required.

It works :#tayshrug:

Jump in the discussion.

No email address required.

Its not bad compared to what I have seen. If we are talking in absolutr terms here though, its like maybe 30 lines of code and introduces security issues using eval, will break in a bunch of different cases, and a misunderstanding of strings and word splitting.

Jump in the discussion.

No email address required.

That's why you have the AI to spit back how much of an rslur you are :marseyclappingglasses:

Jump in the discussion.

No email address required.

:marse#ysoypoint2:

Jump in the discussion.

No email address required.

The funny thing is actually am the farthest thing from a nerd. I am a multi sport athlete currently at a d1 school, I am on the track, soccer, football, basketball, wrestling, and underground bare knuckle boxing team. remember this is all d1 level athletics. My best sport is football however where I am the starting quarterback, cornerback, punter, and in high pressure situations I will usually kick the field goal since according to espn, I have "an aptitude for high pressure situations". I have never practiced nor studied or tried at anything I have done in life. Instead I spend my time hazing freshman in my local frat and taking groups of 5-10 women down to the quarry to have s*x with. Remember these are all women and I am the only man, we don't wear condoms and they are all are alumni of the annual harvard crimson top 15 hottest freshman (or are on track). Oh I guess forgot to say, I go to harvard. Its been a crazy trip I remember when I would get made fun of in middle school for being 6 feet tall and having a horse peepee, but I faced that adversity and came out the other end a better man. I don't use the internet nor do I know what that even is, I take long hikes (with women) and contemplate the mysteries of the universe such as who is trully better Lebron or MJ. I have never read anything in my life, but if I was literate Decision Points and the Departed script would be my favorite books. I do not dance nor do I have any rythtm, instead during parties I have stacking wars against local opps for 20 minutes, then aggresively yank women into thr bathroom until it has reached an occupancy level of which I am satisfied, then lay down and let them take turns on my obelisk. I have 90 children from 340 different women, and I am a dutiful father who makes sure to always visit them 1 day every other year excluding leap years (I celebrate privately). I only wear designer clothing and do not wash clothes, instead I throw them away or use them as projectiles to hit members of the marching band during games.

Jump in the discussion.

No email address required.

OUT!

Jump in the discussion.

No email address required.

:#marseynerd2:

Jump in the discussion.

No email address required.

The only people who care about good bash are those who couldn't get to be real programmers.

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.