Skip to content

CLI Reference

Initialize a new project.

Terminal window
az init [--private] [--editor <editor>]
FlagDescription
--privateUse private-by-default policy (network denied, local-only routing)
--editorGenerate editor/tool config. Values: vscode, cursor, zed, neovim, vim, claude, codex, gemini

The --editor flag generates integration files for the specified editor or CLI tool:

Editor/ToolGenerated Files
vscode.vscode/tasks.json
cursor.cursor/rules
zed.zed/tasks.json
neovim / nvimPrints setup instructions
vimPrints setup instructions
claude / codex / gemini.mcp.json (MCP server config)

Detect your platform, probe for existing LLM backends, and generate initial configuration.

Terminal window
az bootstrap [OPTIONS]
FlagDescription
--non-interactiveSkip prompts (for CI/scripting)
--skip-modelSkip model download after backend install

Probes ports 11434 (Ollama), 8080 (llama.cpp), 8000 (vLLM) for running backends. Recommends the best backend per platform (OS/arch), offers to install it, and generates .agentzero/models.json.

Start an interactive chat session.

Terminal window
az chat [OPTIONS]
FlagDescription
--remoteAllow remote model calls (local-only by default)
-m, --modelModel name (default: llama3.2)
--streamStream tokens as they arrive
-p, --providerProvider: ollama, llama-cpp, vllm, lm-studio, anthropic
--urlCustom server URL
--resumeResume a previous session by ID
--no-encryptDisable encryption of audit and session files (encrypted by default)
-P, --printSingle-shot mode: send one message, print response, exit
--modeOutput format for -P mode: text (default), json (pretty), jsonl (compact)
--hibernate-afterHibernate after N minutes of inactivity. Saves a full checkpoint and exits.
--compactionContext compaction strategy: simple (default), code-aware, role-budget
--compaction-modelUse an LLM for compaction (e.g., llama3.2:1b). Generates real summaries instead of text truncation.
--branchBranch from a tree node when resuming (requires --resume)

Start the MCP server for editor integration. Requires the mcp feature flag.

Terminal window
# Build with MCP support
cargo build --features mcp
# Run the MCP server
az mcp

Reads JSON-RPC 2.0 from stdin, writes to stdout. Running az mcp without the feature compiled in prints a message recommending ACP (az serve) as the native protocol. See ADR 0014.

Start the ACP server. Runs the full agentic loop — LLM inference with tool calling, approval flow, and streaming notifications. Editors connect over stdio to get a complete coding agent, not just a tool server.

Terminal window
az serve

Run an installed skill.

Terminal window
az run <name>

Routes by skill runtime declared in SKILL.md:

  • WASM skills — creates a session, checks policy, builds a sandbox profile, and executes the .wasm module through the wasmtime engine. WASM is compiled in by default (disable with --no-default-features); requires wasm_execution = "allow" or "require_approval" in policy.yml.
  • Host-supervised skills — runs the entrypoint script (default run.sh) on the host with ShellCommand capability check. Policy-gated and audited.
  • Scanner skills (with patterns.toml) — runs the security scanner against the current directory.
  • Instruction-only skills — displays the SKILL.md content.

Install a skill from a local path, GitHub owner/repo, or git URL.

Terminal window
az install <source>

The source is auto-detected:

FormatExampleAction
owner/repoauser/my-skillDownload latest GitHub release
GitHub URLhttps://github.com/auser/my-skillDownload latest GitHub release
Git URLhttps://gitlab.com/user/repoClone via git
Local path/path/to/skill or ./my-skillCopy directory

GitHub installs verify SHA-256 checksums from the release notes. All install methods update .agentzero/skills.lock.

Package and publish a skill to a GitHub release.

Terminal window
az publish [path] [OPTIONS]
FlagDescription
--repoTarget GitHub repository (owner/repo). Auto-detected from git remote if omitted.
--tagRelease tag (default: v<version> from SKILL.md)

Requires GITHUB_TOKEN environment variable. Creates a GitHub release, uploads the tarball, and includes the SHA-256 checksum in the release notes.

System diagnostic. Reports crate status, project initialization, policy rules, skills, vault, sessions, providers, and WASM sandbox status (compiled-in, policy setting, WASM skill count).

Terminal window
az doctor

Export a session to markdown, HTML, or JSON.

Terminal window
az export <session-id> [OPTIONS]
FlagDescription
--formatOutput format: md (default), html, json
-o, --outputOutput file path (default: stdout)

The HTML format is self-contained with inline CSS and role-colored messages. Loads from session JSON or checkpoint format.

List past chat sessions.

Terminal window
az history [--usage]
FlagDescription
--usageShow token usage (input/output) from checkpoint files

Show token usage and cost report for sessions.

Terminal window
az usage [OPTIONS]
FlagDescription
--sessionShow usage for a specific session ID
--lastShow the last N sessions (default: 5)
--jsonOutput as JSON

Reads audit logs to produce per-session token usage reports with provider breakdown.

Configure AgentZero as an MCP server for an external CLI tool.

Terminal window
az connect <tool> [--dry-run]
ToolConfig file
claude.mcp.json
codex.mcp.json
gemini.mcp.json

Safely merges the AgentZero MCP server entry into existing config (creates backup). Use --dry-run to preview without writing.

Show active policy rules.

Terminal window
az policy status

Show recent audit events.

Terminal window
az audit tail [-c, --count N]

Show a human-readable summary of audit activity across sessions.

Terminal window
az audit summary [--json]
FlagDescription
--jsonOutput structured JSON instead of human-readable text

