CLI reference

Run subnet with no arguments for an interactive menu (update, add projects, health, dashboards, insights). Otherwise the surface is six essentials; per-stage and maintenance commands still work but are hidden from --help (listed under advanced).

Essentials: setup · update · doctor · global · watch · serve.

on this page

subnet

With no arguments in a TTY, Substrate Net opens a menu-driven flow built on @clack/prompts: update projects, add projects (setup), run health checks, open dashboards, inspect global insights, and check watch status. Non-TTY invocations print --help so scripts stay deterministic.

setup

subnet setup [options]

Interactive first-run wizard: discover local AI workspaces, select projects, show a per-phase pre-flight estimate (calls, tokens in/out, OpenRouter cost, wall time), then run init → sync → ingest → link → wisdom → dashboard.

FlagEffect
--discover-onlyList discoverable workspaces and exit.
--plan-onlyPer-phase estimate table + JSON; requires --projects.
--profile <name>Quality profile: lean · standard (default) · deep. --reprocess implies deep + full window re-triage.
--projects <paths>Comma-separated roots (non-interactive selection).
--agents <id>Limit discovery: cursor, claude-code, codex, copilot.
--yesSkip confirmation after the plan.
--jsonJSON output for discover/plan modes.
--reprocessPass through to ingest (re-triage all windows).
--verifyRun verify after ingest per project.
--proseGenerate portfolio markdown via ProfileWriter after link.
--skip-dashboardSkip dashboard build.
--openOpen dashboard in the browser when done.

update

subnet update [path] [--fast|--deep|--full] [--global] [--no-dashboard] [--verify] [--invalidate-cache] [--yes]

The day-to-day command. Incrementally re-syncs code, ingests new transcripts, re-links cross-project knowledge, and rebuilds dashboards. With no [path] it updates every registered project (serial). Concurrent runs serialize through a lock file.

FlagEffect
--fastLean — transcript-only; skip file analyze + enrich.
--deepDeep — analyze all pending files + legacy 8-agent enrich (incremental windows).
--fullDeep + reprocess — re-triage every window (after a model change).
--globalRebuild the cross-project dashboard too.
--no-dashboardSkip dashboard rebuild.
--verifyRun the verifier pass after ingest.
--invalidate-cacheClear cached agent runs first (use after switching models).

Exits non-zero if a project fails outright or a completed run had > 5% agent failures over a meaningful sample.

doctor

subnet doctor [path] [--fix] [--json]

Health report: config validation, unclustered facts, concepts missing summaries, pending file analysis, recent agent failure rate, model-config drift, pipeline audit counters (mechanical window drops, anchor rejects, tier-skipped files), stale registry paths, and last-run age. Read-only by default.

FlagEffect
--fixRe-summarize concepts missing summaries, re-link every project, rebuild dashboards.
--jsonMachine-readable output.

global

subnet global link [path] [--all] [--rebuild]
subnet global wisdom [--json]
subnet global dashboard [--open] [--no-wisdom]
subnet global profile [--prose] [--out <path>]
subnet global skills [--scope technical|industry] [--cross] [--limit <n>]

Cross-project operations on ~/.substrate-net/global.db. Replaces the top-level link, dashboard --global, profile, and skills commands.

global wisdom builds the L6 layer — organizes projects by PARA actionability, groups proficiency-leveled competency areas, clusters a subject → topic library, then synthesizes a headline, insights, and gaps — into global.db and prints it (--json for the full snapshot). It runs two reasoning agents (frontier → flash → local) with a data-driven offline fallback, cached per build. global dashboard runs it automatically before building; pass --no-wisdom to skip.

watch

subnet watch [--foreground] [--projects /a,/b] [--interval <ms>] [--global] [--stop]

Background daemon that watches project source trees + transcript roots and runs a debounced, serial update --fast for affected projects. See the automation guide.

serve

subnet serve [path] --mcp

Runs the MCP server over stdio. See MCP integration for client wiring and the tool catalogue.

Advanced (hidden) commands

These remain available for scripting and debugging but are hidden from subnet --help and the interactive menu. In 0.2.0, ingest, sync+chain, enrich, analyze, link, profile, and skills print a deprecation warning pointing to update / global (removal scheduled for 0.3.0).

init

subnet init [path]

Creates <path>/.substrate-net/ with empty code.db, knowledge.db, and a stub config.json. Registers the project in ~/.substrate-net/global.db.

sync

subnet sync [path] [--full]

Re-indexes the L0 code graph.

FlagEffect
--fullIgnore content hashes and re-parse every file.

Output:

L0 sync complete: 142 files, 2041 nodes, 3177 edges

analyze

subnet analyze [path] [--full]

Code-grounded analysis (the tree-sitter + LLM hybrid). For each indexed file it builds a deterministic payload from code.db — definitions, resolved imports, call-sites — plus a bounded source slice, and runs the FileAnalyzer agent to produce a plain-English summary, an architectural layer (api · service · data · ui · utility · other), tags, and language concepts. A directory-level ArchitectureAnalyzer pass then reconciles layers. Results land in code.db.file_analysis.

FlagEffect
--fullRe-analyze every file, ignoring content hashes.

Incremental: a file whose content_hash is unchanged since its last analysis is skipped. Also runs inside ingest (disable with --no-analyze).

ingest

subnet ingest [path] [--agent <id>] [--no-triage] [--no-extract] [--no-analyze] [--no-enrich] [--reprocess]

