---
title: "CLI reference"
description: "The division of roles across the three binaries (aachat / chat / aachat-mcp), and the facts about every aachat command, its main flags, and output formats. Ground command guidance in this page."
---

# CLI reference

The aachat CLI splits its roles across three binaries. Which binary to point to is determined by where the user (or agent) is.

| Binary | Where it is used | Role |
|---|---|---|
| `aachat` | Local terminal, connected repo | Humans and external agents (Cursor / Claude Code, etc.) operate teams, agents, projects, and sessions |
| `chat` | Inside a session started by `aachat up` | For agents inside a session only. Not used outside a session |
| `aachat-mcp` | Auto-connected to `aachat up` sessions | MCP server. Provides only 3 tools for reading Concept reviews, posting reviews, and proposing removals |

## Output format

The 11 public command roots `init`, `auth`, `publish`, `up`, `env`, `support`, `manage-agent`, `doc`, `skills`, `doctor`, and `update` use human-oriented text; some are interactive. Other public command results use a single JSON envelope on stdout, such as `{"ok": true, "data": ...}` or `{"ok": false, "error": ...}`. Success-output exceptions are `aachat skill publish`, `skill sync`, `skill unpublish`, and `skill install`, which write human-readable confirmation lines. Read `next_actions` when present. There is no `--json` switch. Help/version output is text.

For automation, parse stdout separately from stderr diagnostics and check both the exit status and returned content. A JSON command failure exits nonzero (1); human-text errors use stderr and a nonzero status. A successful command exit does not turn a failed/skipped diagnostic into a healthy result: read each `doctor` check and the `status` fields.

## Authentication, diagnostics, updates

```bash
aachat auth login     # Issue and cache a short-lived JWT from the local gh token (~/aachat/.run/tokens/user.jwt)
aachat auth status    # Check sign-in state
aachat auth logout    # Delete stored credentials
aachat doctor         # Environment health diagnostics (human-oriented text)
aachat status         # Check repo connection, auth, daemon, mirror, docs, and Launch Report as JSON
aachat update         # Update aachat itself
```

If `gh` is authenticated, `auth login` completes non-interactively (trust-boundary.md).

## Runtime

```bash
aachat up [--if-stopped]   # Start the resident runtime; leave an existing runtime alone with --if-stopped
aachat support        # Interactive support
aachat manage-agent   # Interactive agent management (search / clone / customize / add skills)
```

`aachat up` owns the resident runtime. Startup can check for an update and re-exec an installed managed binary; this is not a periodic update guarantee while resident. Plain `up` restarts an existing runtime, while `up --if-stopped` exits successfully without replacing one already running. Check active work before a restart, and inspect the Launch Report afterward ([Environment](/en/docs/environment), [Desktop](/en/docs/desktop)).

## Repo connection

```bash
aachat init [--team <slug>]   # Connect the current git repo to a team
```

Writes go only to files inside that repo and the local record in `~/aachat/.state/repo-connections/`. Writes to paths outside the repo and writes through symlinks are rejected. Details in [Connected Repo](/en/docs/connected-repo).

## team

```bash
aachat team create <slug> [--repo <owner/repo>] # Create a team. --repo optionally sets its default workspace repo
aachat team update <slug> --stdin               # Update explicit settings from one JSON object
aachat team join <token>                        # Join with an invitation token
aachat team list                                # List teams you belong to
aachat team show <slug>                         # Team details
```

## agent

The values accepted by `--runtime` are `claude-acp` and `codex-acp`.

```bash
aachat agent list [--mine]                      # List (--mine for yours only)
aachat agent show <agent>                       # Details of your agent (includes session info)
aachat agent create <name> [--repo <owner/repo>] [--description <text>] [--runtime claude-acp|codex-acp]
aachat agent ensure <name> [--repo <owner/repo>] [--description <text>] [--runtime claude-acp|codex-acp]
aachat agent ensure <name> --source <owner/repo>
aachat agent update <name> [--repo <owner/repo>] [--dormant | --no-dormant] [--runtime claude-acp|codex-acp]
aachat agent delete <name> --yes
aachat agent search [query] [--sort popular|recent|stars] [--limit N]   # Search public agents on Discover
aachat agent show-public <owner/repo>           # Details of a public agent
aachat agent clone <owner/repo> [--name <name>] # Copy a public agent into your account
```

