CLI Reference
Complete reference for all Weave CLI commands
CLI Reference
Section titled “CLI Reference”The Weave CLI is the user-facing command surface for creating, validating, and managing Weave configuration. It creates .weave configuration directories and safely hands Weave intent to supported harness installers. It does not start, supervise, or drive third-party harness runtimes.
Note: weave run is not supported. Weave configures harnesses; harnesses run themselves. Use weave init and harness-specific launch commands instead.
Installation
Section titled “Installation”Install the Weave CLI package with Bun:
bun installbun run buildbun link ./packages/clicommand -v weaveweave --helpOr use package runners once @weaveio/weave-cli is published:
bunx @weaveio/weave-cli --helpnpx @weaveio/weave-cli --helppnpm dlx @weaveio/weave-cli --helpAccessibility
Section titled “Accessibility”The CLI renders a colorful WEAVE banner when terminal color is supported. To disable color output:
NO_COLOR=1 weave --helpWhen color is disabled or stdout is not a TTY, output remains readable plain text.
weave init
Section titled “weave init”Creates a starter Weave config directory containing config.weave and prompts/. See the DSL Configuration guide for configuration syntax.
Synopsis
Section titled “Synopsis”weave init [--scope <scope>] [--install-dir <path>] [--harness <name>] [--all-harnesses] [--force] [--yes]| Flag | Description |
|---|---|
--scope <scope> |
Target scope: global (default: ~/.weave) or local (default: <projectRoot>/.weave) |
--install-dir <path> |
Custom installation directory (overrides default scope path) |
--harness <name> |
Install for specific harness: opencode, claude-code, or pi |
--all-harnesses |
Install for all detected supported harnesses |
--force |
Overwrite existing config.weave (creates .bak backup) |
--yes, -y |
Accept safe defaults without prompts (required for non-TTY) |
Scope defaults
Section titled “Scope defaults”| Scope | Default directory | Purpose |
|---|---|---|
global |
~/.weave |
Shared user-level defaults across projects |
local |
<projectRoot>/.weave |
Project-level configuration for the current repository |
Safety behavior
Section titled “Safety behavior”- Existing
config.weaveis skipped by default --forcewritesconfig.weave.bakbefore overwriting--yes/-yaccepts safe defaults without prompts- Non-TTY invocations do not hang; use decisive flags such as
--scopeand--yesin scripts - Prompt cancellation exits cleanly with code
0
Examples
Section titled “Examples”# Interactive local initweave init --scope local
# Non-interactive global initweave init --scope global --yes
# Custom directoryweave init --scope local --install-dir ./custom-weave --yes
# Install for specific harnessweave init --harness opencode --yes
# Install for all detected harnessesweave init --all-harnesses --yesExpected output
Section titled “Expected output”✓ Created .weave/config.weave✓ Created .weave/prompts/✓ Weave configuration initialized
Next steps: weave validate weave prompt listweave init migrate
Section titled “weave init migrate”Converts a legacy OpenCode JSONC config (weave-opencode.jsonc) into the current .weave DSL. Migration is also offered automatically during ordinary weave init when a legacy source file is detected for the chosen scope.
Synopsis
Section titled “Synopsis”weave init migrate [--scope <scope>] [--yes]| Flag | Description |
|---|---|
--scope <scope> |
Target scope: global or local |
--yes, -y |
Non-interactive migration (required for non-TTY) |
Entry paths
Section titled “Entry paths”Explicit migrate mode - direct invocation:
weave init migrate --scope localweave init migrate --scope globalweave init migrate --scope local --yesweave init migrate --scope global --yesOrdinary init discovery - migration is offered after scope selection when the legacy source exists:
weave init --scope local # offers migration if .opencode/weave-opencode.jsonc existsweave init --scope global # offers migration if ~/.config/opencode/weave-opencode.jsonc existsweave init --yes # auto-migrates non-interactively when legacy source is foundScope-aware legacy source paths
Section titled “Scope-aware legacy source paths”| Scope | Legacy source path |
|---|---|
local |
<projectRoot>/.opencode/weave-opencode.jsonc |
global |
~/.config/opencode/weave-opencode.jsonc |
Canonical migration destinations
Section titled “Canonical migration destinations”Migration always writes to the canonical Weave config paths:
| Scope | Destination |
|---|---|
local |
<projectRoot>/.weave/config.weave |
global |
~/.weave/config.weave |
Note: --install-dir is ignored in migrate mode. Migration always writes to the canonical scope destination to ensure the config loader can discover the file at runtime.
Preflight summary
Section titled “Preflight summary”Before any file is written, migration shows a preflight summary:
Migration preflight
Source: /project/.opencode/weave-opencode.jsonc Destination: /project/.weave/config.weave Scope: local Overwrite: no (destination does not exist) Skipped fields: noneWhen the destination already exists:
Migration preflight
Source: /project/.opencode/weave-opencode.jsonc Destination: /project/.weave/config.weave Scope: local Overwrite: yes - backup will be created at /project/.weave/config.weave.bak Skipped fields: 2 field(s) will be skipped with warningsSafety behavior
Section titled “Safety behavior”- Validation before write: generated
.weaveDSL is validated through the normalparseConfig()pipeline before any file is mutated. If validation fails, migration aborts with no destination or backup written. - Overwrite backup: when the destination already exists, exactly one backup is written at
<destination>.bakbefore the destination is overwritten. - Source preservation: the legacy JSONC source file is never renamed or deleted after successful migration.
- Provenance comment: generated
config.weavebegins with a comment block naming the legacy source, scope, and generator. - JSONC comment stripping: arbitrary comments from the legacy JSONC source are not preserved in the generated DSL. Only structured field values are converted.
Warning semantics
Section titled “Warning semantics”Migration uses best-effort partial conversion: supported fields are written even when some legacy fields are skipped. When fields are skipped, a warning summary is printed after the success message:
⚠ Migration warnings - the following legacy fields were skipped:
• workflows: legacy workflow definitions are not supported in migration v1; define workflows using the current DSL workflow syntax • continuation: legacy continuation settings are not supported in migration v1; use the current DSL continuation block if needed • custom_agents.loom: "loom" collides with a builtin agent name; skipped to avoid silently overriding the builtin • agents.shuttle.tools.call_weave_agent: "call_weave_agent" is a harness-specific tool name that cannot be mapped to an abstract tool_policy capability; skippedExit code: migration exits with code 0 even when warnings are emitted, as long as the destination file was written successfully.
Supported field conversions
Section titled “Supported field conversions”| Legacy field | Current DSL output | Notes |
|---|---|---|
disabled_agents |
disable agents [...] |
Direct mapping |
disabled_hooks |
disable hooks [...] |
Direct mapping |
disabled_skills |
disable skills [...] |
Direct mapping |
log_level |
settings { log_level <VALUE> } |
Direct mapping |
agents.<name> |
agent <name> { ... } |
Builtin override only |
custom_agents.<name> |
agent <name> { ... } |
New agent (no builtin collision) |
categories.<name> |
category <name> { ... } |
Direct mapping |
model + fallback_models |
models [primary, ...fallbacks] |
Combined into array |
tools |
tool_policy { ... } |
Known tools only |
prompt_file |
prompt_file "..." |
Bare filenames only (no directory separators) |
Explicitly skipped in migration v1 (warn + skip): workflows, continuation, analytics, background.
Agent namespace rules
Section titled “Agent namespace rules”agentsentries are treated as overrides of existing builtin agent names (loom,tapestry,shuttle,pattern,thread,spindle,weft,warp). Non-builtin names underagentsare warned and skipped.custom_agentsentries become newagent <name>blocks when the name does not collide with a builtin. Collisions are warned and skipped.categoriesbecomecategory <name>blocks. The current DSL generatesshuttle-<category>semantics automatically.
Prompt file translation
Section titled “Prompt file translation”prompt_file values are preserved only when the path is a bare filename with no directory separators (e.g. "loom.md"). Paths with directory components (e.g. "subdir/loom.md", "/abs/path.md", "../prompts/loom.md") cannot be safely translated to the current .weave/prompts/ convention and are warned and skipped.
Post-migration flow
Section titled “Post-migration flow”After a successful migration write, weave init migrate continues into the normal harness selection and configuration flow. This matches the behavior of ordinary weave init - migration is not a terminal command.
weave validate
Section titled “weave validate”Validates effective, scoped, or explicit Weave config. See the DSL Configuration guide for configuration syntax and structure.
Synopsis
Section titled “Synopsis”weave validate [--project | --global | --path <file>] [--json]| Flag | Description |
|---|---|
--project |
Validate ./.weave/config.weave only |
--global |
Validate ~/.weave/config.weave only |
--path <file> |
Validate specific config file |
--json |
Output machine-readable JSON |
Examples
Section titled “Examples”# Validate effective config for the current projectweave validate
# Validate project config onlyweave validate --project
# Validate global config onlyweave validate --global
# Validate specific fileweave validate --path file.weave
# JSON outputweave validate --path file.weave --jsonExpected output
Section titled “Expected output”Human-readable success output summarizes counts only:
✓ Valid Weave configuration
Agents: 8 Categories: 3 Workflows: 2 Disabled: 1 agent, 2 skills Log level: infoThe CLI intentionally avoids printing full private prompt/config content in normal success output. Parse and validation failures use file:line:column: message formatting where the DSL pipeline provides location data.
weave prompt
Section titled “weave prompt”Inspects composed agent prompts or lists available agent names from the effective config. See the Agents guide for information about agent roles and the Prompt Composition guide for how prompts are composed.
Synopsis
Section titled “Synopsis”weave prompt <subcommand> [--json]Subcommands
Section titled “Subcommands”weave prompt list
Section titled “weave prompt list”Prints available agent names, including generated category shuttle agents.
weave prompt listweave prompt list --jsonExpected output:
Available agents:
loom tapestry shuttle shuttle-backend shuttle-frontend pattern thread spindle weft warpweave prompt inspect <agent>
Section titled “weave prompt inspect <agent>”Renders the fully composed prompt for the requested agent.
weave prompt inspect loomweave prompt inspect loom --jsonExpected output:
Agent: loom
# Role
You are **loom**, the orchestration coordinator...
[Full composed prompt text]| Flag | Description |
|---|---|
--json |
Emit machine-readable output |
Running weave prompt without a subcommand prints inline usage and exits with code 1.
weave prompt self-modify
Section titled “weave prompt self-modify”Prints a deterministic, text-only guide that tells an agent exactly which files to read, what rules to follow, and how to verify changes when modifying Weave’s own configuration.
Synopsis
Section titled “Synopsis”weave prompt self-modify [--scope <scope>]| Flag | Description |
|---|---|
--scope <scope> |
Target scope: global (default) or local |
v1 constraints
Section titled “v1 constraints”| Constraint | Detail |
|---|---|
| Text-only output | The guide is always plain Markdown text. --json is rejected with exit code 1. |
| Scope-only tailoring | The only accepted flag is --scope global|local. No other tailoring flags are accepted. |
| Default scope: global | When --scope is omitted, the guide targets the global scope (~/.weave/). |
| No extra positional args | Any extra positional arguments after self-modify are rejected with exit code 1. |
| No config loading | The command does not load or validate the current Weave config. It prints the guide unconditionally. |
What the guide covers
Section titled “What the guide covers”The printed guide includes:
- The selected scope label (
global (~/.weave/)orlocal (.weave/)) - The canonical config file path and prompts directory path for the scope
- A pre-flight checklist naming
docs/dsl-reference.mdanddocs/config-loading.mdas required reading - A note that
docs/prompt-composition.mdmust be read before any prompt-related change - A clear statement that
packages/docs/is a public mirror, not the canonical source - the authoritative docs live indocs/at the repo root - Target-aware rules (global vs. local scope differences)
- A step-by-step workflow: identify → read DSL section → edit config → place prompt files → validate → inspect
- Common DSL patterns (override builtin, add agent, add category, disable agent)
- Prompt-specific rules (Mustache context fields,
{{{delegation.section}}}, mutual exclusivity ofprompt/prompt_file) - Verification commands (
weave validate,weave prompt list,weave prompt inspect)
Examples
Section titled “Examples”# Guide for global scope (default)weave prompt self-modify
# Explicit global scopeweave prompt self-modify --scope global
# Guide for project scopeweave prompt self-modify --scope localweave compose
Section titled “weave compose”Composes agent prompts with adapter-specific formatting.
Synopsis
Section titled “Synopsis”weave compose --adapter <adapter> <agent>| Flag | Description |
|---|---|
--adapter <adapter> |
Target adapter: claude-code |
Examples
Section titled “Examples”weave compose --adapter claude-code loomweave runtime
Section titled “weave runtime”Inspects runtime status and journal entries.
Synopsis
Section titled “Synopsis”weave runtime <subcommand>Subcommands
Section titled “Subcommands”weave runtime status
Section titled “weave runtime status”Shows current runtime status.
weave runtime statusExpected output:
Runtime status:
Harness: opencode Version: 1.0.0 Status: running PID: 12345weave runtime journal
Section titled “weave runtime journal”Shows recent runtime journal entries.
weave runtime journalExpected output:
Runtime journal:
2026-08-27 10:30:15 [info] Session started 2026-08-27 10:30:16 [info] Loaded config from .weave/config.weave 2026-08-27 10:30:17 [info] Agent loom initializedweave eval run
Section titled “weave eval run”Executes agent evaluation suites against the built-in model matrix. This is the primary eval entry point for CI and local verification.
Synopsis
Section titled “Synopsis”weave eval run [--agent <agent>] [--model <model>] [--case <case>] [--dry-run] [--raw-artifacts]| Flag | Description |
|---|---|
--agent <agent> |
Restrict to specific agent suite(s) |
--model <model> |
Restrict to specific model (exact match) |
--case <case> |
Restrict to specific case ID (exact match) |
--dry-run |
Print what would run, no execution |
--raw-artifacts |
Emit raw prompt text locally (NEVER in CI) |
Agent suites
Section titled “Agent suites”The current eval surface is a shared eight-suite text-only registry:
| Suite ID | Short alias | Description |
|---|---|---|
loom-routing |
loom |
Loom routing eval cases |
tapestry-execution |
tapestry |
Tapestry execution eval cases |
tapestry-category-routing |
tapestry |
Tapestry category routing eval cases |
shuttle-execution |
shuttle |
Shuttle delegated-task reporting eval cases |
spindle-tools |
spindle |
Spindle research-structure eval cases |
pattern-planning |
pattern |
Pattern planning eval cases |
weft-review |
weft |
Weft review eval cases |
warp-security |
warp |
Warp security eval cases |
Required environment variable
Section titled “Required environment variable”export OPENROUTER_API_KEY=<your-key>OPENROUTER_API_KEY must be set before running weave eval run. The runner validates it at startup and aborts immediately if absent or empty. The key value is never logged, printed, or serialized anywhere in the eval pipeline.
Exception: weave eval run --dry-run does not build live model clients and does not require OPENROUTER_API_KEY.
Filter semantics
Section titled “Filter semantics”All three filters use strict exact-match:
--agentmust match either the suite name or the short agent name. No other values are accepted.--modelmust exactly match a modelidinevals/model-matrix.json. No substring matching.--casemust exactly match theidfield in a case fixture file. No glob or prefix matching.
No filter means all values in that dimension are included. A no-filter run executes all three default models against all cases in all registered suites.
Environment variable filters
Section titled “Environment variable filters”Filters can also be supplied via environment variables - useful in CI workflow dispatch:
WEAVE_EVAL_AGENT=loom weave eval runWEAVE_EVAL_MODEL=anthropic/claude-sonnet-4.5 weave eval runWEAVE_EVAL_CASE=loom-route-backend-api weave eval runCLI flags and env vars are merged. Conflicting values for the same filter key (CLI vs env) cause a hard DuplicateConflictingInput error. Same-value duplicates are silently collapsed. Empty env filter values are treated as unset.
Examples
Section titled “Examples”# Run all suites against default models (3)weave eval run
# Restrict to loom-routing suiteweave eval run --agent loom
# Restrict to tapestry-execution and tapestry-category-routing suitesweave eval run --agent tapestry
# Restrict to tapestry-category-routing suite onlyweave eval run --agent tapestry-category-routing
# Restrict to shuttle-execution suiteweave eval run --agent shuttle
# Restrict to spindle-tools suiteweave eval run --agent spindle
# Restrict to pattern-planning suiteweave eval run --agent pattern
# Restrict to weft-review suiteweave eval run --agent weft
# Restrict to warp-security suiteweave eval run --agent warp
# Restrict to one model (exact match)weave eval run --model anthropic/claude-sonnet-4.5
# Restrict to one case ID (exact match)weave eval run --case loom-route-backend-api
# Restrict to one shuttle-execution caseweave eval run --case shuttle-execution-report-structured-evidence
# Restrict to one weft-review caseweave eval run --case weft-review-clean-approval
# Restrict to one warp-security caseweave eval run --case warp-security-block-evidence-findings
# Print what would run, no executionweave eval run --dry-run
# Emit raw prompt text locally (NEVER in CI)weave eval run --raw-artifactsExpected output
Section titled “Expected output”Eval run started
Run ID: abc1234-2026-08-27-001 Suites: 8 Models: 3 Cases: 24
Running loom-routing... ✓ loom-route-backend-api (anthropic/claude-sonnet-4.5) ✓ loom-route-frontend-ui (anthropic/claude-sonnet-4.5) ✓ loom-route-ambiguous-direct-shuttle (anthropic/claude-sonnet-4.5)
[...]
Eval run complete
Run ID: abc1234-2026-08-27-001 Duration: 2m 34s Pass rate: 92% (66/72 cases)
Artifacts written to: eval-bundles/runs/abc1234-2026-08-27-001/--dry-run
Section titled “--dry-run”Dry-run prints filters and confirms no execution will occur. No model calls are made, no artifacts are written, and secrets are not required. Dry-run still performs the same input validation and suite fixture/rubric loading path as a live run.
weave eval run --agent loom --model anthropic/claude-sonnet-4.5 --dry-runThis is the recommended contributor preflight path because it exercises the same filter and suite-validation path without requiring secrets.
--raw-artifacts - local-only, never CI
Section titled “--raw-artifacts - local-only, never CI”Security warning:
--raw-artifactsis rejected in CI environments (CI=true). Passing it in a CI workflow step is a hard validation error. Raw artifacts contain composed prompt text and full transcripts and must never be committed or published.
When enabled locally, raw artifacts are written to eval-bundles/runs/<runId>/raw/. Filename components are sanitized before write, and the resolved path must stay under raw/. Add this directory to .gitignore. Raw files must never be committed to any repository.
Exit codes
Section titled “Exit codes”Completed eval runs exit with code 0 even when one or more cases miss their pass threshold. Threshold misses are captured in run-summary.json and per-suite score files. The command exits non-zero for hard orchestration failures such as invalid input, missing secrets, model matrix/load failures, bundle write/publish failures, or suite-level partial failures that prevent complete results.
Harness detection and installation
Section titled “Harness detection and installation”Detection is side-effect free. It may probe config paths, check readability, inspect PATH binaries, and read optional version strings through injected probes, but it must not create directories, write files, edit config, or launch harness runtimes.
Supported detection IDs:
opencodeclaude-codepi
Installer support is intentionally separate from detection support. OpenCode has a first installer boundary; Claude Code and Pi currently report unsupported installer messages until adapter-specific installers exist.
weave init --harness opencode --yesweave init --harness pi --yes # explicit unsupported/undetected failure until supportedweave init --all-harnesses --yes # install supported detected harnesses, skip unsupported onesHarness writes only happen after explicit non-interactive flags or interactive confirmation.
Security warnings
Section titled “Security warnings”Never do any of the following:
- Commit or log
OPENROUTER_API_KEYvalues.- Commit or log
EVAL_RESULTS_REPO_TOKENvalues.- Use
--raw-artifactsin any CI workflow step.- Commit files from
eval-bundles/runs/<runId>/raw/or any file containingcomposedPromptorrawContent.- Pass raw artifacts to
ArtifactBundleWriter- all publishable output must go throughsanitizer.ts.