Reports total sessions, total events, denied actions, and redactions applied.

Build and query a semantic document index. Requires the rag feature (cargo build --features rag).

Terminal window
az index build [OPTIONS]
FlagDescription
--pathDirectory to index (default: current directory)
--modelEmbedding model (default: nomic-embed-text)
--urlOllama server URL (default: http://localhost:11434)
--chunk-sizeMax characters per chunk (default: 1000)
Terminal window
az index status

Shows model name, file count, chunk count, and creation timestamp.

Terminal window
az index clear

Removes the index from .agentzero/index/.

Search the skill index for matching skills.

Terminal window
az search <query> [--json]
FlagDescription
--jsonOutput structured JSON

Matches against skill name, description, and tags. Results include trust tier (Verified, Community, Generated).

Share tools across projects via symlinks.

Terminal window
az link <source>

Creates a symlink in the current project’s skill directory pointing to <source>. Useful for sharing generated or installed tools between projects.

Manage encrypted secrets.

Terminal window
az vault list
az vault add <provider> <name>
az vault get <provider> <name>
az vault remove <provider> <name>

Import secrets from a .env file into the encrypted vault.

Terminal window
az vault-import <path> [--dry-run]
FlagDescription
--dry-runShow what would be imported without writing to the vault

Parses KEY=VALUE lines from the file and stores each as a vault secret.

List installed plugins.

Terminal window
az plugin list

Scans .agentzero/plugins/ for directories containing a PLUGIN.toml manifest. Displays name, version, command count, and description.

Install a plugin from a local directory or GitHub release.

Terminal window
az plugin install <source>
FormatExampleAction
owner/repoauser/brain-pluginDownload latest GitHub release
Local path./my-pluginCopy from local directory

The source must contain a PLUGIN.toml and at least one .wasm file. GitHub installs verify SHA-256 checksums. Updates .agentzero/plugins/plugins.lock.

Show plugin details.

Terminal window
az plugin info <name>

Displays the plugin manifest, available commands, WASM path, and install location.

List configured messaging gateways.

Terminal window
az gateway list

Reads gateway configuration from .agentzero/gateways.toml. Shows name, type, channels, and poll interval for each gateway.

Start a messaging gateway in the foreground.

Terminal window
az gateway start <name>

Starts the named gateway, which polls for messages and routes them through the agent loop. Dangerous tools (write, edit, shell, generate_tool) are denied in gateway mode — only read-only tools are available without a human in the loop.

Gateway configuration lives in .agentzero/gateways.toml:

[[gateway]]
name = "slack-dev"
type = "slack"
token = "vault:slack/bot_token"
channels = ["#dev-agent"]
poll_interval_secs = 5

Supported gateway types: slack.

Initialize a new brain vault.

Terminal window
az brain init [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--forceForce overwrite existing files
--dry-runPrint actions without executing

Creates the vault directory structure (raw/, wiki/, templates/, prompts/), starter files, configuration (.agentzero-brain.toml), and agent instruction files.

Open or create today’s daily note.

Terminal window
az brain today [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--dateDate override (YYYY-MM-DD)
--openOpen in $EDITOR

Capture a thought to today’s daily note.

Terminal window
az brain capture <message> [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--dateDate override (YYYY-MM-DD)
--sectionSection heading to append under (default: Capture)

Appends a timestamped entry under the specified section of the daily note.

Search the vault for a term.

Terminal window
az brain query <term> [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--rawAlso search the raw directory
--jsonOutput as JSON
--limitMaximum number of results (default: 50)

Generate an ingest prompt for a raw file.

Terminal window
az brain ingest <path> [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--save-promptSave the prompt to wiki/reports/
--dry-runShow what would happen without writing

Generate an end-of-day review prompt.

Terminal window
az brain review [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--dateDate to review (YYYY-MM-DD)
--save-promptSave the prompt to wiki/reports/
--dry-runShow what would happen without writing

Generate a weekly review prompt.

Terminal window
az brain weekly [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--weekISO week identifier (e.g., 2026-W20)
--save-promptSave the prompt to wiki/reports/

Run vault health diagnostics.

Terminal window
az brain health [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--jsonOutput as JSON
--fixAttempt to fix issues (not yet implemented)

Checks for missing frontmatter, unprocessed inbox files, orphan notes, empty sections, and oversized files.

Git checkpoint the vault.

Terminal window
az brain checkpoint [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--messageCustom commit message
--initInitialize a git repo if none exists
--dry-runShow what would happen without executing

Ask a question using semantic search over the vault (RAG).

Terminal window
az brain ask <question> [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)
--limitNumber of results (default: 5)
--ollama-urlOllama server URL (default: http://localhost:11434)
--embed-modelEmbedding model (default: nomic-embed-text)
--jsonOutput as JSON
--reindexRebuild the index before querying

Requires --features rag. Builds/updates the semantic index on first use.

Show vault status summary.

Terminal window
az brain status [OPTIONS]
FlagDescription
--rootRoot directory for the vault (default: .)

Reports wiki note count, daily note count, raw file count, date format, raw immutability setting, and git presence.

Generate shell completions for az.

Terminal window
az completions <SHELL>

Supported shells: bash, zsh, fish, elvish, powershell.

Terminal window
# Zsh — add to ~/.zshrc
az completions zsh > ~/.zfunc/_az
# Bash
az completions bash > ~/.local/share/bash-completion/completions/az
# Fish
az completions fish > ~/.config/fish/completions/az.fish