hey-agent 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. hey_agent-0.1.0/.github/workflows/publish.yml +64 -0
  2. hey_agent-0.1.0/.github/workflows/tests.yml +19 -0
  3. hey_agent-0.1.0/.gitignore +11 -0
  4. hey_agent-0.1.0/LICENSE +21 -0
  5. hey_agent-0.1.0/PKG-INFO +316 -0
  6. hey_agent-0.1.0/README.md +268 -0
  7. hey_agent-0.1.0/RELEASING.md +21 -0
  8. hey_agent-0.1.0/docs/tui-activity.png +0 -0
  9. hey_agent-0.1.0/docs/tui-approval.png +0 -0
  10. hey_agent-0.1.0/docs/tui-speaking.png +0 -0
  11. hey_agent-0.1.0/docs/tui-thinking.png +0 -0
  12. hey_agent-0.1.0/docs/tui-voices.png +0 -0
  13. hey_agent-0.1.0/npm/README.md +12 -0
  14. hey_agent-0.1.0/npm/bin/hey-agent.js +30 -0
  15. hey_agent-0.1.0/npm/package.json +20 -0
  16. hey_agent-0.1.0/pyproject.toml +59 -0
  17. hey_agent-0.1.0/src/heyagent/__init__.py +3 -0
  18. hey_agent-0.1.0/src/heyagent/__main__.py +4 -0
  19. hey_agent-0.1.0/src/heyagent/agents/__init__.py +42 -0
  20. hey_agent-0.1.0/src/heyagent/agents/activity.py +70 -0
  21. hey_agent-0.1.0/src/heyagent/agents/anthropic_api.py +101 -0
  22. hey_agent-0.1.0/src/heyagent/agents/base.py +180 -0
  23. hey_agent-0.1.0/src/heyagent/agents/claude_code.py +78 -0
  24. hey_agent-0.1.0/src/heyagent/agents/cline.py +101 -0
  25. hey_agent-0.1.0/src/heyagent/agents/codex.py +53 -0
  26. hey_agent-0.1.0/src/heyagent/agents/gemini.py +44 -0
  27. hey_agent-0.1.0/src/heyagent/agents/opencode.py +47 -0
  28. hey_agent-0.1.0/src/heyagent/approve.py +110 -0
  29. hey_agent-0.1.0/src/heyagent/cli.py +288 -0
  30. hey_agent-0.1.0/src/heyagent/config.py +270 -0
  31. hey_agent-0.1.0/src/heyagent/control.py +137 -0
  32. hey_agent-0.1.0/src/heyagent/daemon.py +110 -0
  33. hey_agent-0.1.0/src/heyagent/engine.py +500 -0
  34. hey_agent-0.1.0/src/heyagent/events.py +41 -0
  35. hey_agent-0.1.0/src/heyagent/paths.py +43 -0
  36. hey_agent-0.1.0/src/heyagent/prompts.py +24 -0
  37. hey_agent-0.1.0/src/heyagent/sessions.py +60 -0
  38. hey_agent-0.1.0/src/heyagent/speech/__init__.py +1 -0
  39. hey_agent-0.1.0/src/heyagent/speech/audio.py +260 -0
  40. hey_agent-0.1.0/src/heyagent/speech/stt.py +139 -0
  41. hey_agent-0.1.0/src/heyagent/speech/tts.py +276 -0
  42. hey_agent-0.1.0/src/heyagent/speech/vad.py +100 -0
  43. hey_agent-0.1.0/src/heyagent/speech/wake.py +140 -0
  44. hey_agent-0.1.0/src/heyagent/tui.py +847 -0
  45. hey_agent-0.1.0/tests/conftest.py +80 -0
  46. hey_agent-0.1.0/tests/test_agents.py +134 -0
  47. hey_agent-0.1.0/tests/test_audio_text.py +60 -0
  48. hey_agent-0.1.0/tests/test_config.py +37 -0
  49. hey_agent-0.1.0/tests/test_engine_control.py +122 -0
  50. hey_agent-0.1.0/tests/test_tools_and_approvals.py +147 -0
  51. hey_agent-0.1.0/tests/test_tui.py +87 -0
  52. hey_agent-0.1.0/tests/test_wake.py +36 -0
  53. hey_agent-0.1.0/tests/tests_helpers.py +47 -0