## Environment and catalog publication and installation

```bash
aachat env
aachat env list [--all]
aachat env approve <agent> <name>
aachat env revoke <agent> <name>
aachat publish <agent> [--go-public]
aachat skill publish .agents/skills/<skill-name> --agent <name> [--go-public]
aachat skill sync <catalog-uuid>
aachat skill unpublish <catalog-uuid>
aachat skill install <catalog-uuid> --agent <name>
```

`env` manages local name-specific approval, not secret values on the server; revoke does not delete the provider value ([Environment](/en/docs/environment)).

`publish` prepares or registers the Agent's reviewed publication repository. Use `skill publish` in a separate Skill publication repository to register only the selected Skill; the source Agent does not need to be public. For both commands, `--go-public` explicitly changes an already-prepared private repository's visibility. `skill sync` reads the public GitHub commit into the catalog, and `skill unpublish` stops a standalone Skill's listing. These management commands do not change GitHub files or visibility ([Discover](/en/docs/discover)).

`skill install` records catalog installation after the target Agent's repository change has been committed and pushed. It does not install the files; `skills add` adds local skill files and `skill feedback` records Ledger feedback ([Skills](/en/docs/skills)).

`agent ensure` returns an existing Agent unchanged. For a missing Agent, use either `--source` to clone or the repo/description/runtime creation options; source conflicts with those options.

## project

**`project read` / `project send` are the input/output of the timeline.** The timeline returns messages, Shared Documents activity, and session activity interleaved in oldest-first order.

```bash
aachat project list [--status planning|active|completed|archived|all] [--team <team>]
aachat project create <name> --lead <member> --stdin [--parent <parent>] [--description <text>] [--team <team>]    # Name is [a-z0-9-], 2-30 characters
aachat project ensure <name> --lead <member> --stdin [--description <text>] [--team <team>]
aachat project update <name> [--description <text>] [--status planning|active|completed|archived] [--cancel-runs] [--team <team>]
aachat project update <name> --lead <member> [--team <team>]
aachat project reparent <child> --parent <parent> --stdin [--team <team>]
aachat project delegations <parent> [--team <team>]
aachat project delete <name> --yes [--team <team>]
aachat project show <name> [--team <team>]
aachat project members <name> [--team <team>]   # Also returns agents' running sessions and capabilities. Use before making requests
aachat project join <name> [--team <team>]
aachat project read <project> [--last N] [--before <cursor>] [--team <team>]
aachat project send <project> (<msg> | --stdin) [--reply-to <seq>] [--via <label>] [--type <type>] [--attach <path>]... [--team <team>]
aachat project edit <project> <seq> (<text> | --stdin) [--team <team>]
aachat project unsend <project> <seq> [--team <team>]
aachat project post-type update <project> <seq> --type <type> [--team <team>]
aachat project assign <project> --agent <name> [--team <team>]
aachat project unassign <project> --agent <name> [--team <team>]
aachat project document <project> [--team <team>]   # Shared Documents and canonical paths
aachat project media <project> [--query <text>] [--limit N] [--before <cursor>] [--team <team>]
aachat project html <project> [--team <team>]
aachat project database <project> [--team <team>]   # Read the schema catalog. Mutate with chat db
```

`create` requires a Lead and a Brief from stdin. The description is an optional catalog note, not a replacement for the Brief. For example, write the goal, background, expected deliverables, and constraints in `brief.md`, then run `aachat project create first-project --lead @<owned-agent> --stdin < brief.md` (replace `<owned-agent>` with the actual name of an agent you own). Names `stream`, `dm`, and `repo` are reserved. An agent Lead receives a setup Session; a human Lead receives a notification. For an agent Lead, check the accepted Session, answer any Asks, review PROJECT.md and REPORT.md after setup completes, then request the next work. A human Lead uses the notification to review the Project and Brief and begin the work. See [Projects](/en/docs/projects) for parent and ownership conditions and the REPORT required at completion.

### Ensure a Project without duplicating the setup request

Both `create` and `ensure` require `--lead` and `--stdin`. `create` creates a new Project; `ensure` returns an existing one unchanged, with `created: false`, rather than replacing its Brief or Lead. The flags are still required for parsing when it exists.

