Repository navigation
Expand file tree
/
Copy pathinstallation Steps
More file actions
222 lines (155 loc) · 5.48 KB
/
Copy pathinstallation Steps
File metadata and controls
222 lines (155 loc) · 5.48 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Friday for Mac
Friday is a local voice assistant for macOS. You can speak commands such as
"open Spotify", "set the volume to 30", or "remind me to call Mom". It uses
Needle for local tool routing and Ollama for open-ended questions.
No cloud API key is required. The only online part of voice mode is Google's
speech-to-text service. Text mode works without it.
## What Friday can do
- Open or quit Mac applications
- Set, mute, or unmute system volume
- Set brightness, sleep the display, lock the screen, or empty the Trash
- Tell the time or date
- Search the web, check weather, or open a website in Safari
- Create Reminders and Notes
- Answer open-ended questions through a local Ollama model
## Requirements
- A Mac running macOS
- Python 3.9 or newer
- Homebrew
- A microphone for voice mode
- Ollama for open-ended answers
## Installation
### 1. Download the project
Clone the repository or download it from GitHub, then open Terminal in the
project folder:
```bash
git clone https://github.com/Shriyans737/jarvis-mac
cd jarvis-mac
```
If you downloaded a ZIP file instead, unzip it and run `cd` using that folder's
path.
### 2. Install macOS dependencies
```bash
brew install portaudio
```
Optional, only if you want brightness control:
```bash
brew install brightness
```
### 3. Create the Python environment
```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
```
Run `source .venv/bin/activate` again whenever you open a new Terminal
session before starting Friday.
### 4. Install and prepare Ollama
Install Ollama with [ollama.com](https://ollama.com) or Homebrew:
```bash
brew install ollama
```
Start the local Ollama server in its own Terminal window:
```bash
ollama serve
```
In a second Terminal window, download the default model once:
```bash
ollama pull llama3.2
```
Friday calls Ollama at `http://localhost:11434`. Keep `ollama serve` running
while Friday is running. To use another model that is already installed:
```bash
export OLLAMA_MODEL="model-name"
```
### 5. Allow macOS permissions
Open **System Settings → Privacy & Security** and allow the Terminal, iTerm,
or VS Code application you use to run Friday in these sections:
- **Microphone** for voice input
- **Camera** for the face-presence check
- **Accessibility** for screen locking and app control
macOS may also ask for permission the first time Friday controls Safari,
Reminders, Notes, Finder, or another application. Choose **Allow**.
## Running Friday
### Voice mode
In the project folder, with the virtual environment active:
```bash
python jarvis.py
```
A small always-on-top window shows whether Friday is ready, listening,
thinking, or speaking. It also displays what it heard and what it says.
Say commands beginning with “Friday”. The current configuration also accepts
phrases without the wake word. To require the wake word every time, set
`REQUIRE_WAKE_WORD = True` in `jarvis.py`.
### Text mode
Text mode is useful for testing without a microphone or camera:
```bash
python jarvis.py --text
```
### Run one command
```bash
python jarvis.py --once "open Safari"
```
## Example commands
```text
open Spotify
set volume to 20
what is the time
search the web for laptop deals
open youtube.com
what is the weather in Mumbai
remind me to call Mom
create a note saying buy milk
lock my screen
```
Use `stop`, `exit`, or `quit` to close Friday. Be careful with commands such
as `quit Terminal`, `lock my screen`, and `empty the Trash`.
## How routing works
Needle reads the functions and docstrings in `tools.py` and chooses a local
tool. Local tools run first. The Ollama fallback is used only when no local
tool returns a result. Weather is exposed to Needle only when the request
explicitly contains a weather-related word.
To add a command, create a function in `tools.py`, decorate it with
`@needle.tool`, and add it to `ALL_TOOLS`:
```python
@needle.tool
def toggle_wifi(state: str):
"Turn Wi-Fi on or off. state should be 'on' or 'off'."
subprocess.run(["networksetup", "-setairportpower", "en0", state])
return {"wifi": state}
```
## Troubleshooting
### `dquote>` appears in Terminal
The shell is waiting for a closing double quote. Press `Control+C` and retry
the command with matching quotes.
### Friday says it cannot reach Ollama
Make sure the Ollama server is running in another Terminal:
```bash
ollama serve
```
Then confirm that the model exists:
```bash
ollama list
```
You should see `llama3.2`. If not, run `ollama pull llama3.2`.
### The camera is unavailable
Close apps that may already be using the camera, check macOS Camera
permissions, and disconnect Continuity Camera if your iPhone is selected.
Friday tries several camera devices and continues without face checking if no
camera is available.
### The microphone does not work
Check Microphone permission for the application launching Python, confirm that
`portaudio` is installed, and test with text mode:
```bash
python jarvis.py --text
```
### An app action is blocked
Open **System Settings → Privacy & Security → Accessibility** and allow the
Terminal, iTerm, or VS Code application running Friday. AppleScript actions
may also require one-time permission approval.
## Limitations
- Friday currently runs from a Terminal rather than as a menu-bar application.
- Voice transcription uses Google's Web Speech API and therefore needs
internet access.
- Voice mode uses a camera face-presence check; text mode does not.
- Needle and the Ollama model download weights the first time they are used.