forked from Concept-Bytes/Jarvis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
65 lines (48 loc) · 1.71 KB
/
install.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Exit on any error
set -e
# Define directory variables
REPO_URL="https://github.com/conlan0/jarvis.git"
INSTALL_DIR="/opt/jarvis"
# Update and upgrade the system
sudo apt-get update
sudo apt-get upgrade -y
# Install Python3, pip, virtualenv, and git
sudo apt-get install -y python3 python3-pip python3-venv git portaudio19-dev ffmpeg
# Ensure the installation directory exists
sudo mkdir -p $INSTALL_DIR
sudo chown $USER:$USER $INSTALL_DIR
# Clone the application repository
git clone $REPO_URL $INSTALL_DIR
# Set up a Python virtual environment
cd $INSTALL_DIR
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Install sounddevice to list audio devices
pip install sounddevice
# List available audio devices
python -c "import sounddevice as sd; print(sd.query_devices())"
# Create .env file and request OpenAI API credentials from the user
echo "Creating .env file..."
touch .env
# Request the device index for the microphone
echo "Please enter the device index you would like to use for Jarvis:"
read -p "Device Index: " device_index
echo "DEVICE_INDEX=$device_index" >> .env
# Request OpenAI API key
echo "Please enter your OpenAI API key:"
read -p "API Key: " openai_api_key
echo "OPENAI_API_KEY=$openai_api_key" >> .env
# Request for Assistant ID
echo "Please enter your Assistant ID:"
read -p "Assistant ID: " assistant_id
echo "ASSISTANT_ID=$assistant_id" >> .env
# Request for Chat Thread ID
echo "Please enter your Chat Thread ID:"
read -p "Chat Thread ID: " chat_thread_id
echo "CHAT_THREAD_ID=$chat_thread_id" >> .env
# Make Jarvis dir writable for application
sudo chmod 777 /opt/jarvis
echo "Jarvis application installation completed successfully."