```bash
cat > brief.md <<'BRIEF'
Purpose: Prepare a bilingual customer guide.
Background: Readers need to complete their first task without missing prerequisites.
Expected result: A guide draft and a record of the examples checked.
Constraints: Use current supported features; do not publish yet.
BRIEF
aachat project ensure first-guide --lead @<active-team-member> --team <team> --stdin < brief.md
aachat project show first-guide --team <team>
```

Replace `<active-team-member>` and `<team>` with real values. `ensure` can create a missing Project only with an active Team member as Lead. Inspect `created` before sending work again; this command does not return the accepted Lead action. If it created the Project, use `project show` and the Project timeline to inspect current state. For an existing Project, read its current purpose and members before making a separate request. Lead changes, child REPORT reads, and full reparent Brief steps are in [Projects](/en/docs/projects).

### Archive a Project

As a Project Admin, check the target Team and Project before running the command. Send Archive separately from other settings changes.

```bash
aachat project update <name> --status archived --team <team>
```

In an interactive terminal, read the Run cancellation counts, Sessions to stop, and blockers before answering the confirmation. In non-interactive use, `--cancel-runs` is required when unfinished Runs exist, as explicit consent to cancel them. Do not add it as a general workaround for errors; first check [Projects](/en/docs/projects). A non-interactive request without unfinished Runs may be accepted without this flag.

A returned `archive_in_progress` means the operation was accepted, not completed. Completion is distinguished by `archived` and `operation.completed_at`. If an operation already exists, running the same command again returns its state. To resume a failed operation, use **Retry** in the WebUI ([recovery steps](/en/docs/troubleshooting)).

Check `aachat --version` and `aachat project update --help` for the CLI you use. If the help does not list `--cancel-runs`, do not use the flag with that version; check the help after updating, or use a WebUI that provides the Archive confirmation. Do not copy this flag into the agent-only `chat project update` command.

## ask

Read, answer, or cancel existing Project Asks. Session agents create and wait with `chat ask`. Outside agents ask the human in this conversation with their host ask. **An Ask is immutable, and answers accumulate as revisions.** `show` returns all answer revisions.

```bash
aachat ask list <project> [--status open|answered|cancelled|all] [--scope project|session] [--assignee <@user>] [--creator <@user> | --mine] [--limit N] [--before <cursor>] [--team <team>]
aachat ask show <project> <ask-id> [--team <team>]
aachat ask cancel <project> <ask-id> --reason <text> [--team <team>]
aachat ask answer <project> <ask-id> --expected-revision <N> (--answer <text> | --stdin) [--team <team>]
```

## Exploring context

```bash
aachat inbox [project] [--mark] [--last N] [--with-messages] [--message-limit N] [--team <team>]
aachat find [query] [--project <project>] [--by <name>] [--mentioning <name>] [--last N] [--before <cursor>] [--team <team>]
aachat mentions [project] [--last N] [--before <cursor>] [--team <team>]

# Connected-repo Team Registry (Team is resolved from the validated file path and repo connection)
aachat registry check <resource-file>
aachat registry plan <resource-file>
aachat registry submit <resource-file> [--reason <text>]
aachat registry refresh (<resource-file> | --all) [--discard-local]
```

- `find` requires a query or at least one of `--project` / `--by` / `--mentioning`. The scope is projects and DMs (Streams are excluded)
- `inbox --mark` marks the returned unread messages as read. inbox does not paginate; go back in time with `project read --before`
- Before reading company context, check the relevant Team projection in `aachat status`: a connected repo uses `daemon.workspace_mirror.team_projection`, while the common root uses the matching entry in `daemon.host_mirror.team_projections`. Its `state` must be `healthy`. Then read the two Registry indexes, `aachat/teams/<team>/concepts/_index.yaml` and `aachat/teams/<team>/entities/_index.yaml`, selected individual YAML, and matching bodies under `aachat/meetings/`. Saving individual YAML stages a local change; only `registry submit` calls the human Team API. Indexes and Meeting files are read-only generated snapshots

## session

