Wire CLI
Author Wire diagrams from the command line. Init from templates, add nodes, validate, and export to SVG / JSON / Mermaid.
Install
Install globally for the bare wire binary, or run via npx without installing.
# global install
npm install -g @aigentive/wire-cli
# or run ad-hoc
npx @aigentive/wire-cli helpQuickstart
Create a diagram from a template, add nodes, validate, and export.
# Init from a built-in template
wire init my-flow --template=approval-flow --title="Approval flow"
# Add nodes (from is "<id>" or "<id>.<branch>")
wire add ai --diagram=my-flow --title="Classify intent" \
--description="Route by customer intent" \
--from=incoming --model=gpt-5.4-mini
wire add tool --diagram=my-flow --title="Search CRM" \
--from=classify --ref=crm.search --tools=crm_search
wire add condition --diagram=my-flow --title="Route" \
--from=classify --branches=sales,support,other
# Validate
wire validate my-flow
# Export
wire export my-flow --format=svg --out=my-flow.svg
wire export my-flow --format=mermaid --out=my-flow.mmd
wire export my-flow --format=json > my-flow.json
# List everything in the storage directory
wire lsCommands
wire init <id> [flags]Create a new diagram, optionally seeded from a template.
| --title="…" | Display title for the diagram. |
| --layout=LR|TB|RL|BT | Initial layout direction (default LR). |
| --template=agent-workflow|approval-flow|rag-pipeline | Seed nodes/edges from a built-in template. |
wire add <kind> --diagram=<id> [flags]Append a node of any kind to an existing diagram.
| --diagram=<id> | Diagram id to mutate (required). |
| --title="…" | Title for the node (required). |
| --id=<id> | Explicit node id; auto-generated when omitted. |
| --description="…" | Body copy for the rendered node card. |
| --from=<id> | Source node for the implicit edge (`id` or `id.branch`). |
| --branch=<name> | Branch name when wiring from a condition node. |
| --branches=a,b,c | Comma-separated branches (only valid for `condition`). |
| --model=<model> | Model name for `ai` nodes (gpt-5.4-mini, etc.). |
| --tools=a,b,c | Comma-separated id-safe tool names for `ai` nodes. |
| --ref=<tool.name> | External tool/function reference for `tool` nodes. |
| --body="…" | Body text for `note` nodes. |
| --tone=success|warning|error|info|ai | Visual tone for the node. |
wire validate <id>Run schema + structural validation on a stored diagram. Exits non-zero with issue codes if invalid.
wire export <id> --format=svg|json|mermaid [--out=<path>]Render or export a diagram. Writes to stdout when `--out` is omitted.
| --format=svg|json|mermaid | Output format (required). |
| --out=<path> | Write to file instead of stdout. |
wire lsList all diagrams in the storage directory (recency-sorted).
wire helpPrint the inline help text. `--help` and `-h` work too.
Storage
Diagrams are written as <id>.json files. The default directory is ./diagrams; override per-command with --dir=<path> or globally via the WIRE_DIR environment variable.
# per-command
wire ls --dir=/tmp/wire-diagrams
# environment
export WIRE_DIR=/Users/me/Documents/wire-diagrams
wire init my-flowExit codes
- 0 — success.
- 1 — runtime error (validation failure, missing diagram, parse error). Stderr carries the message.