Skip to content

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.

feat(ultrawiki): drive the readable knowledge base from the terminal

Ruben Lütke650291868ee6
diff --git a/docs/jarvis-cli-reference.md b/docs/jarvis-cli-reference.md
index eabb4e2e91..d0656a6079 100644
--- a/docs/jarvis-cli-reference.md
+++ b/docs/jarvis-cli-reference.md
@@ -195,6 +195,16 @@ _Generated from the curated command tree by `scripts/ci/gen_cli_reference.py`
- `jarvis telephony outbound <to> --message --yes --dry-run` — Place a real outbound call (destructive: costs money; needs --yes).
- `jarvis telephony status` — Report telephony availability/status.
+## ultrawiki
+
+- `jarvis ultrawiki export --yes --dry-run` — Write the knowledge base to the Obsidian vault as Markdown.
+- `jarvis ultrawiki graph --min-mentions` — The entity graph: which topics come up together, and how often.
+- `jarvis ultrawiki moments --topic --month --limit` — Browse the distilled moments, newest first.
+- `jarvis ultrawiki register --yes --dry-run` — Add the vault to the Obsidian app's own index.
+- `jarvis ultrawiki topic <key> --limit` — Everything known about one topic, with the moments it appears in.
+- `jarvis ultrawiki topics --search --limit` — List what the knowledge base has a name for, most mentioned first.
+- `jarvis ultrawiki vault` — Where the Obsidian vault is, what is in it, and whether Obsidian knows it.
+
## version
- `jarvis version` — Print the jarvisctl version.
diff --git a/jarvis/cli_ctl/__main__.py b/jarvis/cli_ctl/__main__.py
index 77c77d7f70..84f70907b3 100644
--- a/jarvis/cli_ctl/__main__.py
+++ b/jarvis/cli_ctl/__main__.py
@@ -39,6 +39,7 @@ from jarvis.cli_ctl.commands import sessions as sessions_cmd
from jarvis.cli_ctl.commands import skills as skills_cmd
from jarvis.cli_ctl.commands import socials as socials_cmd
from jarvis.cli_ctl.commands import system as system_cmd
+from jarvis.cli_ctl.commands import ultrawiki as ultrawiki_cmd
from jarvis.cli_ctl.commands import tasks as tasks_cmd
from jarvis.cli_ctl.commands import telephony as telephony_cmd
from jarvis.cli_ctl.commands import wiki as wiki_cmd
@@ -106,6 +107,7 @@ def refresh() -> None:
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(ultrawiki_cmd.app, name="ultrawiki")
app.add_typer(brain_cmd.app, name="brain")
app.add_typer(commands_cmd.app, name="commands")
app.add_typer(computer_use_cmd.app, name="computer-use")
diff --git a/jarvis/cli_ctl/commands/ultrawiki.py b/jarvis/cli_ctl/commands/ultrawiki.py
new file mode 100644
index 0000000000..4b79af187b
--- /dev/null
+++ b/jarvis/cli_ctl/commands/ultrawiki.py
@@ -0,0 +1,113 @@
+"""ultrawiki: browse the readable knowledge base and write the Obsidian vault.
+
+The Explore view answers "what does it actually know about my life?" — this is
+the same thing without a browser, which is what an agent, a script, or a
+headless server needs. `topics` and `moments` are the two readable layers of
+the projection; `export` writes them to disk as Markdown.
+"""
+
+from __future__ import annotations
+
+import typer
+
+from jarvis.cli_ctl import invoke, options
+
+app = typer.Typer(
+ no_args_is_help=True,
+ help="Readable knowledge base: topics, moments, the entity graph, and the Obsidian vault.",
+)
+
+
+def topics(
+ search: str = typer.Option("", "--search", "-s", help="Filter topic labels."),
+ limit: int = typer.Option(50, "--limit", "-n", help="How many to return."),
+) -> None:
+ """List what the knowledge base has a name for, most mentioned first."""
+ params: dict[str, object] = {"limit": limit}
+ if search:
+ params["q"] = search
+ invoke.run("GET", "/api/ultrawiki/explore/entities", params=params)
+
+
+def topic(
+ key: str = typer.Argument(..., help="Topic key, e.g. 'bora bora' (case-insensitive)."),
+ limit: int = typer.Option(20, "--limit", "-n", help="How many moments to include."),
+) -> None:
+ """Everything known about one topic, with the moments it appears in."""
+ invoke.run(
+ "GET", f"/api/ultrawiki/explore/entities/{key}", params={"limit": limit}
+ )
+
+
+def moments(
+ topic: str = typer.Option("", "--topic", "-t", help="Restrict to one topic key."),
+ month: str = typer.Option("", "--month", "-m", help="Restrict to a YYYY-MM bucket."),
+ limit: int = typer.Option(20, "--limit", "-n", help="How many to return."),
+) -> None:
+ """Browse the distilled moments, newest first."""
+ params: dict[str, object] = {"limit": limit}
+ if topic:
+ params["entity"] = topic
+ if month:
+ params["month"] = month
+ invoke.run("GET", "/api/ultrawiki/explore/moments", params=params)
+
+
+def graph(
+ min_mentions: int = typer.Option(
+ 2, "--min-mentions", help="Hide topics mentioned fewer times than this."
+ ),
+) -> None:
+ """The entity graph: which topics come up together, and how often."""
+ invoke.run(
+ "GET", "/api/ultrawiki/explore/graph", params={"min_mentions": min_mentions}
+ )
+
+
+def vault() -> None:
+ """Where the Obsidian vault is, what is in it, and whether Obsidian knows it."""
+ invoke.run("GET", "/api/ultrawiki/vault/status")
+
+
+def export(
+ yes: bool = options.yes_opt(),
+ dry_run: bool = options.dry_opt(),
+) -> None:
+ """Write the knowledge base to the Obsidian vault as Markdown.
+
+ Rewrites the generated folders and removes its own stale notes, so it is
+ gated like any other destructive command. Notes under "My notes/" are
+ never touched.
+ """
+ invoke.run(
+ "POST",
+ "/api/ultrawiki/vault/export",
+ assume_yes=yes,
+ dry_run=dry_run,
+ dangerous=True,
+ )
+
+
+def register(
+ yes: bool = options.yes_opt(),
+ dry_run: bool = options.dry_opt(),
+) -> None:
+ """Add the vault to the Obsidian app's own index.
+
+ Edits a file owned by another program, so it asks first. Requires the
+ vault to exist — run ``export`` before this.
+ """
+ invoke.run(
+ "POST",
+ "/api/ultrawiki/vault/register",
+ assume_yes=yes,
+ dry_run=dry_run,
+ dangerous=True,
+ )
diff --git a/tests/unit/cli_ctl/test_commands_ultrawiki.py b/tests/unit/cli_ctl/test_commands_ultrawiki.py
new file mode 100644
index 0000000000..f75d847f0b
--- /dev/null
+++ b/tests/unit/cli_ctl/test_commands_ultrawiki.py
@@ -0,0 +1,81 @@
+"""Tests for the ultrawiki commands — the readable knowledge base from a terminal.
+
+The curated group exists so an agent or a terminal user can ask "what does it
+know about X" without a browser, and so the vault export is scriptable. The
+export is the one destructive command here (it deletes its own stale notes),
+so it must be gated rather than fire on sight.
+"""
+
+from __future__ import annotations
+
+from typer.testing import CliRunner
+
+from jarvis.cli_ctl.__main__ import app
+
+runner = CliRunner()
+
+
+def test_topics_lists_the_entity_pages(capture_api):
+ runner.invoke(app, ["ultrawiki", "topics"])
+ call = capture_api["calls"][-1]
+ assert call["path"] == "/api/ultrawiki/explore/entities"
+ assert call["method"] == "GET"
+
+
+def test_topics_passes_the_search_filter(capture_api):
+ runner.invoke(app, ["ultrawiki", "topics", "--search", "bora"])
+ assert capture_api["calls"][-1]["query"]["q"] == "bora"
+
+
+def test_topic_reads_one_entity_page(capture_api):
+ runner.invoke(app, ["ultrawiki", "topic", "bora bora"])
+ assert capture_api["calls"][-1]["path"] == "/api/ultrawiki/explore/entities/bora bora"
+
+
+def test_moments_can_be_scoped_to_a_topic(capture_api):
+ runner.invoke(app, ["ultrawiki", "moments", "--topic", "tahiti"])
+ call = capture_api["calls"][-1]
+ assert call["path"] == "/api/ultrawiki/explore/moments"
+ assert call["query"]["entity"] == "tahiti"
+
+
+def test_moments_can_be_scoped_to_a_month(capture_api):
+ runner.invoke(app, ["ultrawiki", "moments", "--month", "2026-07"])
+ assert capture_api["calls"][-1]["query"]["month"] == "2026-07"
+
+
+def test_graph_passes_the_mention_floor(capture_api):
+ runner.invoke(app, ["ultrawiki", "graph", "--min-mentions", "5"])
+ call = capture_api["calls"][-1]
+ assert call["path"] == "/api/ultrawiki/explore/graph"
+ # Query values arrive as strings — this is an HTTP query string, not JSON.
+ assert str(call["query"]["min_mentions"]) == "5"
+
+
+def test_vault_reports_the_status(capture_api):
+ runner.invoke(app, ["ultrawiki", "vault"])
+ assert capture_api["calls"][-1]["path"] == "/api/ultrawiki/vault/status"
+
+
+def test_export_is_a_guarded_write(capture_api):
+ result = runner.invoke(app, ["ultrawiki", "export", "--yes"])
+ assert result.exit_code == 0
+ call = capture_api["calls"][-1]
+ assert call["method"] == "POST"
+ assert call["path"] == "/api/ultrawiki/vault/export"
+
+
+def test_export_without_yes_does_not_fire(capture_api):
+ before = len(capture_api["calls"])
+ runner.invoke(app, ["ultrawiki", "export"], input="n\n")
+ # It rewrites a directory and deletes its own stale notes — a bare
+ # invocation must ask first, exactly like every other destructive command.
+ assert len(capture_api["calls"]) == before
+
+
+def test_register_is_a_guarded_write(capture_api):
+ result = runner.invoke(app, ["ultrawiki", "register", "--yes"])
+ assert result.exit_code == 0
+ call = capture_api["calls"][-1]
+ assert call["method"] == "POST"
+ assert call["path"] == "/api/ultrawiki/vault/register"