```bash
aachat session list [--agent <name>] [--project <project>] [--team <team>] [--last N] [--before <cursor>]
aachat session run <agent> --project <project> [--repo <owner/repo>] [--runtime <claude-acp|codex-acp>] [--config <ID=id:VALUE|boolean:BOOL>]... [--attach <path>]... [<msg> | --stdin] [--team <team>]
aachat session send <session-id> --project <project> [--cancel-current-turn] [--attach <path>]... [<msg> | --stdin] [--team <team>]
aachat session show <session-id> --project <team/project>
chat session read <session-id> --project <project> [--last N] [--before <cursor>] [--decision | --submission <turn-id>] [--team <team>]
aachat session stop <session-id>    # Immediate termination. The running turn may be interrupted
aachat session logs <session-id> [--from-start | --after-offset N]
aachat session permission list <session-id> --project <project> [--team <team>]
aachat session permission respond <session-id> <request-id> --project <project> (--option-id <id> | --cancel) [--team <team>]
aachat session schedule create <session-id> --project <project> --at <RFC3339> [--every 60-86400] (<prompt> | --stdin) [--team <team>]
aachat session schedule list <session-id> --project <project> [--team <team>]
aachat session schedule cancel <session-id> <schedule-id> --project <project> [--team <team>]
aachat session compact <session-id> --project <project> [--request-id <uuid>] [--team <team>]
```

- `run` always starts a new session. The agent is resolved as a member of the project
- `session list` without `--project` is the Team Work Index: every readable project in the connected team, all lifecycles, including other members' sessions. `--project` narrows it to one project. Each session returns its affiliated `project` and `also_covers` only when there is extra coverage. `--last` defaults to 20 (max 100)
- `--repo` specifies the working repository. `--runtime` selects this Session's Runtime; omitting both Runtime and config can reuse saved interactive launch preferences; otherwise the default is resolved as described in [Agents](/en/docs/agents). Repeat `--config` for explicit typed Runtime settings, for example `--config mode=id:plan`
- `--attach` attaches images, videos, and PDFs to the session history. **They are not published to Project Media**
- `run` / `send` may be attachment-only, with no text
- `--cancel-current-turn` is a strong operation that discards the running turn and injects a new instruction. Use it only for changing direction or correcting a mistaken execution
- **`read` and `logs` form a pair**: `session read` reads the transcript stored on the server, `session logs` reads the local stderr log (`~/aachat/.run/logs/`). For where session records live, see [Trust Boundary](/en/docs/trust-boundary)
- `session read --decision` returns a bounded decision view. `--submission <turn-id>` tracks one accepted submission. The two flags are mutually exclusive
- `session schedule` creates, lists, or cancels a **scheduled follow-up** on an existing session. Fresh-Session / Workflow Triggers use WebUI or `chat trigger` ([Sessions](/en/docs/sessions))
- `session compact` queues compaction for a project-scoped session. It does not finish the session

## Document validation, skills, templates, reporting

```bash
aachat doc check <path>            # Validate a single projected shared document file (--hook reads the hook payload from stdin)
aachat skills add <skill-name> [--target <dir>]   # Add a local skill to the normal .agents/skills/ source. Not Skill Ledger feedback
aachat skill feedback <skill-name> (<feedback> | --stdin) [--location <text>] [--suggestion <text>] [--team <team>]   # Human feedback for an active Skill Ledger skill. Inside a session, use `chat skill feedback`
aachat concept publish <concept-id> --revision <revision-id> [--team <team>]
aachat concept decline <concept-id> --revision <revision-id> --reason <text> [--team <team>]
aachat meeting create <team> --title <text> --started-at <RFC3339> [--participant <name>]... --stdin [--client-nonce <uuid>]
aachat workflow create <project> <slug> --client-nonce <uuid> [--team <team>]
aachat workflow draft <project> <slug> [--team <team>]
aachat workflow validate <project> <slug> --source <dir> [--team <team>]
aachat workflow try <project> <slug> --source <dir> --expected-draft-version <N> --client-nonce <uuid> --stdin [--team <team>]
aachat workflow retry <project> <run-id> <step-key> --client-nonce <uuid> [--team <team>]
aachat workflow feedback <project> <run-id> <step-key> --stdin [--attempt-number <N>] [--team <team>]
aachat workflow attempts <project> <run-id> <step-key> [--last N] [--before <cursor>] [--team <team>]
aachat workflow attempt <project> <attempt-id> [--team <team>]
aachat workflow list <project> [--last N] [--before <cursor>] [--team <team>]
aachat workflow show <project> <slug> [--team <team>]
aachat workflow runs <project> <slug> [--last N] [--before <cursor>] [--team <team>]
aachat workflow run <project> <slug> --stdin [--client-nonce <uuid>] [--team <team>]
aachat workflow publish <project> <slug> [--source <dir>] [--team <team>]   # Publishes the selected local Draft
aachat workflow status <project> <run-id> [--team <team>]
aachat workflow cancel <project> <run-id> [--team <team>]

aachat trigger list <project> [--limit N] [--cursor <cursor>] [--team <team>]
aachat trigger show <project> <trigger-id> [--team <team>]
aachat trigger preview <project> --stdin [--team <team>]
aachat trigger create <project> --stdin [--team <team>]
aachat trigger update <project> <trigger-id> --stdin [--team <team>]
aachat trigger pause <project> <trigger-id> --state-version <N> [--team <team>]
aachat trigger resume <project> <trigger-id> --state-version <N> [--team <team>]
aachat trigger run <project> <trigger-id> --state-version <N> [--team <team>]
aachat trigger delete <project> <trigger-id> --state-version <N> --yes [--team <team>]
aachat trigger occurrences <project> <trigger-id> [--limit N] [--cursor <cursor>] [--team <team>]

aachat db schema <project> [--team <team>]
aachat db query <project> --stdin [--team <team>]
aachat db migrate <project> <db/migrations/id.sql> [--team <team>]
```

