CLI reference
The abt command is installed with the package ([project.scripts]).
This page covers the core workflow commands you use every day: init, run, dispatch, test, compile, docs generate and docs serve. All other commands live in the Advanced CLI reference: create, modify, graph, publish, watch, approvals, deps, discover, lint, config, debug, doctor, list and clean.
abt --version prints the installed version.
Project commands (compile, run, dispatch, test, doctor, graph, clean, …) look for abt.yaml in the current directory and its parents, or in --project-root. Without one they exit 2 with No abt.yaml found (E_NO_PROJECT) and write nothing. abt init creates a project.
--debug and --final-response are command flags (for example on run, test, doctor, and compile), not global flags.
--threads and --load-dot-env are global flags. Place them before the subcommand: abt --load-dot-env run my_agent -p "...". --load-dot-env loads a .env file into the process environment before the project is resolved, so {{ env_var('NAME') }} in profiles.yaml, MCP config and approvals config can read it. abt takes the nearest .env above the current directory, because --project-root is not parsed yet. Real environment variables always win over .env. You can also set ABT_LOAD_DOT_ENV=1. The SDK equivalent is load_dot_env=True on AbtRunner(...) or any abt.sdk.operations.* function. It searches from the given project_root instead of the current directory. See Environment variables — Secret interpolation.
Dry-run (--dry-run)
abt run, abt test and abt publish accept --dry-run. run and test compile, print a plan and exit 0 without calling a model. A model API key is not needed; a dry run resolves only the credentials the selected agents' package tools declare, and it stubs external context. To preview a workflow, use abt graph WORKFLOW, which renders its topology without running anything.
abt graph support_ticket
abt run -s hello --prompt "task" --dry-run
abt test --dry-run
abt init
Scaffold a new abt project or add missing files to an existing one.
# Scaffold in-place (default template: basic, anthropic-shaped profiles.yaml, tests on)
abt init
# Create a new sub-directory called "my-agent"
abt init my-agent
# If abt.yaml already exists: add missing files only, no prompts (CI-friendly)
abt init --no-input
# Scaffold with OpenAI provider
abt init my-agent --provider openai --no-input
# Minimal single-agent starter (`my-starter` is the new folder name)
abt init my-starter --template basic --no-input
# Slack incident triage (inline sources/retrievers/exposures, multi-agent workflow)
abt init incident-bot --template advanced --no-input
# Overwrite existing files (e.g. re-scaffold after editing)
abt init --force --no-input
| Flag / argument | Default | Meaning |
|---|---|---|
PROJECT_NAME |
(none — scaffold in-place) | When given, creates a sub-directory with this name under --project-root. |
--project-root |
. |
Parent directory. |
--provider |
anthropic |
Model provider for the generated profiles.yaml. Choices: anthropic, openai, bedrock. To route through a gateway (Bifrost, LiteLLM, etc.), set credentials.<provider>.base_url in the generated file. |
--profile |
project name | Profile key written to abt.yaml and profiles.yaml. |
--template |
basic |
basic: the smallest working project, an analyst and a reviewer that delegates to it. intermediate: the same two agents plus contracts, transformers and few-shots. advanced: an incident workflow with Slack and Jira sources, retrievers, transformers and a Slack exposure (see below). |
--with-tests / --no-tests |
--with-tests |
Generate a sample tests/<agent>.yaml. |
--with-handlers / --no-handlers |
--no-handlers |
Include the handlers/ folder and a reviewer on_success example (intermediate template only). Opt in once you need lifecycle hooks. |
--no-input |
off | Non-interactive: never prompt. If files already exist, they are left unchanged unless --force is set. |
--force |
off | Overwrite existing abt.yaml, profiles.yaml, agent/test files, and other scaffold paths. Without this, only missing files are created. |
--init-provider |
(none) | Scaffold providers/my_source.py, my_exposure.py, or my_context.py (source / exposure / context). |
--from-package |
(none) | Copy an agent template from .abt_packages: pkg_id.template_name (after abt deps). |
Generated structure depends on --template:
basic:agents/analyst.mdandagents/reviewer.md(the reviewer setssubagents: [analyst]),prompts/review_task.md(sample task text), one test suite per agent with asayscheck (unless--no-tests),abt.yaml,profiles.yaml(gitignored) and.gitignore. Eight files, nosources:,exposures:, tools or contracts.intermediate:agents/reviewer.mdandagents/analyst.md. The reviewer setssubagents: [analyst](tool delegation, not order) andtransformers: [validate_json, redact_pii, quality_gate]. Also created:contracts/review_result.py, the three transformer files undertransformers/, few-shots, macros,tools/word_count.py, tests (unless--no-tests),abt.yaml,profiles.yaml(gitignored) and.gitignore.advanced:workflows/incident_response.yamldeclares the edgesSTART → researcher → responder → investigate_incident → supervisor → slack_reply → END.investigate_incidentis a prompt node that joins theslack_threadandlinked_jirasource nodes.slack_replyis an exposure node. Run order lives in this file, not on the agents.agents/researcher.md,agents/responder.mdandagents/supervisor.mdhave nomode:orneeds:, onlyoutput_schema:and their own resources.supervisorreferences the sourcesslack_threadandlinked_jira, the retrieversjira_ticketsandconfluence_docs, the transformersto_canonical_json→redact_pii→format_slack→verify_response, and the exposureslack_reply. Each is a catalog YAML under its own directory.- Each agent has
middleware:guardrails (run_timeout,model_call_limit,token_budget). varsincludechannel_id,thread_tsandissue_key. Also created:context/incident/playbook.md,context/setup/prerequisites.mdand credential stubs inprofiles.yaml. There is noweb_searchand no MCP. See Workflows.
Existing project behaviour: without --force, any path that already exists is skipped (including abt.yaml and profiles.yaml). On a TTY, if abt.yaml already exists you are asked once to confirm patch-only mode; with --no-input, that prompt is skipped and missing scaffold files are added the same way.
After init:
# Set your LLM provider key (ANTHROPIC_API_KEY or OPENAI_API_KEY) and model_id in profiles.yaml.
# The generated profile reads its key from the environment, so export it before compiling:
export ANTHROPIC_API_KEY=... # --provider openai: OPENAI_API_KEY; --provider bedrock: AWS credentials instead
abt compile # verify the project parses
abt run -s reviewer -p "Review: revenue grew 40%, no citations." --dry-run # basic and intermediate templates; drop --dry-run to execute
# advanced template: abt graph incident_response # workflows/ workflow topology
abt compile and abt run --dry-run work without the key; a real run needs it. abt run -s AGENT needs -p (--auto takes the task itself): without it, abt run -s reviewer --dry-run exits 2 with No user message for agent 'reviewer'.
The advanced template also names SLACK_BOT_TOKEN and ATLASSIAN_API_TOKEN in profiles.yaml. abt compile, abt docs generate and abt config show run with both unset. abt chat reads every variable the profile names, so it needs both set (a placeholder is enough, see Chat).
abt run and abt dispatch — the selection model
Both commands take a bare name through a required -s/--select flag. There is no positional form. Order and branching between agents live entirely in a project's workflows/ directory now; abt run/abt dispatch pick which name to run, full stop. See Workflows.
abt run -s <agent>runs that agent plus its fullsubagents:tree, unbounded — never a workflow neighbor. Workflow isolation is structural, not an opt-in flag.abt dispatch -s <workflow>runs a workflow fromworkflows/end to end: sources, topology, exposures on success.- "
runis rehearsal (one node, no sources or exposures),dispatchis opening night (a whole workflow, with side effects)."
| Command | What runs | Who it's for |
|---|---|---|
abt dispatch -s <workflow> |
a workflow from workflows/ — sources, topology, exposures |
operators pressing a button |
abt run -s <agent> |
one agent plus its subagents: tree, without sources or exposures (those need abt dispatch) |
developers smoke-testing one node |
abt dispatch given an agent name (not a workflow) errors: 'triage' is an agent, not a workflow. abt dispatch only accepts workflow names — use abt run -s triage to run it. Omitting -s is a usage error. abt list shows the agents in a project.
This is a separate selection system from the -s/--select bare-name selector documented below for abt compile/abt test/abt doctor — those three commands narrow what gets compiled or checked; run/dispatch pick which agent or workflow to run. Don't conflate the two.
abt run
Run an agent: abt run -s AGENT -p TEXT. A bare name runs the agent plus its full subagents: tree. There is no partial-depth option. -s is required unless --auto is set. abt run never dispatches exposures or runs a workflow. Use abt dispatch -s <workflow> for that.
Task text and prompts/
-p / --prompt accepts literal Markdown/Jinja or a prompts/**/*.md key (stem / unique basename), expanded at compile time when it names a discovered prompt file. A literal renders {{ var() }} and Jinja control flow in a sandbox; env_var() is not available (see Jinja and template variables).
abt run -s my_agent -p "Summarize the attached notes" \
--context path/to/extra_context.txt \
--target dev \
--profiles-dir /path/to/dir
| Argument / flag | Meaning |
|---|---|
-s, --select |
Required unless --auto is set. The agent to run. Omitting it exits 2 with Missing -s/--select. |
-p, --prompt |
User message: literal text or a prompts/**/*.md key. |
--auto |
Natural-language task; full compile, routing LLM, then run the chosen agent. Same text = literal user message. Mutually exclusive with -s/--select. Not with --dry-run. |
--yes, -y |
Auto-approve every in-shell tool-call confirmation for this run, and (with --auto) skip the routing confirmation prompt too. |
--project-root |
Directory containing abt.yaml (default: .). |
--context |
Optional path to a text file merged in as extra thread context. |
--image |
Path to a local image or PDF file, attached to the prompt as multimodal content (repeatable: --image a.png --image b.pdf). PNG, JPEG, GIF, WebP, or PDF, 5MB max each. |
--target |
Override the named output under profiles.yaml for the active profile. |
--profiles-dir |
Directory that must contain profiles.yaml. When given, only that directory is searched; if it has no profiles.yaml the command exits 2 with No profiles.yaml found in --profiles-dir (see the search order in Configuration). |
--mock-sources |
YAML/JSON dict of per-source mock payloads (e.g. '{slack_thread: "stub body"}'). Only named sources are stubbed. |
--mock-source |
Stub one source's payload, NAME=VALUE (repeatable). Merges with --mock-sources (this wins on overlap). |
--debug / --no-debug |
Also show debug-level Python logs in stderr (default: flags.debug / ABT_DEBUG). |
-fr, --final-response |
Print only the final agent response (and errors) in the terminal for this invocation. |
--show-llm-output |
Print LLM response text in terminal (on by default; use --no-show-llm-output to disable). |
--workspace |
Override workspace base directory (also AGENT_WORKSPACE_DIR; see Configuration). Ignored when --stateless is set. |
--stateless |
Auto temp scratch workspace; project target/ untouched; removed on exit. Overrides --workspace. See Stateless runs. |
--artifact-dir |
Copy run_results/<run_id>/ into this directory before stateless scratch cleanup. Requires --stateless. |
--vars |
YAML/JSON dict of template variables for {{ var('name') }} in agents, prompts, and context. Merged over vars: in abt.yaml; CLI wins on duplicate keys. Same flag exists on compile, test, and docs generate. |
--lazy / --no-lazy |
Skip rewriting target/context/ when it already exists (faster; may be stale). Same on compile, test, docs generate. See Configuration. |
--dry-run |
After bootstrap, print a run plan (agent closure, execution order, guardrail summary) and exit 0 without invoking the model — ends with No LLM calls or test execution performed. Not available together with --auto. |
--fail-on-handler-error / --no-fail-on-handler-error |
Escalate the first failed lifecycle handler to a run failure. Overrides ABT_HANDLERS_FAIL_FAST and config.handlers.fail_fast in abt.yaml. |
--manifest |
Path to a precompiled manifest.json (see Manifest-only run). Skips discovery + compile. The project checkout is still required. |
--live / --no-live |
Pass through to the compile step. --live starts MCP servers and fails on a failed external-context or remote-skill fetch, so it can call external services. No-op with --manifest. See Live compile. |
--no-partial-parse |
Bypass the partial_parse.msgpack cache for this invocation. No-op with --manifest. |
--checkpoint-backend |
Select the checkpoint backend: memory (default), sqlite, bedrock_agentcore, dynamodb, or a plugin name. Overrides ABT_CHECKPOINT_BACKEND and abt.yaml. |
--thread-id |
Explicit thread identifier for the checkpoint backend. Overrides source-derived and YAML values. |
--ephemeral |
Force the memory (in-process) backend for this invocation, regardless of other config. |
--quiet, --no-progress |
Suppress progress reporter lines on stderr. See Progress flags. |
Sources, retrievers, transformers, and exposures only fire on abt dispatch -s <workflow> — see that command's --help for --skip-sources, --skip-retrievers, --skip-transformers, --skip-exposures, --mock-sources, and --expose.
Guardrails (timeouts, token budgets) are config-only — see Config precedence and abt config show --agent NAME.
Exit code is non-zero if the run fails.
When runs execute, logs and result artifacts are written under the workspace base:
<workspace>/logs/abt.log<workspace>/target/run_results/<run_id>/run.log<workspace>/target/run_results/<run_id>/run_results.json<workspace>/target/run_results/<run_id>/dag_summary.json(token rollup / agent order for the run; see Configuration — Workspace path)
By default, abt run streams LLM response text to terminal. Use --final-response or --no-show-llm-output to suppress streaming terminal LLM output while keeping it in workspace artifacts (run.log, run_results.json, and dag_summary.json).
Examples:
abt run -s hello -p "What can you do?"
abt run --auto "…"
abt run -s supervisor -p "checkout is failing for all users" # supervisor + its subagents: tree
abt run -s assistant -p basic_task # resolves prompts/basic_task.md
abt dispatch
Run a workflow: abt dispatch -s WORKFLOW. Runs that workflow's full topology (from workflows/) — sources are fetched, each node runs in order, then exposures are dispatched on success. Given an agent name instead of a workflow name, it errors rather than guessing:
abt dispatch -s triage
# ERROR: 'triage' is an agent, not a workflow. abt dispatch only accepts workflow names — use abt run -s triage to run it.
abt dispatch -s support_ticket --project-root .
abt dispatch -s support_ticket --vars '{"channel_id":"C…","thread_ts":"…"}'
abt graph support_ticket # topology, no model calls
abt dispatch -s support_ticket --skip-exposures # run the workflow but skip delivery
abt dispatch -s support_ticket --expose local:/tmp/out.md # one-off exposure, no YAML needed
abt dispatch -s support_ticket --expose confluence:123456789
abt dispatch -s support_ticket -p 'ticket #123'
| Argument / flag | Default | Meaning |
|---|---|---|
-s, --select |
Required | The workflow to dispatch (from workflows/). Omitting it exits 2 with Missing -s/--select WORKFLOW. |
-p, --prompt |
— | Override the first compiled prompt for this run only. The value is literal text. Unlike abt run -p, it does not resolve a prompts/*.md stem. Wire the prompt into the workflow as a node instead. |
--project-root |
. |
Directory containing abt.yaml. |
--vars |
— | YAML/JSON dict of template variables for {{ var('name') }} in the agent, sources, and exposures. Merged over vars: in abt.yaml; CLI wins on duplicate keys. |
--context |
— | Path to a text file merged in as extra thread context. |
--target |
from abt.yaml |
Profile target (overrides the active profile's target:). |
--profiles-dir |
default search path | Directory containing profiles.yaml. Exclusive: when given, no other location is searched, and a directory without profiles.yaml is an error. |
--workspace |
project root | Override workspace base directory. Ignored when --stateless is set. |
--stateless |
off | Auto temp scratch workspace; project target/ untouched; removed on exit. Overrides --workspace. See Stateless runs. |
--artifact-dir |
— | Copy run artifacts before scratch cleanup. Requires --stateless. |
--skip-sources |
off | Skip source fetching; source nodes yield an empty payload. |
--skip-exposures |
off | Run the agent but do not call any exposure dispatchers or lifecycle handlers (on_success / on_failure / on_start / on_end). |
--skip-transformers |
off | Skip post-agent transformers for this invocation. |
--skip-retrievers |
off | Skip retriever enrichment on the final agent turn. |
--mock-sources |
— | YAML/JSON dict mapping source name → mock payload text (e.g. '{slack_thread: "stub", pagerduty: "other"}'). Only named sources are stubbed. |
--mock-source |
— | Stub one source's payload, NAME=VALUE (repeatable). Merges with --mock-sources (this wins on overlap). |
--expose |
— | Ad-hoc one-off exposure instead of (or in addition to) catalog YAML. Format: type:value. Supported shorthands: slack:CHANNEL_ID, jira:ISSUE_KEY, confluence:PAGE_ID, local:/path/to/file, webhook:https://… (no built-in dispatcher; your project must register one). |
--exposure-plan |
off | Run for real, but record agent-grain exposures instead of firing them; prints the node → exposure plan. Not static analysis: conditional edges genuinely decide, only dispatch is swapped for a recorder. |
--debug / --no-debug |
off / flags.debug |
Show debug-level Python logs. |
--lazy / --no-lazy |
— / flags.lazy_context |
Skip rewriting target/context/ when it already exists (faster; may be stale). Same on run, compile, test, docs generate. |
-fr, --final-response |
off | Print only the final agent response (and errors). |
--show-llm-output / --no-show-llm-output |
on | Print LLM response text in terminal. Use --no-show-llm-output (or --final-response) to suppress it while keeping it in workspace artifacts. |
--manifest |
— | Path to a precompiled manifest.json (see Manifest-only run). Skips discovery + compile. |
--live / --no-live |
off | Pass through to the compile step. --live starts MCP servers and fails on a failed external-context or remote-skill fetch, so it can call external services. No-op with --manifest. See Live compile. |
--no-partial-parse |
off | Bypass the partial_parse.msgpack cache for this invocation. No-op with --manifest. |
--checkpoint-backend |
memory |
Select the checkpoint backend: memory, sqlite, bedrock_agentcore, dynamodb, or a plugin name. Overrides ABT_CHECKPOINT_BACKEND and agent frontmatter. |
--thread-id |
— | Explicit thread identifier. Overrides source-derived and YAML values. |
--ephemeral |
off | Force the memory backend for this invocation regardless of other config. |
--bypass-approvals |
— | Short-circuit external approvals for this run: approve auto-approves all gated tool calls, deny auto-denies. Takes precedence over project/agent approvals.bypass and ABT_BYPASS_APPROVALS. Emits a loud WARNING banner. See External approvals. |
--approval-thread-id |
checkpoint thread id | Stable thread identity for external-approval tracking (independent of the checkpoint thread id). Use --thread-id to share both. |
--quiet, --no-progress |
off | Suppress progress reporter lines on stderr. |
Ad-hoc --expose shortcuts
--expose type:value bypasses the exposure catalog and calls the type's dispatcher directly without a YAML file. Every shorthand below has a built-in dispatcher except webhook, which needs one you register:
| Shorthand | Equivalent config |
|---|---|
--expose slack:C01234567 |
type: slack, channel_id: C01234567 |
--expose slack:C01234567:1234567890.123 |
type: slack, channel_id: C01234567, thread_ts: 1234567890.123 |
--expose jira:DATA-42 |
type: jira, issue_key: DATA-42 |
--expose confluence:123456789 |
type: confluence, page_id: 123456789 (Mode A — existing page by ID) |
--expose local:/tmp/out.md |
type: local, path: /tmp/out.md |
--expose webhook:https://hook.example/ep |
type: webhook, url: https://hook.example/ep (needs a dispatcher you register) |
For the Confluence Mode B (upsert by title / parent path), define a catalog YAML file under exposures/ and wire it into a workflow as an exposure sink node. The ad-hoc shorthand supports only Mode A (update by page ID).
See Exposures for the full config reference for each dispatcher type.
abt test
Run YAML test suites (LLM-as-judge). -s/--select takes a bare agent name (same syntax as abt compile -s), not the run/dispatch selection model. --only-agent is a narrower selector that limits the run to one agent's suite. It does not strip subagents: wiring: an agent's full subagents: tree is always wired. --only-agent cannot be combined with -s or with -n/--name, but -s and -n can be combined. Omit all three to run all suites. A -n that matches no test case exits 2 with no test named 'X' matched, so a typo in a CI gate fails instead of passing. --dry-run lists the cases without checking -n, so it exits 0 even for a missing name. See Testing and build.
abt test -s hello --project-root . --target dev --profiles-dir ~/.abt
abt test --only-agent my_agent --project-root .
abt test --fail-fast --project-root .
| Argument / flag | Meaning |
|---|---|
--only-agent |
Optional. Run tests only for that one named agent's own suite; compile still wires the full subagents: closure. Mutually exclusive with -s and -n. |
-s, --select |
Optional. If omitted (and no --only-agent), runs tests for all agents that have suites; otherwise restricts to the named agent's own suite (bare name only — no +/N+ modifiers). Must resolve to an agent that exists in the manifest. With no matching suites, the command succeeds and does nothing. |
-n, --name |
Optional. Run only the test case with the given name: across the selected suites. Mutually exclusive with --only-agent. Exits 2 when no case has that name. |
--project-root |
Project root with abt.yaml. |
--target |
Profile target for loading models and judge. |
--profiles-dir |
Directory that must contain profiles.yaml (exclusive; see Configuration). |
--workspace |
Override workspace directory (same as abt run). |
--fail-fast |
Stop after the first failed test case. |
-fr, --final-response |
Print only the final agent response (and errors) in the terminal for this invocation. |
--dry-run |
After bootstrap, print which suites and cases would run (assertion types, prompt previews) and exit 0 without invoking judges or agents. |
--vars |
YAML/JSON dict of template variables for {{ var('name') }} in the agents/prompts under test. Merged over vars: in abt.yaml; CLI wins on duplicate keys. Same flag exists on run, compile, dispatch, docs generate. |
--lazy / --no-lazy |
Skip rewriting target/context/ when it already exists (faster; may be stale). Same on run, compile, dispatch, docs generate. |
--live / --no-live |
Pass through to the compile step (start MCP servers; fail on a failed context or remote-skill fetch). See Live compile. |
--no-partial-parse |
Bypass the partial_parse.msgpack cache for this invocation. |
--quiet, --no-progress |
Suppress progress lines on stderr. |
--debug / --no-debug |
Show debug-level Python logs in stderr (default: flags.debug / ABT_DEBUG). |
Live progress
On a TTY, abt test renders a stderr progress table (Rich spinners + elapsed time + pass/fail badge per case), mirroring the abt run experience. The table is automatically suppressed under --debug, --final-response, --quiet, --no-progress, non-TTY stderr, or NO_COLOR.
Case parallelism
Test cases run in parallel up to the global abt --threads N budget (env: ABT_THREADS, default 4). Override just abt test via ABT_TEST_MAX_CONCURRENCY=N (still clamped to the global budget). --fail-fast stops scheduling new cases after the first failure — already in-flight cases finish to avoid orphaning LLM requests. Results order is deterministic (suite order × case order in YAML) regardless of completion order.
Use abt --threads 1 test … (or ABT_TEST_MAX_CONCURRENCY=1) to restore fully-serial execution.
abt bench
Run benchmarks/*.yaml with and without your changes, then compare quality and tokens. See Benchmarks.
| Flag | Meaning |
|---|---|
-s, --select |
Benchmark name (the file name under benchmarks/). Omit to run all. |
-n, --name |
Run only the case with this exact name:. Combine with -s or omit it to search every benchmark. |
--against REF |
Compare with this git ref. Default: merge-base with the default branch. |
--no-baseline |
Just score your changes; don't compare. Can't be combined with the --fail-on-* gates. |
--runs N |
Runs per case and side (default 1); more runs steady the result. |
--fail-on-regression |
Exit 1 when quality is clearly worse than the baseline. |
--fail-on-quality-drop POINTS |
Exit 1 unless the results confirm quality dropped by less than POINTS points of pass rate. |
--fail-on-token-increase PCT |
Exit 1 when tokens for a typical case clearly grew by more than PCT% (not the total). |
--changed-only |
Skip benchmarks whose workflow and benchmark file are unchanged from the baseline. Needs a baseline. |
--output-md PATH |
Also write a content-free Markdown summary. |
--export PATH |
Write the cases as JSONL dataset rows (id, input, expected, metadata) instead of running. |
--vars |
Template vars for both sides. |
All benchmarks run at once (one side, then the other) in one pool of abt --threads N (env: ABT_THREADS, default 4); ABT_BENCH_MAX_CONCURRENCY=N lowers it for abt bench only.
abt compile
Validate agent discovery and dependency graph without running models:
abt compile --project-root .
abt compile --project-root . --vars '{region: eu-west-1}'
Successful output is a short summary (agent count, manifest.json path, and target/compiled/<project_name>/ with per-resource compiled bodies); individual agents are not enumerated, so large projects stay readable. --no-manifest skips both manifest.json and target/compiled/ (validate only).
target/compiled/<project_name>/agents/<agent>.md holds the system prompt variant the agent runs with: context content is inlined, except for an agent that delegates with file tools, where large context.*() content stays a /workspace/context/... file pointer. Agent and prompt bodies have <!-- ... --> comments removed before rendering (fenced code blocks and inline code keep theirs), so a note to maintainers never reaches the model.
Show the model request
--show-request AGENT compiles, then prints what the agent sends on its first model call, assembled by the same code path as abt run with a recording model, so no model call or credential is needed:
abt compile --project-root . --show-request reviewer
The output lists the declared middleware with the layer each entry came from (agent frontmatter, entry agent, abt.yaml, or default for entries abt adds, such as run caps), the runtime middleware stack, each system block with its token estimate, every tool schema (filesystem tools, task, the output-schema tool, skills), and the first user turn (<your prompt> plus any few-shot messages). Delegates are built as in a real run, so the task tool lists the subagents. The estimate uses tiktoken, which differs from the provider's tokenizer by a few percent.
Deep Agents appends its own prompt suffix for some exact model strings. See model_id; --show-request shows whether it applies to your model.
When the real model cannot be built (for example, missing credentials), --show-request identifies the model from the provider: prefix of model_id.
When ABT_STATELESS=1 or flags.stateless: true is set, compile writes to a temp scratch workspace (same lifecycle as abt run --stateless) so the project target/ is not modified.
Performance flags:
| Flag | Meaning |
|---|---|
--live / --no-live |
Start MCP servers at compile time, fail on a failed external-context or remote-skill fetch, and fail on an unset env_var() in mcps/*.json that a default compile only warns about (see Live compile). |
--stateless / --no-stateless |
Compile into an auto temp workspace; the project target/ is untouched. |
--vars |
Template variables, merged over vars: in abt.yaml. |
--debug / --no-debug |
Show debug-level logs. |
--no-manifest |
Validate only: skip writing manifest.json and target/compiled/. |
--show-request AGENT |
After compiling, print the model request AGENT sends. See Show the model request. |
--lazy / --no-lazy |
Skip rewriting target/context/ when it already exists. |
--no-partial-parse |
Skip the partial_parse.msgpack cache (always recompute — see Partial parse cache). |
--quiet, --no-progress |
Suppress the compile reporter step lines. See Progress flags. |
Selective compile (-s / --select)
abt compile -s (and abt test / abt doctor's -s, when set) is its own selection system, separate from the -s of abt run and abt dispatch. It narrows what gets compiled, not what gets run. Optional -s takes a bare agent name only. A name always means that agent plus its full subagents: delegation closure. -s has no isolation mode. manifest.json still lists every agent. Only agents in that closure get full prompts (compiled: true); the others keep their raw source with an empty system_prompt. Only the closure's referenced context is resolved (local files plus Confluence/S3 fetches); unrelated context is skipped for that compile.
A full compile (no -s) includes every agent, source, retriever, transformer, and exposure on disk. This is the same idea as dbt compile --select: validate a slice of the project without paying for every node's compilation.
-p/--prompt never narrows compile scope — only -s/--select (or, on abt test, --only-agent) decides which agents are compiled. On abt run -s, if -p/--prompt matches a prompts/*.md stem, that template's context is resolved too (so its body can expand {{ context.*() }} at runtime); literal user messages add no extra context. abt compile itself has no -p/--prompt flag.
abt compile -s assistant
abt compile -s supervisor
abt test and abt doctor (when -s is set) use the same selective compilation path under the hood, so external context for agents you are not running is not downloaded. abt run/abt dispatch always compile the agent's full closure — they don't take a -s selector.
Useful logging flags:
--debugto show debug-level logs.-
--final-response(-fr) to print only the final agent response (and errors) in the terminal. -
Fails on duplicate agent names and delegation cycles.
- Useful for CI and pre-commit validation.
abt chat
Interactive debug REPL for one workflow: it compiles once, then runs a fresh turn on every Enter. Sources are mocked by default. Exposures and lifecycle handlers are always skipped, so a chat session never delivers anything.
abt chat support_ticket --project-root .
abt chat support_ticket --thread-id my-debug-session
| Argument / flag | Default | Meaning |
|---|---|---|
WORKFLOW |
Positional, required | The workflow to chat with (from workflows/). |
--project-root |
. |
Directory containing abt.yaml. |
--target |
— (reads ABT_TARGET) |
Named target under the active profile. |
--profiles-dir |
default search path | Directory containing profiles.yaml. |
--workspace |
project root | Workspace base; runtime writes under <workspace>/target/. |
--checkpoint-backend |
sqlite (memory with --ephemeral) |
Checkpoint backend for the session: memory, sqlite, bedrock_agentcore, dynamodb, or a plugin name. Overrides ABT_CHECKPOINT_BACKEND, config.checkpoint and the entry agent's checkpoint:. Other commands default to memory. |
--thread-id |
random 8-character id | Conversation thread id. Reusing one resumes its checkpointed state; using it for a different workflow is an error (E_CHAT_THREAD_MISMATCH). |
--ephemeral |
off | Force the memory backend: nothing persists after /exit. |
--mock-sources |
— | YAML/JSON dict mapping source name to mock payload. Only named sources are stubbed. |
--mock-source |
— | Stub one source's payload, NAME=VALUE (repeatable). Merges with --mock-sources. |
The slash commands, the rule for typed input, and pinned sources are in the abt chat guide.
Approval-gated workflows hang
A turn that reaches a human-approval gate in abt chat never completes. Use abt dispatch for such workflows. See the guide.
See Sources and Checkpointing for thread id resolution and backend selection.
abt docs generate
Generate the HTML agent catalog (agents, tools, subagents, context, MCP overview).
abt docs generate \
--project-root . \
--out target/docs/index.html \
--target dev \
--profiles-dir ~/.abt
| Flag | Meaning |
|---|---|
--project-root |
Project root with abt.yaml. |
--out |
Output path for index.html (default: <workspace>/target/docs/index.html). |
--target |
Profile target for generation (e.g. docs that need resolved config). |
--profiles-dir |
Where to find profiles.yaml. |
--stateless / --no-stateless |
Compile into an auto temp workspace; the project target/ is untouched. |
--lazy / --no-lazy |
Skip rewriting target/context/ when it already exists. |
--live / --no-live |
Start MCP servers and fail on a failed external-context or remote-skill fetch, so it can call external services. Off by default. See Live compile. |
--no-partial-parse |
Bypass the partial_parse.msgpack cache. |
--debug / --no-debug |
Show debug-level logs. |
--vars |
Template variables, merged over vars: in abt.yaml. |
-q / --quiet |
Print nothing on success. By default the command prints the index.html path and the manifest path. |
The command passes an explicit project root into docs generation so tools/*.py is only imported for the Python tools catalog when that root is known (see Advanced: manifest and compile). To build the catalog without executing tool modules, set ABT_DOCS_SKIP_PYTHON_TOOLS=1 (Environment variables).
The page embeds the project's agent prompts, skill content, context previews and tool source code (ABT_DOCS_OMIT_TOOL_SOURCE_CODE=1 leaves the source out), so share it only with people who may read those. File paths in it are project-relative; code installed outside the project (built-in handlers) shows its module path instead (abt/core/handlers/builtins.py).
The generated site has six tabs. Overview opens first. Lineage holds the dataflow graph and each agent's details. Catalog lists agents and workflows. Resources holds skills and contexts. Integrations holds MCP servers, Python tools and middleware. Lifecycle holds handlers.
The Lineage tab is a single interactive dataflow graph: agent nodes wired by each workflow's own edges (including source/prompt/exposure workflow nodes — always shown for a prompt node, behind the Sources/Exposures layer checkboxes for the others) plus subagents: delegation edges, with optional Context / MCP / Tools / Skills / Triggers / Approvals layer checkboxes. Clicking a source/prompt/exposure node opens its own detail panel (type/credentials, or a prompt's content preview and whether it's static text or {{ var(...) }}/{{ upstream(...) }}-templated). For a workflow's full order and branching in one linear view, use abt graph <workflow_name> (see Workflows). These controls are browser-only; agent selection for execution uses abt run -s <agent>, workflow execution uses abt dispatch -s <workflow>; abt docs generate has no agent-selection flag.
The graph shows one workflow at a time: the dropdown at the top left of the tab shows which, and opening it lists every workflow (scroll, or type to narrow the list, then press Enter or click). See Lineage search syntax for the Lineage tab's search box.
abt docs serve
Serve the generated catalog as static HTML plus a chat API on the same origin. This is an ASGI app (Starlette + uvicorn, requires the abt-core[serve] extra) — not a plain SimpleHTTPRequestHandler.
abt docs serve --project-root . --port 8080
| Flag | Default | Meaning |
|---|---|---|
--project-root |
. |
Project root with abt.yaml. |
--host |
127.0.0.1 |
Bind address. Use 127.0.0.1 for local-only; 0.0.0.0 in containers/Kubernetes (prints a warning, see below). |
--port |
8080 |
TCP port (1–65535). |
--target, --profiles-dir |
— | Same meaning as other commands. |
Requires abt docs generate first so target/docs/index.html exists. serve never regenerates it: the page's top bar shows the abt version and UI build it was generated by, and serve warns at startup when that build differs from the installed abt (after an upgrade, or a UI change in a source checkout) — re-run abt docs generate to refresh it. The site is served at /; GET /index.html returns 404. The page bundles its JavaScript and fonts, so the browser needs no internet access (the chat still needs the server and a model).
State-changing /api/* requests (POST/PUT/PATCH/DELETE) must send Content-Type: application/json and, when the browser sends an Origin, come from the same origin: its host must equal Host or, behind a reverse proxy that rewrites Host, the first X-Forwarded-Host value. Other requests get 415/403.
While bound to a loopback address, every request must also carry a Host of localhost, 127.0.0.1, ::1 or the bind address, else it gets 403. This stops DNS rebinding, where a web page's own hostname is pointed at 127.0.0.1 so the browser lets it read the chat API. A reverse proxy in front of a loopback bind must therefore forward a loopback Host.
Every response carries a Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer and Cache-Control: no-store (the page embeds your prompts and tool source, so shared proxies must not keep a copy). Other sites cannot frame the page (no clickjacking of the tool-approval buttons). The page itself may load only what it ships with: no remote scripts, styles, fonts or images (data: and same-origin images only), and requests only to its own origin. The same policy (minus frame-ancestors, which browsers ignore there) sits in a <meta> tag of index.html, so a shared file is confined too. Markdown in prompts that points to a remote image will not render it.
The chat API has no authentication and can run the project's agents and tools. Each chat message runs an agent through the project's profile, so it makes model calls. Binding beyond loopback (--host 0.0.0.0) prints a warning and skips the Host check, since the public hostname is unknown; expose it only on a trusted network or behind an authenticating proxy.
Project documentation (MkDocs)
This static site (MkDocs Material) lives under docs/ and builds to site/. Use mkdocs serve or mkdocs build from the repository root after uv sync --group docs.
Terminal output
Color is used when the stream is a TTY and NO_COLOR is unset. abt run uses Rich for a per-agent progress table on stderr; it is skipped when stderr is not a terminal or NO_COLOR is set.
See also
- Advanced CLI reference —
create/modify,watch,approvals,deps,discover,lint,config,debug,doctor,list,clean - Performance tuning — caching,
--threads,--manifest,--live, secrets redaction - Quickstart
- Selectors (
-s/--selectbare-name reference forcompile/test/doctor) - Workflows (
workflows/,abt graph) - Configuration
- Testing
- Environment variables