Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
chore: auto-save WIP via Claude stop-hook safety net (2026-07-10 11:39)
Ruben Lütkeba8183f8e6b6
diff --git a/.githooks/pre-push b/.githooks/pre-pushindex 0b2a8a5feb..7d5af8d387 100755--- a/.githooks/pre-push+++ b/.githooks/pre-push@@ -132,6 +132,19 @@ if [ -f "$docgen_gate" ]; thenfifi+# --- 4b) COMMANDS DOCGEN drift gate (FAIL-CLOSED) -------------------------------+# docs/commands-reference.md is generated from the Command Registry; this fails+# the push if a registry command was added/changed without regenerating it.+# Run `python scripts/ci/gen_commands_reference.py` to fix a drift.+cmddocs_gate="scripts/ci/gen_commands_reference.py"+if [ -f "$cmddocs_gate" ]; then+ "$PY" "$cmddocs_gate" --check </dev/null+ if [ "$?" -ne 0 ]; then+ status=1+ cmddocs_hit=1+ fi+fi+# --- 5) DOCS PRIVACY gate (FAIL-CLOSED) ---------------------------------------# Personal data must never leave the machine inside a documentation file:# the maintainer's real name, private email/handle, personal Windows paths,@@ -242,6 +255,10 @@ if [ "$status" -ne 0 ]; thenecho "pre-push BLOCKED: CLI DOCGEN drift (jarvis-cli-reference.md out of date)."echo " Run: python scripts/ci/gen_cli_reference.py and commit the result."fi+ if [ "${cmddocs_hit:-0}" -ne 0 ]; then+ echo "pre-push BLOCKED: COMMANDS DOCGEN drift (commands-reference.md out of date)."+ echo " Run: python scripts/ci/gen_commands_reference.py and commit the result."+ fiif [ "${docs_privacy_hit:-0}" -ne 0 ]; thenecho "pre-push BLOCKED: DOCS PRIVACY gate (personal data in docs/)."echo " See the findings above. Fix with:"diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex d8320ff88d..8aa3c5bd36 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -219,6 +219,11 @@ jobs:# docs/jarvis-cli-reference.md. Mirrors the pre-push docgen gate.run: python scripts/ci/gen_cli_reference.py --check+ - name: Commands reference drift gate (docs in sync with the registry)+ # Fails if a Command-Registry entry was added/changed without+ # regenerating docs/commands-reference.md. Mirrors the pre-push gate.+ run: python scripts/ci/gen_commands_reference.py --check+- name: Install base runtime deps for the test suite (robust; no hand-list)shell: bash# The cli_ctl unit tests import deeper jarvis modules that transitivelydiff --git a/docs/commands-reference.md b/docs/commands-reference.mdnew file mode 100644index 0000000000..4a602440a7--- /dev/null+++ b/docs/commands-reference.md@@ -0,0 +1,203 @@+# App Commands — Reference++_Generated from the Command Registry by `scripts/ci/gen_commands_reference.py` — do not edit by hand._++Every command below is available on four surfaces backed by the SAME endpoint and validation chain:++- **Voice/chat** — Jarvis's `app-command` tool (say it naturally).+- **Desktop UI** — the sidebar section named per command.+- **CLI** — `jarvis commands list` / `jarvis commands show <id>` to browse; execute via the curated command or `jarvis api <tag> <op>`.+- **REST** — the endpoint listed per command (machine-readable catalog: `GET /api/commands`).++Commands marked **requires confirmation** never run on a bare voice request — Jarvis asks first (two-turn confirm); the CLI needs `--yes`.++## `brain-switch` — Switch brain provider++Switch the ACTIVE main brain (LLM) provider, e.g. from openai to claude-api. Reversible; validated against the provider catalog and stored credentials.++- **Endpoint:** `POST /api/brain/switch`+- **Arguments:** `provider` (one of: claude-api, gemini, nvidia, openai, openrouter; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "switch the brain provider to claude"++## `tts-switch` — Switch voice (TTS) provider++Switch the active text-to-speech provider (live, no restart).++- **Endpoint:** `POST /api/tts/switch`+- **Arguments:** `provider` (one of: cartesia, elevenlabs, gemini-flash-tts, grok-voice, inworld, openrouter-tts; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "switch the voice to elevenlabs"++## `stt-switch` — Switch speech-recognition (STT) provider++Switch the speech-to-text provider. Takes effect on the next voice-pipeline start (restart required).++- **Endpoint:** `POST /api/stt/switch`+- **Arguments:** `provider` (one of: groq-api, openai-api, openrouter-stt; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "switch speech recognition to deepgram"++## `realtime-switch` — Switch realtime voice provider++Switch which realtime voice engine (speech-to-speech) is active, e.g. openai-realtime or gemini-live.++- **Endpoint:** `POST /api/realtime/switch`+- **Arguments:** `provider` (one of: gemini-live, openai-realtime; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "switch the realtime model to gemini"++## `computer-use-switch` — Switch Computer-Use provider++Switch the dedicated Computer-Use planner provider (screen control), decoupled from the main brain.++- **Endpoint:** `POST /api/computer-use/switch`+- **Arguments:** `provider` (one of: antigravity, claude-api, codex, gemini, nvidia, openai, openrouter; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "switch the computer use provider to gemini"++## `jarvis-agent-switch` — Switch Jarvis-Agent (worker) provider++Switch the Jarvis-Agent / worker provider used for missions (e.g. codex to openai). Restart required.++- **Endpoint:** `POST /api/jarvis-agent/switch`+- **Arguments:** `provider` (one of: antigravity, claude-api, codex, gemini, nvidia, openai, openrouter; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `agents`+- **Voice example (EN):** "switch the agent provider to openai"++## `providers-list` — List providers++List all configured providers and which ones are active.++- **Endpoint:** `GET /api/providers`+- **Arguments:** none+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "which providers are configured"++## `provider-test` — Test a provider++Test connectivity and authentication for one provider.++- **Endpoint:** `POST /api/providers/{provider_id}/test`+- **Arguments:** `provider_id` (one of: antigravity, cartesia, claude-api, codex, elevenlabs, gemini, gemini-flash-tts, gemini-live, grok-voice, groq-api, inworld, nvidia, openai, openai-api, openai-realtime, openrouter, openrouter-stt, openrouter-tts; required)+- **Requires confirmation:** no+- **Desktop UI section:** `apikeys`+- **Voice example (EN):** "test the openai provider"++## `reply-language-set` — Set reply language++Pin the language Jarvis answers in (auto follows the spoken language).++- **Endpoint:** `PUT /api/settings/reply-language`+- **Arguments:** `language` (one of: auto, de, en, es; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `languages`+- **Voice example (EN):** "answer in german from now on"++## `voice-mode-set` — Set voice mode (pipeline / realtime)++Choose the voice engine: the classic STT-brain-TTS pipeline or a realtime speech-to-speech model.++- **Endpoint:** `PUT /api/settings/voice-mode`+- **Arguments:** `mode` (one of: pipeline, realtime; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `settings`+- **Voice example (EN):** "switch to realtime mode"++## `wake-word-get` — Show wake word++Show the current wake word and wake-engine settings.++- **Endpoint:** `GET /api/settings/wake-word`+- **Arguments:** none+- **Requires confirmation:** no+- **Desktop UI section:** `settings`+- **Voice example (EN):** "what is my wake word"++## `wake-word-set` — Change wake word++Set the phrase that wakes Jarvis up.++- **Endpoint:** `PUT /api/settings/wake-word`+- **Arguments:** `phrase` (string; required)+- **Requires confirmation:** no+- **Desktop UI section:** `settings`+- **Voice example (EN):** "change my wake word to nova"++## `tts-volume-set` — Set voice volume++Set the text-to-speech output volume (0.0 to 1.0).++- **Endpoint:** `PUT /api/settings/tts-volume`+- **Arguments:** `volume` (number; required); `persist` (boolean; optional)+- **Requires confirmation:** no+- **Desktop UI section:** `settings`+- **Voice example (EN):** "set the voice volume to 50 percent"++## `audio-devices-list` — List audio devices++List available speaker and microphone devices.++- **Endpoint:** `GET /api/settings/audio-devices`+- **Arguments:** none+- **Requires confirmation:** no+- **Desktop UI section:** `settings`+- **Voice example (EN):** "list my audio devices"++## `app-restart` — Restart Jarvis++Restart the Jarvis desktop app (voice + UI restart too).++- **Endpoint:** `POST /api/settings/restart-app`+- **Arguments:** none+- **Requires confirmation:** yes+- **Desktop UI section:** `settings`+- **Voice example (EN):** "restart jarvis"++## `missions-list` — List missions++List Jarvis-Agent missions and their status.++- **Endpoint:** `GET /api/missions`+- **Arguments:** none+- **Requires confirmation:** no+- **Desktop UI section:** `agents`+- **Voice example (EN):** "show me the missions"++## `mission-cancel` — Cancel a mission++Cancel a running Jarvis-Agent mission by id.++- **Endpoint:** `POST /api/missions/{mission_id}/cancel`+- **Arguments:** `mission_id` (string; required)+- **Requires confirmation:** yes+- **Desktop UI section:** `agents`+- **Voice example (EN):** "cancel the mission"++## `tasks-list` — List tasks++List scheduled and running tasks.++- **Endpoint:** `GET /api/tasks`+- **Arguments:** none+- **Requires confirmation:** no+- **Desktop UI section:** `tasks`+- **Voice example (EN):** "show me my tasks"++## `task-cancel` — Cancel a task++Cancel a running or scheduled task by id.++- **Endpoint:** `POST /api/tasks/{task_id}/cancel`+- **Arguments:** `task_id` (string; required)+- **Requires confirmation:** yes+- **Desktop UI section:** `tasks`+- **Voice example (EN):** "cancel the task"+diff --git a/docs/jarvis-cli-reference.md b/docs/jarvis-cli-reference.mdindex 7afcf49ea8..5856d79e53 100644--- a/docs/jarvis-cli-reference.md+++ b/docs/jarvis-cli-reference.md@@ -38,6 +38,11 @@ _Generated from the curated command tree by `scripts/ci/gen_cli_reference.py`- `jarvis clis usage <name>` — Show a CLI's recent usage history.- `jarvis clis usage-stats <name>` — Show a CLI's aggregated usage stats (success rate, avg duration, top commands).+## commands++- `jarvis commands list` — List every registry command (id, endpoint, params, danger, UI section).+- `jarvis commands show <command_id>` — Show one command's full definition (params schema, voice aliases).+## conductor- `jarvis conductor add --def --yes --dry-run` — Add a job from a Job JSON document.diff --git a/jarvis/cli_ctl/__main__.py b/jarvis/cli_ctl/__main__.pyindex ad7b918ed5..84ac89438f 100644--- a/jarvis/cli_ctl/__main__.py+++ b/jarvis/cli_ctl/__main__.py@@ -22,6 +22,7 @@ from jarvis.cli_ctl.commands import auth as auth_cmdfrom jarvis.cli_ctl.commands import board as board_cmdfrom jarvis.cli_ctl.commands import brain as brain_cmdfrom jarvis.cli_ctl.commands import clis as clis_cmd+from jarvis.cli_ctl.commands import commands as commands_cmdfrom jarvis.cli_ctl.commands import conductor as conductor_cmdfrom jarvis.cli_ctl.commands import config as config_cmdfrom jarvis.cli_ctl.commands import contacts as contacts_cmd@@ -104,6 +105,7 @@ app.add_typer(auth_cmd.app, name="auth")app.add_typer(system_cmd.app, name="system")app.add_typer(tasks_cmd.app, name="tasks")app.add_typer(brain_cmd.app, name="brain")+app.add_typer(commands_cmd.app, name="commands")app.add_typer(config_cmd.app, name="config")app.add_typer(missions_cmd.app, name="missions")app.add_typer(wiki_cmd.app, name="wiki")diff --git a/jarvis/cli_ctl/commands/commands.py b/jarvis/cli_ctl/commands/commands.pynew file mode 100644index 0000000000..5c9bf6851a--- /dev/null+++ b/jarvis/cli_ctl/commands/commands.py@@ -0,0 +1,34 @@+"""commands: browse the Command Registry (the app's curated command catalog).++The registry (``GET /api/commands``) is the one machine-readable catalog of+user-facing app commands — the same catalog the brain's ``app-command`` tool+and the desktop UI consume. Read-only here: executing a command goes through+its own endpoint (see each entry's method+path, or the equivalent curated+CLI command).+"""+from __future__ import annotations++import typer++from jarvis.cli_ctl import invoke++app = typer.Typer(+ no_args_is_help=True,+ help="Command Registry: list app commands, show one command's schema.",+)++[email protected]("list")+def list_commands() -> None:+ """List every registry command (id, endpoint, params, danger, UI section)."""+ invoke.run("GET", "/api/commands")+++def show(+ command_id: str = typer.Argument(+ ..., help="Registry command id, e.g. brain-switch."+ ),+) -> None:+ """Show one command's full definition (params schema, voice aliases)."""+ invoke.run("GET", f"/api/commands/{command_id}")diff --git a/jarvis/cli_ctl/reserved.py b/jarvis/cli_ctl/reserved.pyindex 7cdc462695..4acf30657c 100644--- a/jarvis/cli_ctl/reserved.py+++ b/jarvis/cli_ctl/reserved.py@@ -27,6 +27,7 @@ RESERVED_CONTROL_NAMES: frozenset[str] = frozenset("tasks","missions","brain",+ "commands","config","wiki","sessions",diff --git a/scripts/ci/gen_commands_reference.py b/scripts/ci/gen_commands_reference.pynew file mode 100644index 0000000000..26b43a6cea--- /dev/null+++ b/scripts/ci/gen_commands_reference.py@@ -0,0 +1,109 @@+"""Generate docs/commands-reference.md from the Command Registry.++Walks ``jarvis/commands/registry.py`` (the one machine-readable catalog of+user-facing app commands) and emits a markdown reference: what each command+does, its arguments, whether it requires confirmation, where it lives in the+desktop UI, an English voice example, and the backing REST endpoint. Personal+data cannot appear by construction — the registry contains only curated+product strings.++The reference documents the ENGLISH voice example only; the full multilingual+alias set (de/en/es) is machine-readable at ``GET /api/commands`` and in the+registry source.++Modes (mirrors ``gen_cli_reference.py``):+* (no flag) — regenerate ``docs/commands-reference.md`` in place.+* ``--check`` — build in memory and exit non-zero on drift (pre-push + CI).+"""+from __future__ import annotations++import sys+from pathlib import Path++_REPO = Path(__file__).resolve().parents[2]+sys.path.insert(0, str(_REPO))++from jarvis.commands.registry import get_registry # noqa: E402++_OUT = _REPO / "docs" / "commands-reference.md"+++def _args_line(params: dict) -> str:+ props = params.get("properties", {}) if params else {}+ if not props:+ return "none"+ required = set(params.get("required", []))+ parts = []+ for name, spec in props.items():+ desc = spec.get("type", "any")+ if spec.get("enum"):+ desc = "one of: " + ", ".join(str(v) for v in spec["enum"])+ marker = "required" if name in required else "optional"+ parts.append(f"`{name}` ({desc}; {marker})")+ return "; ".join(parts)+++def _build_reference() -> str:+ lines = [+ "# App Commands — Reference",+ "",+ "_Generated from the Command Registry by "+ "`scripts/ci/gen_commands_reference.py` — do not edit by hand._",+ "",+ "Every command below is available on four surfaces backed by the SAME "+ "endpoint and validation chain:",+ "",+ "- **Voice/chat** — Jarvis's `app-command` tool (say it naturally).",+ "- **Desktop UI** — the sidebar section named per command.",+ "- **CLI** — `jarvis commands list` / `jarvis commands show <id>` to "+ "browse; execute via the curated command or `jarvis api <tag> <op>`.",+ "- **REST** — the endpoint listed per command "+ "(machine-readable catalog: `GET /api/commands`).",+ "",+ "Commands marked **requires confirmation** never run on a bare voice "+ "request — Jarvis asks first (two-turn confirm); the CLI needs "+ "`--yes`.",+ "",+ ]+ for cmd in get_registry():+ lines.append(f"## `{cmd.id}` — {cmd.title}")+ lines.append("")+ lines.append(cmd.description)+ lines.append("")+ en_alias = (cmd.voice_aliases.get("en") or ("",))[0]+ rows = [+ ("Endpoint", f"`{cmd.method} {cmd.path}`"),+ ("Arguments", _args_line(cmd.params)),+ ("Requires confirmation", "yes" if cmd.dangerous else "no"),+ ("Desktop UI section", f"`{cmd.ui_section}`"),+ ]+ if en_alias:+ rows.append(("Voice example (EN)", f'"{en_alias}"'))+ for label, value in rows:+ lines.append(f"- **{label}:** {value}")+ lines.append("")+ return "\n".join(lines) + "\n"+++def main(argv: list[str] | None = None) -> int:+ args = sys.argv[1:] if argv is None else argv+ generated = _build_reference()+ rel = _OUT.relative_to(_REPO)+ if "--check" in args:+ current = _OUT.read_text(encoding="utf-8") if _OUT.exists() else ""+ if current != generated:+ print(+ f"DRIFT: {rel} is out of date with the Command Registry.\n"+ "Run `python scripts/ci/gen_commands_reference.py` and commit "+ "the result."+ )+ return 1+ print(f"check OK — {rel} is current.")+ return 0+ _OUT.write_text(generated, encoding="utf-8")+ print(f"wrote {_OUT}")+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/tests/unit/cli_ctl/test_commands_registry_group.py b/tests/unit/cli_ctl/test_commands_registry_group.pynew file mode 100644index 0000000000..85e2b09f37--- /dev/null+++ b/tests/unit/cli_ctl/test_commands_registry_group.py@@ -0,0 +1,25 @@+"""Tests for the curated `jarvis commands` group (Command Registry browser)."""+from __future__ import annotations++from typer.testing import CliRunner++from jarvis.cli_ctl.__main__ import app+from jarvis.cli_ctl.reserved import RESERVED_CONTROL_NAMES++runner = CliRunner()+++def test_list(capture_api):+ runner.invoke(app, ["commands", "list"])+ assert capture_api["calls"][-1]["path"] == "/api/commands"+ assert capture_api["calls"][-1]["method"] == "GET"+++def test_show(capture_api):+ runner.invoke(app, ["commands", "show", "brain-switch"])+ assert capture_api["calls"][-1]["path"] == "/api/commands/brain-switch"+++def test_commands_is_a_reserved_control_name():+ """`jarvis commands ...` must route to the control CLI, not the launcher."""+ assert "commands" in RESERVED_CONTROL_NAMES