If `aachat meeting create` has an unknown outcome, the CLI keeps the exact stdin body in a private local retry file and returns a command that reuses that body and nonce. Run only that command; the retry file is removed after the receipt is confirmed.

Workflow Draft, Trigger, and Database mutations use the existing version, nonce, role, and source contracts. Inspect the current object and `available_actions` before a retry or state change. JSON request bodies for `team update`, Trigger preview/create/update, Workflow try input, feedback, and `db query` are read from stdin. Outside a connected repo, pass `--team` explicitly.

```bash
aachat template list [--mine] [--sort popular|recent|votes|comments] [--limit N] [--tag <tag>] [--kind <kind>]
aachat template search <query> [--limit N]
aachat template show <template>
aachat template install <template> --project <project> [--team <team>] [--force]
aachat template publish --slug <slug> --name <name> (--from-project <project> | --from-file <path>)
                        [--description <text>] [--description-ja <text>] [--description-en <text>]
                        [--tags a,b] [--team <team>]
aachat template update <template> [--name <text>] [--description <text>] [--tags a,b]
                        [--from-project <project> | --from-file <path>] [--team <team>]
aachat template unpublish <template>
```

```bash
aachat report ("message" | --stdin) [--level error|warning|info] [--context '{"key":"value"}']   # Default level is error
```

## Main flags

| Flag | Meaning |
|---|---|
| `--team <team>` | Explicitly specify the target team. When omitted, commands that operate directly on a project use the connected repo's team, while `inbox` / `find` / `mentions` cover all visible teams. Personal team slugs are in `~username` form, so quote them in shells, e.g. `--team '~kensaku'` |
| `--last N` / `--before <cursor>` | Count and backward paging. N ranges 1-100, and the default differs per command (`project read` 20 / `mentions` 5 / `session read` 50). For timeline/transcript reads, pass `next.before` to `--before` as-is; Workflow lists use `next_cursor`. Cursors are opaque ([pagination](/en/docs/limits)). In `inbox` and `find`, `--limit` is an alias for `--last` |
| `--via <label>` | Free-form label indicating which client the message was sent from (e.g. `cursor`, `claude-code`). Recorded with the send |
| `find --by` / `--mentioning` | Filter by sender or mention target. Specify agents in `<agent>.<owner>` form |

## chat — the CLI exclusively for agents inside sessions

`chat` is used only by agents inside sessions started by `aachat up`. Normal successful results are JSON on stdout. Argument parsing and command failures return a single JSON object on stderr and exit status 1; read `error` and any `hint` or `commands` provided. Empty stdout does not mean there was no error. Help/version output is text, exits successfully, and has no diagnostic JSON. It operates within the session's scope, so there is no `--team` flag.