Pulls new conversation data, runs the agent pipeline (L1.5→L3), the code-grounded analysis (L0.5), then the enrichment pass (L2.5).

FlagEffect
--agent cursor|claude-code|codex|copilotLimit to one adapter.
--no-triageSkip the Triage Agent — useful when the LLM is offline.
--no-extractSkip extractor agents — populate L1/L1.5 only.
--no-enrichSkip the L2.5 enrichment pass.
--reprocessRe-run triage / extract / cluster over all existing windows, not just newly ingested ones. Use after a model swap or an interrupted run.

ingest is incremental — it only processes windows created this run. If a previous run finished cleanly, a re-run reports zeros because there is nothing new. --reprocess forces a full re-pass.

Output:

Ingest complete:
  Sessions seen:    24 (new: 3)
  Turns ingested:   58
  Windows created:  19
  Triaged:          19 (kept 14, dropped 5)
  Facts produced:   31
  Concepts:         6 created, 14 attached
  Domain entities:  8
  Relationships:    11
  Knowledge gaps:   2

enrich

subnet enrich [path] [--no-agent]

Runs the L2.5 enrichment pass on its own: manifest + SQL structural extraction, entity reconciliation, technical-skill synthesis, domain modeling, industry classification, industry enrichment, and gap detection. Works for any project type — frontend, library, or schema-heavy backend — using whatever signal exists (code, manifests, conversations).

FlagEffect
--no-agentStructural + deterministic gaps only (no LLM): manifests, SQL entities, reconciliation, detected gaps.

Counts in the report are rows added this run, not totals. A re-run over already-enriched data shows zeros; use subnet status for true totals.

status

subnet status [path]

Counts per layer, broken down by scope and grounding. Cheap, read-only.

canvas

subnet canvas <kind> [path]

Generates a self-contained .canvas.tsx under .substrate-net/canvas/.

KindPurpose
triage-auditEvery triaged window with labels and rationale; filter by kept/dropped/domain.
project-mapL3 concepts grouped with member facts and L0 code links.
decision-timelineChronological view of decisions, business rules, problems / solutions.
business-logicDomain rules and entities, grouped by concept.
cross-project-bridgeShared concepts across two or more registered projects.
subnet link [path] [--rebuild]

Rebuilds the L4 cross-project graph and the L5 skill graph: exports this project's concepts and enrichment evidence to ~/.substrate-net/global.db, runs mechanical matching, the Linker Agent, then synthesizes skills across all registered projects.

FlagEffect
--rebuildWipe concept_links first; re-compute from scratch.

skills

subnet skills [--scope technical|industry] [--cross] [--limit <n>]

The global skill graph (L5): what you know, weighted by evidence across projects. Each row shows evidence weight, grounding, and project count.

FlagEffect
--scopeFilter to technical or industry skills.
--crossOnly skills present in more than one project.

profile

subnet profile [--prose] [--out <path>]

The cross-project summary: classified industries, top technical skills by evidence weight, and the grounding mix. Read-only over global.db.

FlagEffect
--proseGenerate portfolio/background markdown via the ProfileWriter agent (consumes domain highlights + skills + industries).
--out <path>Where to write the prose (default ~/.substrate-net/profile.md).

ProfileWriter respects grounding: structural/corroborated skills are stated as demonstrated; stated ones are hedged; nothing is invented.

learn

subnet learn [path] [--limit <n>]

Learning targets: industry-standard knowledge (grounding model / external) the IndustryEnricher surfaced that is not yet grounded in your own work. These are general domain knowledge, explicitly distinct from facts about your project.

verify

subnet verify [path] [--prune-below <n>] [--max-pairs <n>] [--invalidate-triage-days <n>]

Runs the Verifier sweep:

  1. Prune orphan facts whose confidence falls below the threshold (default 0.25).
  2. For each cluster with multiple same-kind facts, pairwise verify (cap per cluster).
  3. Optionally invalidate triage cache entries older than N days so the next ingest re-triages them.

dashboard

subnet dashboard [path] [--open]

Builds a self-contained interactive graph dashboard from the project's SQLite databases: a file-level dependency graph (nodes colored by architectural layer), domain highlights/entities, L3 concepts, and a fuzzy search index. Emits a single offline-openable index.html (graph inlined) plus a shareable graph.json to <project>/.substrate-net/dashboard/.

FlagEffect
--openOpen the generated dashboard in your browser.

Build the viewer bundle once with npm run build:dashboard (or npm run build:all). See the dashboard guide.

clean

subnet clean [path] [--local-only] [--global-only] [--all] [--yes]

Removes a project's knowledge: its local .substrate-net/ and/or its rows in the global brain. The skill graph is re-aggregated after global rows are removed. Runs as a dry run by default — it prints the plan and only deletes with --yes.

FlagEffect
--local-onlyOnly delete the local .substrate-net/ directory.
--global-onlyOnly delete this project's rows in ~/.substrate-net/global.db.
--allFull reset: every registered project's local data + the global brain (keeps config.json).
-y, --yesSkip the dry run and actually delete.

triage audit

subnet triage audit [path] [--dropped] [--limit <n>]

Lists triaged windows with their labels and rationale. Use --dropped to inspect what triage filtered out and decide whether to tune.

agents

subnet agents list
subnet agents eval [path] [--agent <name>]
subnet agents run <name> [path]

list shows registered agents and their prompt versions. eval runs every golden fixture under __tests__/agents/<name>/ against the configured backend and prints PASS / FAIL. run executes a single agent over its pending input — handy for debugging prompt or schema changes.