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.
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.
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.
| Flag | Effect |
|---|---|
--discover-only | List discoverable workspaces and exit. |
--plan-only | Per-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. |
--yes | Skip confirmation after the plan. |
--json | JSON output for discover/plan modes. |
--reprocess | Pass through to ingest (re-triage all windows). |
--verify | Run verify after ingest per project. |
--prose | Generate portfolio markdown via ProfileWriter after link. |
--skip-dashboard | Skip dashboard build. |
--open | Open dashboard in the browser when done. |
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.
| Flag | Effect |
|---|---|
--fast | Lean — transcript-only; skip file analyze + enrich. |
--deep | Deep — analyze all pending files + legacy 8-agent enrich (incremental windows). |
--full | Deep + reprocess — re-triage every window (after a model change). |
--global | Rebuild the cross-project dashboard too. |
--no-dashboard | Skip dashboard rebuild. |
--verify | Run the verifier pass after ingest. |
--invalidate-cache | Clear 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.
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.
| Flag | Effect |
|---|---|
--fix | Re-summarize concepts missing summaries, re-link every project, rebuild dashboards. |
--json | Machine-readable output. |
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.
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.
subnet serve [path] --mcp
Runs the MCP server over stdio. See MCP integration for client wiring and the tool catalogue.
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).
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.
subnet sync [path] [--full]
Re-indexes the L0 code graph.
| Flag | Effect |
|---|---|
--full | Ignore content hashes and re-parse every file. |
Output:
L0 sync complete: 142 files, 2041 nodes, 3177 edges
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.
| Flag | Effect |
|---|---|
--full | Re-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).
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).
| Flag | Effect |
|---|---|
--agent cursor|claude-code|codex|copilot | Limit to one adapter. |
--no-triage | Skip the Triage Agent — useful when the LLM is offline. |
--no-extract | Skip extractor agents — populate L1/L1.5 only. |
--no-enrich | Skip the L2.5 enrichment pass. |
--reprocess | Re-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
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).
| Flag | Effect |
|---|---|
--no-agent | Structural + 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.
subnet status [path]
Counts per layer, broken down by scope and grounding. Cheap, read-only.
subnet canvas <kind> [path]
Generates a self-contained .canvas.tsx under .substrate-net/canvas/.
| Kind | Purpose |
|---|---|
triage-audit | Every triaged window with labels and rationale; filter by kept/dropped/domain. |
project-map | L3 concepts grouped with member facts and L0 code links. |
decision-timeline | Chronological view of decisions, business rules, problems / solutions. |
business-logic | Domain rules and entities, grouped by concept. |
cross-project-bridge | Shared 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.
| Flag | Effect |
|---|---|
--rebuild | Wipe concept_links first; re-compute from scratch. |
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.
| Flag | Effect |
|---|---|
--scope | Filter to technical or industry skills. |
--cross | Only skills present in more than one project. |
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.
| Flag | Effect |
|---|---|
--prose | Generate 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.
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.
subnet verify [path] [--prune-below <n>] [--max-pairs <n>] [--invalidate-triage-days <n>]
Runs the Verifier sweep:
0.25).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/.
| Flag | Effect |
|---|---|
--open | Open 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.
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.
| Flag | Effect |
|---|---|
--local-only | Only delete the local .substrate-net/ directory. |
--global-only | Only delete this project's rows in ~/.substrate-net/global.db. |
--all | Full reset: every registered project's local data + the global brain (keeps config.json). |
-y, --yes | Skip the dry run and actually delete. |
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.
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.