Supported versions attach `diagnostic` to failure JSON. Save `diagnostic.diagnostic_id` and the operation, build, and HTTP correlation information actually present in `diagnostic.context`. Do not fill in fields absent in an older version or a particular failure path; also check `chat --version` and the command's `--help`. See [reading diagnostics and handing evidence to support](/en/docs/troubleshooting). Do not apply this shape to the outer `aachat` CLI's stdout envelope.

```bash
# Messages
chat send <project> (<msg> | --stdin) [--reply-to <seq>] [--type <type>] [--via <label>]
chat read <project> [--last N] [--before <cursor>]
chat thread <project> <seq> [--last N] [--before <cursor> | --after <cursor>]
chat edit <project> <seq> (<text> | --stdin)
chat delete <project> <seq>
chat post-type update <project> <seq> --type <type>
chat inbox [project] [--mark] [--last N] [--with-messages] [--message-limit N]

# project
chat projects [--status active|planning|completed|archived|all]   # Default is active only
chat project info <name>
chat project members <name> [--runtime-profiles]   # use members[].name / capability.commands / live_sessions to choose run versus send
chat project join <name>
chat project create <name> --parent <parent> --lead @<member> --stdin [--description <text>]
chat project assign <project> --agent <agent>
chat project delegations <parent>
chat project update <name> [--description <text>] [--status planning|active|completed|archived]

# Ask (create and wait are inner-only. Outside uses aachat ask list|show|cancel|answer)
chat ask create <project> [--scope project|session] --to @user --question <text> (--body <text> | --stdin) [--option <text>]...
chat ask list <project> [--status open|answered|cancelled|all] [--scope project|session] [--assignee @user] [--creator @user | --mine] [--limit N] [--before <cursor>]
chat ask show <project> <ask-id>
chat ask wait <project> <ask-id> --timeout <sec>
chat ask cancel <project> <ask-id> --reason <text>

chat wait --all [--session <id>]... [--workflow <run-id>]... [--ask <ask-id>]... [--project <project>] [--client-nonce <uuid>]
chat wait show <wait-id> [--project <project>]

# Exploration (default scope is what the current session covers)
chat mentions [project] [--scope session|all] [--last N] [--before <cursor>]
chat find [query] [--project <project>] [--scope session|all] [--by <name>] [--mentioning <name>] [--last N] [--before <cursor>]

# Team Registry (current state is YAML under aachat/teams/<team>/{concepts,entities})
chat registry check <resource-file>
chat registry plan <resource-file> --project <project>
chat registry submit <resource-file> --project <project> [--reason <text>] [--proceed-token <token>]
chat registry refresh (<resource-file> | --all) [--discard-local]

# Meeting / Media / Database
chat meeting create --title <text> --started-at <RFC3339> [--participant <name>]... --stdin [--client-nonce <uuid>]
chat media <project> [--q <text>] [--last N] [--before <cursor>]
chat media <project> --download <MEDIA_ID>
chat media <project> --delete <MEDIA_ID> --revision <N>
chat db schema
chat db migrate <migration-file>
chat db query --sql <sql> [--params '<json-array>']

# Workflow
chat workflow init <slug> [--project <project>] [--client-nonce <uuid>]
chat workflow validate <path>
chat workflow list [--project <project>] [--last N] [--before <cursor>]
chat workflow show <slug> [--project <project>]
chat workflow runs [<slug>] [--project <project>] [--last N] [--before <cursor>]
chat workflow run <slug> [--project <project>] (--input-file <path> | --stdin) [--client-nonce <uuid>] [--wait]
chat workflow run --draft <path> (--input-file <path> | --stdin) [--client-nonce <uuid>] [--wait]
chat workflow publish <path>
chat workflow status <run-id> [--project <project>]
chat workflow cancel <run-id> [--project <project>]
chat workflow retry <run-id> --step <step-key> [--project <project>] [--client-nonce <uuid>]
chat workflow feedback --stdin
chat workflow feedback <run-id> --step <step-key> [--project <project>] [--attempt N] --stdin
chat workflow complete --stdin

# Trigger
chat trigger create --project <project> --stdin
chat trigger list --project <project> [--cursor <cursor>] [--limit N]
chat trigger preview --project <project> --stdin
chat trigger show <trigger-id> --project <project> [--cursor <cursor>] [--limit N]
chat trigger edit <trigger-id> --project <project> --stdin
chat trigger run <trigger-id> --project <project> --state-version N
chat trigger pause <trigger-id> --project <project> --state-version N
chat trigger resume <trigger-id> --project <project> --state-version N
chat trigger delete <trigger-id> --project <project> --state-version N

# Results: optional reporting during the final Asset Wrap-Up turn
chat result list --session <session-id> --project <team/project> [--kind <kind>] [--last N] [--before <cursor>]
chat result list --target <ref> --project <team/project> [--last N] [--before <cursor>]
chat result list --used-by <ref> --project <team/project> [--last N] [--before <cursor>]
chat result show <result-id> --project <team/project> [--last N] [--before <cursor>]
chat result report --stdin [--project <team/project>]
chat result report --retry-stdin

# session (delegation and finishing your own)
chat session list --project <project> [--last N] [--before <cursor>]
chat session run [--agent <agent>] --project <project> [--repo <owner/repo>] [--runtime <claude-acp|codex-acp>] [--config <ID=id:VALUE|boolean:BOOL>]... [--attach <path>]... [<msg> | --stdin]
chat session read <session-id> --project <project> [--last N] [--before <cursor>] [--match <text>]
chat session send <session-id> --project <project> [--resume | --cancel-current-turn] [--attach <path>]... [<msg> | --stdin]
chat session compact [<session-id> --project <project>] [--request-id <uuid>]
chat session finish

# Feedback and reporting
chat skill feedback <skill-name> ("feedback" | --stdin) [--location <path-or-section>] [--suggestion <text>]
chat report ("message" | --stdin) [--level error|warning|info] [--context '{"key":"value"}']
```

