CLI reference — myai
Auto-generated from the
COMMANDStable inbin/myai.cjs— do not edit by hand.
The myai CLI (aliased ai-manage, npm package ai-management) is a thin dispatcher: each subcommand shells into the repo's scripts/*.sh playbooks, which remain the single source of truth. It has zero required runtime dependencies — myai --help and myai doctor work before any npm install.
| Command | Arguments | What it does | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
myai init | [path] | Greenfield by default: drop a ~30-line kernel CLAUDE.md + gitignored .myai-local (no AI/ folder) — framework resolves from the installed module. --managed forces the legacy AI/-scaffold (portable docker-compose + .env + guided wizard); --force replaces a non-kernel CLAUDE.md; --zero-prompt (or env MYAI_ZERO_PROMPT=1) guarantees a scripted/headless run never blocks on stdin, regardless of TTY state | ||||||||||||||
myai up | [args...] | Start the self-contained stack (gateway + dashboard + mongo) on localhost, wait for health, print the dashboard URL | ||||||||||||||
myai down | [args...] | Stop the stack cleanly (--volumes also drops the mongo data volume) | ||||||||||||||
myai status | [args...] | Inspect the running stack: gateway/dashboard health, docker compose ps, task-queue counts (--json for scripts; exit 0 = healthy) | ||||||||||||||
myai boot | [args...] | TOKEN-FREE session boot — the deterministic spine of agent mode -min with zero LLM cost: git sync (ff-only pull), brain delta since last boot (pure git), schedule banner, remote-control status. Run BEFORE opening Claude. --no-fetch \ | --no-pull \ | --quiet | ||||||||||||
myai logs | [service...] | Tail stack logs — wraps docker compose logs -f (optionally one service: gateway \ | dashboard \ | mongo; --no-follow, --tail N) | ||||||||||||
myai scan | [path] | Spider git repos under a dir → register each in the gateway directory + seed RAG awareness (--register also lists in managed_repos.txt; --dry-run previews) | ||||||||||||||
myai demo | [args...] | Seed the dashboard with realistic sample data — tasks, schedules, plan, repo cards, memory, budget rows (idempotent; --clean removes, --force re-seeds) | ||||||||||||||
myai new-app | [path] | Scaffold a new full-stack app from the powerhouse blueprint | ||||||||||||||
myai connect | [path] | Install the Connect Hub module into a project | ||||||||||||||
myai plug | [agent...] | Plug ANY agent into your brain — one front door over both tiers. myai plug lists every agent + its one-liner; myai plug <agent> routes (claude\ | cursor\ | windsurf\ | codex\ | gemini\ | opencode = MCP auto-boot; ollama\ | chatgpt\ | print = blank-agent wrap) and forwards extra flags; myai plug proof runs the live continuity round-trip with no agent installed | |||||||
myai connect-agent | [args...] | Cooperating (MCP) tier of myai plug — print/install MCP config (claude \ | cursor \ | windsurf \ | codex \ | all) pointing at the local gateway, then verify the context_boot round-trip (--install writes, --no-verify skips) | ||||||||||
myai shim | [args...] | Wrap-it tier of myai plug — fetch the operator context bundle and PREPEND it for a non-MCP agent: launch Ollama pre-loaded, or compose a paste-ready ChatGPT primer; a prompt is forwarded as a lazy-recall query (--model, --repo, --no-deep, --copy) | ||||||||||||||
myai schedule | [args...] | Queue an autonomous task for the CLI runner (pass --title, etc.) | ||||||||||||||
myai mcp | [args...] | Propagate the MCP server config through the installed module (not update_all): mcp repo [path] writes/refreshes a repo .mcp.json from the bundled template (deep-merge — framework servers canonical, custom preserved); `mcp sync [museum\ | tech\ | personal\ | all] refreshes the per-org Claude config dirs from the template; mcp print` shows the base config. --dry-run supported | |||||||||||
myai mirror | [args...] | Keep a LOCAL copy of the gateway memory + registry so localhost is not single-point-of-failure on Atlas. Streams mongodump→mongorestore (Atlas → local by default) in a throwaway mongo:7 container — no host mongo tools. --dry-run previews; --collections a,b scopes; --reverse (local → Atlas) is guarded behind --yes | ||||||||||||||
myai rotate-keys | `<local | tenant> [args...]` | Self-rotate a gateway credential with a dual-valid grace window (zero-downtime): rotate-keys local [--grace-minutes N] rewrites GATEWAY_LOCAL_TOKEN in .env, keeping the old value valid for the grace window; `rotate-keys tenant <tenantId> [--grace-minutes N] [--env live\ | test]` mints a new tenant bootstrap API key via the gateway (local-trust only), old key stays valid server-side until grace elapses — new key is shown ONCE | ||||||||||||
myai runner | [args...] | Manage the local off-hours CLI runner schedule (launchd/systemd) — install [--every-minutes N\ | --every-hours N] \ | uninstall \ | start \ | stop \ | status (+ next-fire) \ | logs [-f] [-n N]. Distinct from myai status/myai logs (gateway health) — this controls the local worker | ||||||||
myai brain | [args...] | Git-versioned agent memory — init \ | status \ | write \ | stash \ | pop \ | branch \ | checkout \ | merge \ | log \ | diff \ | blame \ | revert \ | gc \ | session \ | distill (sessions = commits, wrap up = merge; walkthrough: TRY_BRAIN.md) |
myai memory | [args...] | Portable memory bundle — export [dir] pulls the corpus (state/handoff/patterns source texts) as JSON manifest + markdown; import <dir> re-embeds on this gateway with dedup-by-hash | ||||||||||||||
myai context | [args...] | FULL portable context bundle — export [dir] tars memory corpus + vectors (embeddings) + brain atoms + config into ONE versioned, checksummed, secret-redacted .tar.gz; import <archive> verifies integrity and re-imports (memory always, brain/config opt-in); import-external <source> ingests FROM ChatGPT/Claude export, Obsidian, markdown, or a raw vector store (re-embed + dedup, tenant-scoped). Own + download your whole context. | ||||||||||||||
myai recall | <query...> | TOKEN-FREE semantic recall over the repo-local SQLite index (code symbols + brain atoms) via sparse BM25 + local embeddings — NO LLM, NO network, NO tokens. Builds the index on first use. --k N \ | --json \ | --rebuild | ||||||||||||
myai backup | [args...] | Snapshot the git-versioned brain repo + ~/.myai config files into one dated .tar.gz archive (--out <file> or [dir] to place it; round-trips with myai restore) | ||||||||||||||
myai restore | [args...] | Restore a myai backup archive — brain repo → this machine's resolved dir (or --to <dir>) + config → ~/.myai; refuses to clobber without --force (existing state → .bak; --dry-run previews) | ||||||||||||||
myai upgrade | [args...] | Self-update the global CLI (npm update -g) then run pending config + brain schema migrations idempotently (--check reports without applying, exit 20 if pending; --dry-run previews; --no-self-update skips the npm step; --json for scripts) | ||||||||||||||
myai doctor | [args...] | Run preflight checks: docker (+engine), node, claude CLI, ANTHROPIC_API_KEY, cloud reachability, ollama availability, brain freshness, ports free. --dry-run previews the safe auto-fixes; --fix applies them idempotently (backfill non-secret .env keys from .env.example, redeploy statusline, correct runner cadence, pull latest gateway image) — never touches secrets or restarts the shared stack (--json for CI/scripts; exit 0 = passed) | ||||||||||||||
myai root | [args...] | Print the installed ai-management module path — the framework-as-module resolver a kernel-only repo (no per-repo AI/ copy) uses to find agents/skills/hooks/rule bodies. Fails loud (exit 1) if the resolved dir is not a valid install, so safety hooks never silently go missing (--json for scripts) |
Details
myai init [path]
Greenfield by default: drop a ~30-line kernel CLAUDE.md + gitignored .myai-local (no AI/ folder) — framework resolves from the installed module. --managed forces the legacy AI/-scaffold (portable docker-compose + .env + guided wizard); --force replaces a non-kernel CLAUDE.md; --zero-prompt (or env MYAI_ZERO_PROMPT=1) guarantees a scripted/headless run never blocks on stdin, regardless of TTY state
Dispatches to scripts/myai_init.sh.
myai up [args...]
Start the self-contained stack (gateway + dashboard + mongo) on localhost, wait for health, print the dashboard URL
Dispatches to scripts/myai_up.sh.
myai down [args...]
Stop the stack cleanly (--volumes also drops the mongo data volume)
Dispatches to scripts/myai_down.sh.
myai status [args...]
Inspect the running stack: gateway/dashboard health, docker compose ps, task-queue counts (--json for scripts; exit 0 = healthy)
Dispatches to scripts/myai_status.sh.
myai boot [args...]
TOKEN-FREE session boot — the deterministic spine of agent mode -min with zero LLM cost: git sync (ff-only pull), brain delta since last boot (pure git), schedule banner, remote-control status. Run BEFORE opening Claude. --no-fetch | --no-pull | --quiet
Dispatches to scripts/myai_boot.sh.
myai logs [service...]
Tail stack logs — wraps docker compose logs -f (optionally one service: gateway | dashboard | mongo; --no-follow, --tail N)
Dispatches to scripts/myai_logs.sh.
myai scan [path]
Spider git repos under a dir → register each in the gateway directory + seed RAG awareness (--register also lists in managed_repos.txt; --dry-run previews)
Dispatches to scripts/myai_scan.sh.
myai demo [args...]
Seed the dashboard with realistic sample data — tasks, schedules, plan, repo cards, memory, budget rows (idempotent; --clean removes, --force re-seeds)
Dispatches to scripts/myai_demo.sh.
myai new-app [path]
Scaffold a new full-stack app from the powerhouse blueprint
Dispatches to scripts/init_blueprint.sh.
myai connect [path]
Install the Connect Hub module into a project
Dispatches to scripts/init_connect.sh.
myai plug [agent...]
Plug ANY agent into your brain — one front door over both tiers. myai plug lists every agent + its one-liner; myai plug <agent> routes (claude|cursor|windsurf|codex|gemini|opencode = MCP auto-boot; ollama|chatgpt|print = blank-agent wrap) and forwards extra flags; myai plug proof runs the live continuity round-trip with no agent installed
Dispatches to scripts/myai_plug.sh.
myai connect-agent [args...]
Cooperating (MCP) tier of myai plug — print/install MCP config (claude | cursor | windsurf | codex | all) pointing at the local gateway, then verify the context_boot round-trip (--install writes, --no-verify skips)
Dispatches to scripts/myai_connect_agent.sh.
myai shim [args...]
Wrap-it tier of myai plug — fetch the operator context bundle and PREPEND it for a non-MCP agent: launch Ollama pre-loaded, or compose a paste-ready ChatGPT primer; a prompt is forwarded as a lazy-recall query (--model, --repo, --no-deep, --copy)
Dispatches to scripts/betac_shim.sh.
myai schedule [args...]
Queue an autonomous task for the CLI runner (pass --title, etc.)
Dispatches to scripts/schedule_task.sh.
myai mcp [args...]
Propagate the MCP server config through the installed module (not update_all): mcp repo [path] writes/refreshes a repo .mcp.json from the bundled template (deep-merge — framework servers canonical, custom preserved); mcp sync [museum|tech|personal|all] refreshes the per-org Claude config dirs from the template; mcp print shows the base config. --dry-run supported
Dispatches to scripts/myai_mcp.sh.
myai mirror [args...]
Keep a LOCAL copy of the gateway memory + registry so localhost is not single-point-of-failure on Atlas. Streams mongodump→mongorestore (Atlas → local by default) in a throwaway mongo:7 container — no host mongo tools. --dry-run previews; --collections a,b scopes; --reverse (local → Atlas) is guarded behind --yes
Dispatches to scripts/mongo_mirror.sh.
myai rotate-keys <local|tenant> [args...]
Self-rotate a gateway credential with a dual-valid grace window (zero-downtime): rotate-keys local [--grace-minutes N] rewrites GATEWAY_LOCAL_TOKEN in .env, keeping the old value valid for the grace window; rotate-keys tenant <tenantId> [--grace-minutes N] [--env live|test] mints a new tenant bootstrap API key via the gateway (local-trust only), old key stays valid server-side until grace elapses — new key is shown ONCE
Dispatches to scripts/myai_rotate_keys.sh.
myai runner [args...]
Manage the local off-hours CLI runner schedule (launchd/systemd) — install [--every-minutes N|--every-hours N] | uninstall | start | stop | status (+ next-fire) | logs [-f] [-n N]. Distinct from myai status/myai logs (gateway health) — this controls the local worker
Dispatches to scripts/myai_runner.sh.
myai brain [args...]
Git-versioned agent memory — init | status | write | stash | pop | branch | checkout | merge | log | diff | blame | revert | gc | session | distill (sessions = commits, wrap up = merge; walkthrough: TRY_BRAIN.md)
Dispatches to scripts/myai_brain.sh.
myai memory [args...]
Portable memory bundle — export [dir] pulls the corpus (state/handoff/patterns source texts) as JSON manifest + markdown; import <dir> re-embeds on this gateway with dedup-by-hash
Dispatches to scripts/myai_memory.sh.
myai context [args...]
FULL portable context bundle — export [dir] tars memory corpus + vectors (embeddings) + brain atoms + config into ONE versioned, checksummed, secret-redacted .tar.gz; import <archive> verifies integrity and re-imports (memory always, brain/config opt-in); import-external <source> ingests FROM ChatGPT/Claude export, Obsidian, markdown, or a raw vector store (re-embed + dedup, tenant-scoped). Own + download your whole context.
Dispatches to scripts/myai_context.sh.
myai recall <query...>
TOKEN-FREE semantic recall over the repo-local SQLite index (code symbols + brain atoms) via sparse BM25 + local embeddings — NO LLM, NO network, NO tokens. Builds the index on first use. --k N | --json | --rebuild
Dispatches to scripts/myai_recall.sh.
myai backup [args...]
Snapshot the git-versioned brain repo + ~/.myai config files into one dated .tar.gz archive (--out <file> or [dir] to place it; round-trips with myai restore)
Dispatches to scripts/myai_backup.sh.
myai restore [args...]
Restore a myai backup archive — brain repo → this machine's resolved dir (or --to <dir>) + config → ~/.myai; refuses to clobber without --force (existing state → .bak; --dry-run previews)
Dispatches to scripts/myai_restore.sh.
myai upgrade [args...]
Self-update the global CLI (npm update -g) then run pending config + brain schema migrations idempotently (--check reports without applying, exit 20 if pending; --dry-run previews; --no-self-update skips the npm step; --json for scripts)
Dispatches to scripts/myai_upgrade.sh.
myai doctor [args...]
Run preflight checks: docker (+engine), node, claude CLI, ANTHROPIC_API_KEY, cloud reachability, ollama availability, brain freshness, ports free. --dry-run previews the safe auto-fixes; --fix applies them idempotently (backfill non-secret .env keys from .env.example, redeploy statusline, correct runner cadence, pull latest gateway image) — never touches secrets or restarts the shared stack (--json for CI/scripts; exit 0 = passed)
Runs in-process (no shell script).
myai root [args...]
Print the installed ai-management module path — the framework-as-module resolver a kernel-only repo (no per-repo AI/ copy) uses to find agents/skills/hooks/rule bodies. Fails loud (exit 1) if the resolved dir is not a valid install, so safety hooks never silently go missing (--json for scripts)
Runs in-process (no shell script).
Global options: -h, --help · -v, --version.