@@ -0,0 +1,64 @@
1
+ name: publish
2
+
3
+ # Publishes to PyPI (trusted publishing, no token) and npm when a GitHub release is published.
4
+ # Can also be run by hand from the Actions tab.
5
+ on:
6
+ release:
7
+ types: [published]
8
+ workflow_dispatch:
9
+ inputs:
10
+ target:
11
+ description: "What to publish"
12
+ type: choice
13
+ options: [both, pypi, npm]
14
+ default: both
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+ - run: pip install build twine
25
+ - run: python -m build
26
+ - run: twine check dist/*
27
+ - uses: actions/upload-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ pypi:
33
+ needs: build
34
+ if: github.event_name == 'release' || inputs.target != 'npm'
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/p/hey-agent
39
+ permissions:
40
+ id-token: write
41
+ steps:
42
+ - uses: actions/download-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
47
+
48
+ npm:
49
+ if: github.event_name == 'release' || inputs.target != 'pypi'
50
+ runs-on: ubuntu-latest
51
+ permissions:
52
+ contents: read
53
+ id-token: write
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ - uses: actions/setup-node@v4
57
+ with:
58
+ node-version: "22"
59
+ registry-url: "https://registry.npmjs.org"
60
+ - name: Publish npm wrapper
61
+ working-directory: npm
62
+ run: npm publish --provenance --access public
63
+ env:
64
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,19 @@
1
+ name: tests
2
+ on:
3
+ push:
4
+ pull_request:
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ os: [ubuntu-latest, windows-latest, macos-latest]
11
+ python: ["3.10", "3.13"]
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: ${{ matrix.python }}
18
+ - run: pip install -e ".[dev]"
19
+ - run: pytest -q
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ *.onnx
10
+ *.wav
11
+ .env
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Harsh Dabas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,316 @@
1
+ Metadata-Version: 2.5
2
+ Name: hey-agent
3
+ Version: 0.1.0
4
+ Summary: Voice-first 'Jarvis' for your terminal: say 'Hey Claude', 'Hey Codex' or 'Hey Gemini' and talk to your AI agents.
5
+ Project-URL: Homepage, https://github.com/itsHarshDabas/heyagent
6
+ Project-URL: Issues, https://github.com/itsHarshDabas/heyagent/issues
7
+ Author: Harsh Dabas
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: assistant,claude-code,cli,codex,gemini,jarvis,tui,voice
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: numpy>=1.24
19
+ Requires-Dist: sounddevice>=0.4.6
20
+ Requires-Dist: textual>=0.60
21
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
22
+ Provides-Extra: all
23
+ Requires-Dist: anthropic>=0.70; extra == 'all'
24
+ Requires-Dist: elevenlabs>=1.0; extra == 'all'
25
+ Requires-Dist: faster-whisper>=1.0; extra == 'all'
26
+ Requires-Dist: kokoro-onnx>=0.4; extra == 'all'
27
+ Requires-Dist: openai>=1.40; extra == 'all'
28
+ Requires-Dist: openwakeword>=0.6; extra == 'all'
29
+ Requires-Dist: piper-tts>=1.2; extra == 'all'
30
+ Requires-Dist: pyttsx3>=2.90; extra == 'all'
31
+ Provides-Extra: anthropic
32
+ Requires-Dist: anthropic>=0.70; extra == 'anthropic'
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=8; extra == 'dev'
35
+ Provides-Extra: elevenlabs
36
+ Requires-Dist: elevenlabs>=1.0; extra == 'elevenlabs'
37
+ Provides-Extra: local
38
+ Requires-Dist: faster-whisper>=1.0; extra == 'local'
39
+ Requires-Dist: kokoro-onnx>=0.4; extra == 'local'
40
+ Requires-Dist: pyttsx3>=2.90; extra == 'local'
41
+ Provides-Extra: openai
42
+ Requires-Dist: openai>=1.40; extra == 'openai'
43
+ Provides-Extra: openwakeword
44
+ Requires-Dist: openwakeword>=0.6; extra == 'openwakeword'
45
+ Provides-Extra: piper
46
+ Requires-Dist: piper-tts>=1.2; extra == 'piper'
47
+ Description-Content-Type: text/markdown
48
+
49
+ # HeyAgent
50
+
51
+ **A voice-first "Jarvis" for your terminal.** Say **"Hey Claude"**, **"Hey Codex"**, **"Hey Gemini"**, **"Hey OpenCode"** or **"Hey Cline"** and have a real back-and-forth spoken conversation with your coding agents. HeyAgent hears you, sends your words to the agent's own CLI session, and speaks the reply back in a natural voice. It runs quietly in the background and has an interactive terminal UI.
52
+
53
+ ![HeyAgent TUI](https://raw.githubusercontent.com/itsHarshDabas/heyagent/main/docs/tui-speaking.png)
54
+
55
+ ```
56
+ you ──"Hey Claude, why is the build failing?"──▶ wake word ─▶ speech-to-text ─▶ claude -p --resume <session>
57
+ you ◀──"One test fails on Windows paths. Want me to fix it?"── natural voice ◀── streamed reply
58
+ ```
59
+
60
+ - **Works with the agents you already pay for.** Claude Code, Codex CLI, Gemini CLI, OpenCode and Cline run on your existing subscription or login. HeyAgent adds no AI bill of its own.
61
+ - **Free and private by default.** Wake word, speech recognition and voices all run on your machine.
62
+ - **Natural voices, not robotic ones.** Uses [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M), an open model whose voices sound close to commercial ones, with a different voice per agent.
63
+ - **Synced sessions.** Each agent keeps one persistent session. Talk to Claude by voice, then run `claude --resume <id>` and continue the same conversation by typing (and the other way round).
64
+ - **Feels like a call.** Every agent gets an injected prompt so it answers in short, spoken sentences. Replies start playing after the first sentence, you can interrupt by talking, and you don't repeat the wake word mid-conversation.
65
+ - **Low power.** While idle, only a tiny loudness check runs on the microphone. Nothing heavy runs until someone speaks.
66
+ - **Windows first, works everywhere.** Pure Python on top of PortAudio, so it runs in any Windows, macOS or Linux terminal.
67
+
68
+ ## Quick start (Windows, macOS, Linux)
69
+
70
+ You need Python 3.10+ and at least one agent CLI installed and logged in (`claude`, `codex`, `gemini`, `opencode` or `cline`).
71
+
72
+ ```powershell
73
+ pip install "hey-agent[local]"
74
+ heyagent init # writes a starter config you can tweak
75
+ heyagent doctor # checks your mic, speakers, speech models and agent CLIs
76
+ heyagent # starts HeyAgent in the background and opens the TUI
77
+ ```
78
+
79
+ The package is `hey-agent` on PyPI; the command is `heyagent` (or `hey-agent`). Before the first PyPI release, install from GitHub instead: `pip install "hey-agent[local] @ git+https://github.com/itsHarshDabas/heyagent"`.
80
+
81
+ Then just say **"Hey Claude, what's in this folder?"**
82
+
83
+ The first run downloads the speech models once (Whisper `tiny.en` + `base.en`, about 220 MB, and Kokoro, about 350 MB) into your HeyAgent folder (`%APPDATA%\HeyAgent` on Windows, `~/.config/heyagent` on Linux, `~/Library/Application Support/HeyAgent` on macOS).
84
+
85
+ ## How a conversation works
86
+
87
+ 1. **Idle:** HeyAgent listens with a cheap loudness check. When someone speaks, a tiny local Whisper model checks whether it started with "Hey Claude / Codex / Gemini" (it also accepts common mishearings like "hey cloud").
88
+ 2. **Wake:** a soft chime plays. If you said more ("Hey Codex, run the tests"), that goes straight to the agent. If you only said the wake word, the agent answers "Yeah?".
89
+ 3. **Talking:** your speech is transcribed and sent to that agent's session. Its reply is spoken sentence by sentence as it streams in. If the agent takes a while, it says "One sec." so you know it heard you.
90
+ 4. **Tools and approvals:** the agent uses all its normal tools (editing files, running commands, MCP servers). You see each step live in the TUI ("Running npm test", "Editing auth.py"). Before Claude Code runs a command or changes a file, it asks out loud, for example "Claude wants to run npm install. Is that okay?" Say **"yes"**, **"no"** or **"yes, always"** (allows that tool for the rest of the call), or press Y / A / N on the card that pops up.
91
+ 5. **Interrupt:** start talking while it speaks and it stops to listen (barge-in, best with headphones), or press `Esc` in the TUI.
92
+ 6. **Switch:** say "Hey Gemini" mid-call to hand over to another agent.
93
+ 7. **Hang up:** say "bye" or "that's all", or just stay quiet for 12 seconds.
94
+
95
+ ## Commands
96
+
97
+ | Command | What it does |
98
+ |---|---|
99
+ | `heyagent` or `heyagent tui` | Open the TUI (starts the background daemon if needed) |
100
+ | `heyagent start` / `stop` / `status` | Control the background daemon |
101
+ | `heyagent run` | Run the daemon in this terminal, printing the conversation |
102
+ | `heyagent ask claude "summarize the README" --speak` | Text in, reply out (and spoken). Same session as voice |
103
+ | `heyagent voices --play` | Hear every voice. `heyagent voices --play bm_george af_heart` for a few |
104
+ | `heyagent say "hello" --voice bm_george` | Speak any text |
105
+ | `heyagent sessions` | Show each agent's session id; `sessions reset claude` starts fresh; `sessions set claude <id>` continues one you started in the terminal |
106
+ | `heyagent devices` | List microphones and speakers |
107
+ | `heyagent doctor` | Check everything is installed |
108
+
109
+ ### The TUI
110
+
111
+ A live voice visualizer shows what HeyAgent is doing (sleeping, listening, hearing you, thinking, speaking) in the color of the agent you're talking to, with captions of what's being said. Each agent has its own card with its wake phrase, voice, session and a pulsing LIVE badge while you're on a call with it. The conversation shows as chat bubbles.
112
+
113
+ | Thinking | Voice picker |
114
+ |---|---|
115
+ | ![thinking](https://raw.githubusercontent.com/itsHarshDabas/heyagent/main/docs/tui-thinking.png) | ![voices](https://raw.githubusercontent.com/itsHarshDabas/heyagent/main/docs/tui-voices.png) |
116
+
117
+ | Live tool activity | Voice approval |
118
+ |---|---|
119
+ | ![activity](https://raw.githubusercontent.com/itsHarshDabas/heyagent/main/docs/tui-activity.png) | ![approval](https://raw.githubusercontent.com/itsHarshDabas/heyagent/main/docs/tui-approval.png) |
120
+
121
+ ### TUI keys
122
+
123
+ | Key | Action |
124
+ |---|---|
125
+ | `Ctrl+T` | Talk to the selected agent without saying the wake word |
126
+ | `Ctrl+↑` / `Ctrl+↓` | Switch the selected agent (or click a card) |
127
+ | `Esc` | Interrupt the voice |
128
+ | `Ctrl+E` | End the call |
129
+ | `Ctrl+O` | Pick a voice for the selected agent (Enter previews, S saves) |
130
+ | `Ctrl+N` | Start a fresh session for the selected agent |
131
+ | `F2` | Mute the microphone |
132
+ | `Ctrl+X` | Stop the background daemon |
133
+ | `Ctrl+Q` | Close the TUI (HeyAgent keeps listening) |
134
+
135
+ You can also type in the box at the bottom; the reply is still spoken.
136
+
137
+ ## Voices
138
+
139
+ HeyAgent defaults to **Kokoro** (82M parameters, Apache 2.0). It runs about 4x faster than real time on a normal laptop CPU, fully offline, and is the most natural-sounding free voice model that is practical to run locally on Windows today. Each agent gets its own voice so you can tell them apart:
140
+
141
+ | Agent | Default voice | |
142
+ |---|---|---|
143
+ | Claude | `af_heart` | American woman, warm (Kokoro's best voice) |
144
+ | Codex | `am_michael` | American man, friendly |
145
+ | Gemini | `bf_emma` | British woman, polished |
146
+ | OpenCode | `am_fenrir` | American man, deep |
147
+ | Cline | `af_bella` | American woman, bright |
148
+
149
+ Other favourites: `af_bella`, `af_nicole`, `am_fenrir`, `am_puck`, `bf_isabella`, `bm_george` (very Jarvis), `bm_fable`, `bm_lewis`. Run `heyagent voices` for the list. Change a voice in the TUI with `Ctrl+O`, or in the config:
150
+
151
+ ```toml
152
+ [agents.claude]
153
+ voice = "bm_george"
154
+ ```
155
+
156
+ **Why Kokoro?** We compared the open options. Chatterbox, F5-TTS, XTTS and Orpheus can sound even more expressive and can clone voices, but they need a GPU (or are too slow on CPU) for real-time conversation, and XTTS's license forbids commercial use. Piper is very light but sounds noticeably more synthetic. Kokoro is the best balance of natural sound, speed on a CPU and a permissive license. If you want the most lifelike voices and don't mind paying, set `tts.backend = "elevenlabs"` or `"openai"`.
157
+
158
+ ## Local vs cloud speech: what's the difference?
159
+
160
+ HeyAgent has two jobs besides the agent itself: turning your voice into text (**speech-to-text**) and turning the reply into voice (**text-to-speech**). Each can run **locally** on your computer or in the **cloud**.
161
+
162
+ | | Local (default) | Cloud (opt-in) |
163
+ |---|---|---|
164
+ | Cost | Free | Pay per use (roughly a few cents per hour of talking for speech-to-text; voices cost more) |
165
+ | Privacy | Audio never leaves your computer | Your audio/text is sent to OpenAI or ElevenLabs |
166
+ | Internet | Works offline (except the agent itself) | Needs a connection |
167
+ | Setup | One-time model download (~570 MB) | API key in an environment variable |
168
+ | Your computer | Uses some CPU/RAM while you talk (Whisper `base.en` ~300 MB RAM) | Very light |
169
+ | Quality and speed | Very good on a modern laptop; slower on old machines | Best quality, fast even on weak machines |
170
+
171
+ **Recommendation:** stay local. Switch only if your machine struggles or you want a premium voice.
172
+
173
+ ```toml
174
+ [stt]
175
+ backend = "openai" # needs OPENAI_API_KEY; pip install "hey-agent[openai]"
176
+
177
+ [tts]
178
+ backend = "elevenlabs" # needs ELEVENLABS_API_KEY; pip install "hey-agent[elevenlabs]"
179
+ elevenlabs_voice_id = "..."
180
+ ```
181
+
182
+ Wake-word spotting always stays local, so idle listening never costs money.
183
+
184
+ ## Is this the same as the Claude / ChatGPT / Gemini apps' voice mode?
185
+
186
+ It's built to feel like it, but it works differently. The voice modes in the consumer apps have no public API, so nothing outside those apps can plug into them. HeyAgent instead puts its own ears and voice around the agent you already use in your terminal:
187
+
188
+ - **What you gain:** the agent is your *coding* agent, with your files, tools and session history, and it runs on your existing subscription for free.
189
+ - **What's different:** there's a small gap of about a second between you finishing and the reply starting, because the reply is written and then spoken. Native speech-to-speech models (OpenAI Realtime, Gemini Live) respond faster and more expressively, but they are billed per minute and they're separate chat models, not your Claude Code / Codex / Gemini CLI session. They may come later as an optional, off-by-default backend.
190
+
191
+ ## Configuration
192
+
193
+ `heyagent init` writes `config.toml` in your HeyAgent folder. Everything is optional. The important bits:
194
+
195
+ ```toml
196
+ [general]
197
+ default_agent = "claude"
198
+ conversation_timeout = 12.0 # seconds of quiet before the call ends
199
+ barge_in = true # talk over the agent to interrupt (best with headphones)
200
+ thinking_filler_after = 2.5 # say "One sec." if the agent is slow; 0 to disable
201
+
202
+ [audio]
203
+ input_device = "Microphone (USB)" # name or number from `heyagent devices`
204
+ vad_threshold = 0.010 # raise if background noise wakes it up
205
+ silence_ms = 700 # how long a pause ends your turn
206
+
207
+ [wake]
208
+ engine = "whisper" # "whisper" (default) | "openwakeword" | "none" (push-to-talk only)
209
+
210
+ [stt]
211
+ model = "base.en" # "small.en" = more accurate, "tiny.en" = lighter
212
+
213
+ [tts]
214
+ backend = "kokoro" # "kokoro" | "piper" | "system" | "openai" | "elevenlabs"
215
+ speed = 1.05
216
+
217
+ [agents.claude]
218
+ type = "claude-code"
219
+ wake_words = ["claude", "cloud", "clod"]
220
+ workdir = "C:/Users/you/code/my-project" # where the agent works
221
+ voice = "af_heart"
222
+ extra_args = ["--permission-mode", "acceptEdits"] # let it edit files without asking
223
+
224
+ [agents.codex]
225
+ type = "codex"
226
+ workdir = "C:/Users/you/code/my-project"
227
+
228
+ [agents.gemini]
229
+ type = "gemini"
230
+ enabled = false # hide an agent you don't use
231
+
232
+ [agents.opencode]
233
+ type = "opencode"
234
+ wake_words = ["open code", "opencode"]
235
+ model = "anthropic/claude-sonnet-5-5" # optional, any OpenCode model id
236
+ extra_args = ["--auto"] # optional, auto-approve permissions
237
+
238
+ [agents.cline]
239
+ type = "cline"
240
+ wake_words = ["cline", "klein", "kline"]
241
+ ```
242
+
243
+ ### Adding more agents
244
+
245
+ Any number of agents can be configured, each with its own wake words, folder and voice. Types: `claude-code`, `codex`, `gemini`, `opencode`, `cline`, and `anthropic` (Claude through the API directly, pay per use, `pip install "hey-agent[anthropic]"`, defaults to `claude-opus-5-5`):
246
+
247
+ ```toml
248
+ [agents.jarvis]
249
+ type = "anthropic"
250
+ label = "Jarvis"
251
+ wake_words = ["jarvis"]
252
+ voice = "bm_george"
253
+ ```
254
+
255
+ ### Permissions and voice approvals
256
+
257
+ **Claude Code** asks you by voice before it runs commands, edits or writes files, fetches web pages or uses MCP tools (`approvals = "voice"`, the default). HeyAgent does this with a Claude Code `PreToolUse` hook that it passes with `--settings`, so your own settings and hooks still apply. Harmless commands like `git status` or `ls` don't ask. If the HeyAgent daemon isn't running, the hook stays out of the way. Turn it off with `approvals = "off"` under `[general]` or per agent, and change how long it waits for your answer with `approval_timeout` (seconds, default 90; no answer counts as "no").
258
+
259
+ The other CLIs (Codex, Gemini, OpenCode, Cline) don't offer a way for another program to answer their permission prompts in headless mode yet, so for them HeyAgent follows their own permission settings. By default Claude Code, Codex and Gemini only do what their own settings already allow (reading, mostly). To let an agent edit files or run commands by voice, pass its usual flags in `extra_args`, for example `["--permission-mode", "acceptEdits"]` for Claude Code, `["--full-auto"]` for Codex or `["--approval-mode", "auto_edit"]` for Gemini, or `["--auto"]` for OpenCode. Only do this in folders you're happy for it to change.
260
+
261
+ **Heads up about Cline:** when it runs headless, Cline auto-approves everything ("yolo" mode) by default. Point its `workdir` at a project you trust, or add `extra_args = ["--auto-approve", "false"]`.
262
+
263
+ ### Always-on wake word models (optional)
264
+
265
+ The default `whisper` wake engine needs no setup and costs nothing while the room is quiet. If you want the lowest possible wake latency, you can use [openWakeWord](https://github.com/dscripka/openWakeWord) instead. It runs continuously (a few percent of one core) and needs a model per phrase, which you can train for free with its Colab notebook:
266
+
267
+ ```toml
268
+ [wake]
269
+ engine = "openwakeword"
270
+ openwakeword_models = { claude = "C:/models/hey_claude.onnx", codex = "C:/models/hey_codex.onnx" }
271
+ ```
272
+
273
+ ## Running at startup (Windows)
274
+
275
+ Press `Win+R`, type `shell:startup`, and add a shortcut with target:
276
+
277
+ ```
278
+ pythonw -m heyagent start
279
+ ```
280
+
281
+ HeyAgent then starts silently at login. Open the TUI any time with `heyagent`.
282
+
283
+ ## How it's built
284
+
285
+ ```
286
+ src/heyagent/
287
+ engine.py the voice loop: idle -> listening -> thinking -> speaking, barge-in
288
+ agents/ one adapter per agent CLI: claude-code, codex, gemini, opencode, cline, anthropic
289
+ speech/vad.py the low-power loudness gate and turn detection
290
+ speech/wake.py "hey <agent>" matching (whisper) and openWakeWord
291
+ speech/stt.py faster-whisper (local) / OpenAI (cloud)
292
+ speech/tts.py Kokoro / Piper / system voice (local), OpenAI / ElevenLabs (cloud)
293
+ speech/audio.py mic capture, interruptible playback, sentence streaming
294
+ approve.py Claude Code hook that turns permission prompts into spoken yes/no questions
295
+ agents/activity.py turns tool calls into short lines like "Running npm test"
296
+ control.py localhost JSON-lines channel between daemon and TUI (token protected)
297
+ tui.py Textual interface
298
+ ```
299
+
300
+ Development:
301
+
302
+ ```bash
303
+ pip install -e ".[local,dev]"
304
+ pytest
305
+ ```
306
+
307
+ ## Roadmap
308
+
309
+ - Optional realtime speech-to-speech backends (OpenAI Realtime, Gemini Live), off by default
310
+ - Acoustic echo cancellation so barge-in works on laptop speakers without headphones
311
+ - Tray icon and global push-to-talk hotkey
312
+ - Pre-trained "hey claude / codex / gemini" openWakeWord models
313
+
314
+ ## License
315
+
316
+ MIT. Kokoro model: Apache 2.0. Whisper: MIT.