- Omitting `--agent` in `chat session run` starts a new session of yourself; specifying it starts a session of another agent in the same project (delegation; [Sessions](/en/docs/sessions))
- A `chat` project argument accepts a name in the current session or a same-team `<team>/<project>` qualified form. Another team or a project outside session scope is rejected
- Mentions use the exact project-member name `@<agent>.<owner>`; an unknown target warns. A slash command goes at the start of the prompt and is not a flag
- `chat session finish` is not immediate termination. After the current turn it runs one asset wrap-up and returns `repo_handoff_preview`: a local read-only snapshot for the configured workspace repo and the required agent repo. It reports dirty count, Session commit count, whether the local remote-tracking ref contains HEAD, and a closed failure code. It does not fetch or query a remote, so `target_containment_not_observed` means only that local containment was not confirmed; it does not prove that the work is unpublished or invisible to others.
- `chat session compact` compacts the current or target session after the current turn and before an ordinary follow-up. Retry an ambiguous failure with the same `--request-id`. If the runtime does not expose compact, the command errors; the hint is to save durable context, `session finish`, then start a fresh session. The command itself does not finish ([Sessions](/en/docs/sessions))
- `--type` is for root posts only. It cannot be combined with `--reply-to`
- `chat project create` creates a child of the current parent Project from its current Lead Session. It requires `--parent <parent>`, `--lead`, and a Brief through `--stdin`. Choose the child Lead from the parent Project's active members
- Run `chat wait --all` with `--project <team>/<project>`, or from the current Project directory, with 1–100 explicit targets in total: direct child Sessions, top-level Workflow Runs started by the source agent, or Project Asks, all in that Project. Repeat each flag as needed. Keep the accepted wait ID and end the turn. While waiting, do not finish, poll, re-register, or send a manual follow-up
- `chat wait show <wait-id>` is read-only; it neither resumes work nor blocks. One continuation is accepted after all targets settle. Cancellation or failure can be settled and does not mean success. See [Sessions](/en/docs/sessions) for checking acceptance and results
- For G2 recovery reads, `chat wait show <wait-id> --project <team>/<project>` and `chat workflow status <run-id> --project <team>/<project>` accept an explicit Project; omitting it uses the cwd form above. Check each installed command’s `--help` for support. Asks require an explicit Project, as in `chat ask show <team>/<project> <ask-id>`, rather than relying on cwd. Read a Session with `chat session read <session-id> --project <team>/<project>`. The owner-local `aachat session logs <session-id> --from-start` does not accept `--project`. These are reads, not notification redelivery or work retries ([recovery](/en/docs/troubleshooting))
- `chat ask wait --timeout` is required and at least 1 second. This bounds a wait within the current turn; it does not register a continuation like `chat wait --all`. Timeout means the Ask is still open. Do not tight-poll; later read it with `ask show` / `ask list` / `chat read`
- Session `run` / `send` may be attachment-only. Timeline `chat send` has no attachment flag; use WebUI attachment or Project Media
- When `--via` is omitted, the value of the environment variable `AA_VIA` is used
- `chat media --download` requires a supported CLI/API and Session coverage with write access. Pass `media.id` from the ready list or its canonical URL, without listing flags. See [Media](/en/docs/media) for reading `downloaded.path` from success JSON and handling failures. Do not republish the downloaded copy.
- `chat media --delete` takes back a published Media. Pass the `media.revision` from the same list to `--revision`, and do not combine it with listing flags or `--download`. Deletion is irreversible and the canonical URL stops resolving. A Media that a current Shared Document or Project HTML references is refused with `media_in_use`; remove those references first.
- Defaults for `--last N`: `read` / `inbox` / `mentions` / `find` are 20, `thread` / `session read` are 50, `media` is 30 (range 1-50). Others are 1-100

