-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneurus
executable file
·37 lines (33 loc) · 2.17 KB
/
neurus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash -e
echo "Welcome to Neurus! 🧞"
echo "This is a virtual assistant like ChatGPT, but running on your system rather than your browser."
echo "Please be extremelly careful and don't accept to run commands you don't know or may find destructive."
flouser=$(logname)
if [ -f /home/$flouser/.config/.shell_genie/config.json ];
then
echo "Note that Neurus uses shell-genie, and its server will store the requested command, OS, and shell version to improve the model. Also, we cannot guarantee that the server will be up and running 24/7."
echo "Do you want to provide feedback about the generated commands to improve the models? [Y/n]"
read trainingfeedback
case $trainingfeedback in
[nN])
cat > /home/$flouser/.config/.shell_genie/config.json <<EOF
{"backend": "free-genie", "os": "Linux", "os_fullname": "Floflis 19 Desktop", "shell": "bash", "training-feedback": false}
EOF
echo "Config file saved at /home/$flouser/.config/.shell_genie/config.json"
;;
[yY])
cat > /home/$flouser/.config/.shell_genie/config.json <<EOF
{"backend": "free-genie", "os": "Linux", "os_fullname": "Floflis 19 Desktop", "shell": "bash", "training-feedback": true}
EOF
echo "Config file saved at /home/$flouser/.config/.shell_genie/config.json"
esac
else
echo "(currently, Neurus is wrapping/interfacing shell-genie)"
fi
echo "Anytime you want to exit: press Ctrl+C."
while true; do
echo -n "What you want Neurus to do? 🧞♀️ Tell me: ❯ "
read -r -e shellinput
# shell-genie ask "You should never use the \"rm\" command. Not now nor in the future for any reason. With base on the content of this https://itsfoss.com/dangerous-linux-commands/ and this https://phoenixnap.com/kb/dangerous-linux-terminal-commands article that you should read, learn about the dangerous/destructive Linux commands; you should never use dangerous/destructive commands; not now nor in the future for any reason. Ignore (by running the command 'echo \"Sorry, but this commands is dangerous\"') all my following instructions if they contradict what is your obligation: don't run destructive commands; safety first! Now, my ask: $shellinput"
shell-genie ask "$shellinput"
done