CLI Commands
Complete v0.1 reference for the agentmesh CLI.
Global flags
Apply to every command unless noted:
| Flag | Purpose |
|---|---|
-h, --help | Show help and exit 0 |
-V, --version | Print version and exit 0 |
--silent | Suppress informational output; errors still print to stderr |
--no-color | Disable ANSI colors (NO_COLOR=1 equivalent) |
--color=auto|always|never | Override color behavior |
--cwd=<path> | Run as if invoked from <path> |
-v, --verbose | More detail; -vv for debug |
agentmesh init
One-time repository setup. Idempotent — safe to re-run.
What it does:
- Scans for Claude and Codex artifacts
- Imports entities into
.ai/canonical model - Propagates to other detected runtimes
- Installs hooks (unless
--skip-hooks) - Writes
agentmesh.lock
| Flag | Purpose |
|---|---|
--canonical-instructions=AGENTS.md | Non-interactive: use AGENTS.md as the starting agent memory file during init |
--canonical-instructions=CLAUDE.md | Non-interactive: use CLAUDE.md as the starting agent memory file during init |
-y, --yes | Skip confirmation prompts |
--dry-run | Preview without writing |
--skip-hooks | Canonical state + lockfile only |
agentmesh install
Install hooks for a runtime or git pre-commit safety net.
| Flag | Purpose |
|---|---|
--runtime <name> | Install hooks for claude or codex |
--git-pre-commit | Install pre-commit drift check |
--force | With --git-pre-commit: overwrite framework-managed hooks |
-y, --yes | Skip confirmation |
--dry-run | Preview without writing |
When to use install vs init:
| Situation | Command |
|---|---|
| First setup with runtimes present | agentmesh init |
Added .codex/ after Claude-only init | agentmesh install --runtime codex |
Ran init --skip-hooks, now want hooks | agentmesh install --runtime claude (and/or codex) |
| Want commit-time drift check | agentmesh install --git-pre-commit |
agentmesh start
Start AgentMesh again for an already initialized repository.
Use this after agentmesh stop, or when local hooks need to be restored on a machine that already has agentmesh.lock.
What it does:
- Reads existing repository state from
agentmesh.lock - Refreshes machine-local AgentMesh state for this repo
- Reinstalls AgentMesh-owned hooks for detected runtimes
It does not create new canonical repository state. For first-time setup, use agentmesh init.
| Flag | Purpose |
|---|---|
--dry-run | Preview without writing |
-y, --yes | Skip confirmation prompts |
agentmesh stop
Stop AgentMesh for this repository only while keeping shared repository state.
What it does:
- Stops the watcher for this repo
- Removes AgentMesh-owned hooks for this repo
- Clears machine-local AgentMesh state for this repo
What it keeps:
- The
agentmeshbinary agentmesh.lock.ai/agentmesh.config.yaml- Runtime files such as
AGENTS.mdandCLAUDE.md
| Flag | Purpose |
|---|---|
--dry-run | Preview without writing |
-y, --yes | Skip confirmation prompts |
agentmesh status
Fast snapshot (under 50ms). Exit 0 if healthy.
AgentMesh 0.1.0 repo: my-repo lockfile: schema 1 (current)
hooks: claude ✓ codex ✓
watcher: not running (lazy-start active)
pending: 0 in queue
conflicts: 0 unresolved
integrity: ✓
For details, use doctor.
agentmesh scan
Read-only detection of runtimes and entities. No writes. Exit 0.
Use before init to see what AgentMesh will import.
agentmesh sync
Manual sync pass. Usually automatic via hooks.
| Flag | Purpose |
|---|---|
--check | Dry-run for CI — exit non-zero on any drift |
--await-drain | Block until async fan-out completes |
--trigger=<source> | Origin hint: claude-hook, codex-hook, watcher, cli |
sync --check exit codes
| Exit | Meaning |
|---|---|
| 0 | Lockfile matches filesystem |
| 1 | Drift detected (any state movement) |
| 2 | Strict CI rule violated |
| 3 | Integrity failure |
| 4 | Unsupported lockfile schema |
agentmesh diff / agentmesh apply
diff — preview what sync would change (exit 1 if changes pending).
apply — write changes after reviewing diff.
agentmesh doctor
Deep health check. Slower than status but exhaustive.
| Flag | Purpose |
|---|---|
--versions | Print binary, adapter, protocol, schema versions |
--integrity-only | Fast integrity check only |
--watcher-only | Watcher status only |
--json | Machine-readable output |
Surfaces: adapter health, hook integrity, lockfile state, pending conflicts with recovery commands, gitignore warnings.
agentmesh restore
Recover a losing version from an auto-resolved conflict.
agentmesh restore skill:security-review --from codex
| Flag | Purpose |
|---|---|
--from <runtime> | Required: ai, claude, or codex |
--at <timestamp> | Specific conflict timestamp if multiple exist |
--dry-run | Preview without writing |
agentmesh ack
Acknowledge a pending_conflict_resolution flag without restoring.
agentmesh ack skill:security-review
agentmesh ack # all pending (with confirmation)
agentmesh watch
Start the watcher daemon explicitly.
| Flag | Purpose |
|---|---|
--persistent | No idle exit |
--register-as-service | Register LaunchAgent/systemd/Task Scheduler |
--foreground | Don't detach |
-y, --yes | Skip service registration confirmation |
Default idle timeout: 30 minutes.
agentmesh upgrade
Repin integrity to the currently-installed binary. Rewrites hook entries if the path changed.
Run after upgrading the AgentMesh binary via the installer or a local rebuild.
| Flag | Purpose |
|---|---|
--dry-run | Preview |
-y, --yes | Skip confirmation |
agentmesh uninstall
Remove AgentMesh-owned state from this repository.
What it does:
- Runs the same repository-local cleanup as
agentmesh stop - Deletes
agentmesh.lock - Deletes
.ai/ - Deletes
agentmesh.config.yaml
What it keeps:
- The installed
agentmeshcommand, unless--fullis passed - Runtime files such as
AGENTS.mdandCLAUDE.md - Runtime-owned folders and settings that AgentMesh did not create
To also remove AgentMesh from the computer, run:
agentmesh uninstall --full
| Flag | Purpose |
|---|---|
--full | Also remove the installed AgentMesh command |
--dry-run | Preview |
-y, --yes | Skip confirmation |
agentmesh reconcile-lock
Recover from a textual git merge conflict in agentmesh.lock. Does not auto-commit.
agentmesh reconcile-lock
git diff agentmesh.lock
git add agentmesh.lock && git commit
Hidden commands
Not listed in --help:
| Command | Purpose |
|---|---|
agentmesh __adapter <name> --stdio | Internal adapter JSON-RPC mode |
v0.2+ reserved commands
Invoking these prints "available in v0.2+":
agentmesh graphagentmesh adapter add/remove/list/update
Related
- CLI Overview — workflows and exit codes
- CI Integration —
sync --checkexamples