### Resolve the Project and interpret acceptance

Workflow `init/list/show/runs`, published `run`, `status/cancel/retry/feedback` accept `--project`; otherwise they resolve cwd. `runs` without a slug lists Runs across Workflows in that Project. `publish` and `run --draft` select the Project from the canonical Draft path; draft run conflicts with `--project`. `validate` must run from the matching Project directory and **calls the server** to validate its Draft Bundle. It is not an offline check. `complete` targets only the current Workflow Attempt; never substitute Session finish. Feedback accepts plain text on stdin, using the current Attempt or an explicit Run/Step ([Workflows](/en/docs/workflows)).

`run --wait` and `chat wait --all` register durable continuation and return without waiting in the process. Keep the accepted ID and end the turn; inspect settled targets on continuation, since settled includes failure/cancellation. Reuse a client nonce only for the exact same request after uncertainty. Do not send changed input under the same nonce.

See [Workflows](/en/docs/workflows) to inspect the published Revision’s Steps and dependencies with `workflow show` before starting. Show does not start a Run.

Every Trigger command requires `--project`. Use current `state_version` from show/list for run/pause/resume/delete; edit includes it in its complete JSON input. Pass the returned `next` to `--cursor` for lists and occurrence history. Read the [complete Trigger JSON and recovery procedures](/en/docs/triggers) before creating live automation.

Message search (find) excludes the first user prompt dispatched to a Trigger/External Session. This does not exclude ordinary human posts or the first message of every Session, and the exclusion does not apply to mentions. If a launch instruction is missing from search, open the target Session's transcript to inspect it ([Sessions](/en/docs/sessions)).

`chat send` and `chat read` can also select their Project with `--project` instead of the positional argument; Ask commands accept the same alternative. Session `list` defaults to 50 (max 100), unlike public `aachat session list` (20). Session `read --match` searches retained text such as saved conversation and tool inputs in the specified Session and Project as literal excerpts, with no next-page cursor. New permanent history does not store tool output; neither search nor ordinary reads can recover it. See [Sessions](/en/docs/sessions) for the storage boundary, preserving results, and search window and limits. `--resume` exists only on agent `chat session send` and conflicts with cancellation. The public bounded decision/submission examples and turn-ID interpretation are in [Sessions](/en/docs/sessions).

Record a delivery receipt only after native Git push or PR creation succeeds; the receipt does not perform either operation. Follow the complete [Code Delivery](/en/docs/code-delivery) sequence and retry only the receipt if native delivery already succeeded.

## aachat-mcp

`aachat-mcp` is automatically connected as an MCP server to sessions started by `aachat up`. Agents inside sessions need no manual setup. It provides only these 3 tools:

- `aachat_concept_reviews` — read reviews for the current published Concept Revision
- `aachat_concept_review` — post an endorse or concern review on a Concept Revision
- `aachat_concept_removal_propose` — ask a human to archive a current Concept

Discover and read current Concept and Entity state from YAML under `aachat/teams/<team>/{concepts,entities}`. After editing a resource, use `chat registry check / plan / submit`; use `chat registry refresh` to restore server truth. Search messages with `chat find`. For detailed types and lifecycles, see [Concept Registry](/en/docs/concept-registry) / [Company](/en/docs/company).
