--- name: talk description: "Use when the user has asked for voice notifications, either explicitly in this session or as a standing order in the project's AGENTS.md, and (1) a long-running task finishes (build, tests, deploy, data job), (2) the agent is blocked and needs the user's decision or approval, or (3) something failed that the user should know about now. Triggers: talk, say it, sag Bescheid, melde dich, notify me, let me know when done, voice, Ansage. Strict opt-in: never speak without the user's trigger or standing order." compatibility: opencode, claude-code, codex --- # talk: voice notifications for agents `talk "Build done"` speaks a short announcement through the local talk daemon (queue, rate limit, mute, quiet hours). One binary; it starts the daemon itself on the first call. Nothing to install except `talk` in the PATH. ## When to Use: strict opt-in Speak **only** if one of these holds: 1. The user asked for it in this session ("let me know when the build is through", "tell me when you need me"). That then applies **session-sticky until revoked**; do not ask again with every reply. 2. The project's AGENTS.md contains a standing order (see `AGENTS-snippet.md`). Then speak on: completion of long tasks (> ~30 s), blockers that need the user (decision, approval, password), failures that matter right now. ## When NOT to Use - Without a trigger or standing order. Never chatter on your own. - For short replies, intermediate status, or any tool output. - To read the long answer aloud. The daemon truncates at 400 characters, but the goal is 1 to 2 sentences. - When `talk` returns `muted` or `discarded: quiet_hours`: that is the user's decision. Do not work around it, do not follow up with `--now`. ## What makes a good announcement **Status, next step, what the user is needed for.** Never the answer itself. | good | bad | | --- | --- | | "Tests green, PR is ready for review." | "I ran the tests and all 247 tests passed successfully, and I also ..." | | "Deploy failed, code 1. I need your decision on the migration." | "Error." | | "I need your sudo password in the terminal." | (waiting silently) | Language: write in the user's language. talk speaks English by default and German when the configured language is `de` or when detection says so (`--lang` forces it). ## Usage ```bash talk "Tests green, PR ready for review." # non-blocking, item ID on stdout talk --wait "Deploy finished." # return only once spoken talk --priority high "Build red, code 2." # may break the rate limit talk --now "I need you: approval in the terminal." # jumps the queue, also in quiet hours; blockers only echo "Import finished" | talk # stdin works too talk wrap -- make test # run a command, announce success/failure and duration ``` Replies on stdout: an item ID (accepted), `muted`, or `discarded: rate_limit|quiet_hours`. Exit 0 in all three cases; a discard is not an error. Non-zero exit only on real problems (no text, invalid flags, broken config); then do not retry, tell the user instead. ## Etiquette towards the daemon - **Rate limit** (default 1 announcement / 30 s): `normal` waits, `low` is discarded, `high` may pass. Not everything is `high`. - **`--now`** is for blockers that need the user, not for "done". It breaks out of quiet hours and the rate limit; that is a deliberate interruption. - **Mute and quiet hours** are user decisions. Respect them, do not work around them. The daemon enforces them anyway. - Several things at once? **One** announcement that summarises, not five. ## Pitfalls - `talk` not found: do not improvise (no `say`, `espeak`, `notify-send`). Tell the user that talk is missing. - No sound on the user's side: suggest `talk doctor`; do not fiddle with keys or config yourself. - Keys come from `TALK_ELEVENLABS_KEY` / `TALK_OPENAI_KEY` (env). Never write them to files, never print them in announcements or logs.