Skip to main content

CLI Overview

Most days, no command runs. Sync happens via runtime hooks after you edit skills or instructions in Claude Code or Codex.

The CLI exists for:

  • Setupinit, install, start
  • Inspectionstatus, scan, doctor, diff
  • Recoveryrestore, ack, reconcile-lock
  • CIsync --check
  • Maintenancestop, upgrade, uninstall

Command quick reference

CommandWhen to use
agentmesh initFirst-time repo setup
agentmesh install --runtime <name>Runtime added after init; install its hooks
agentmesh install --git-pre-commitOptional commit-time drift check
agentmesh startStart AgentMesh again for this repo
agentmesh stopStop AgentMesh for this repo only
agentmesh statusQuick health snapshot (under 50ms)
agentmesh scanRead-only: what's detected before init
agentmesh doctorDeep health check with recovery hints
agentmesh diff / applyPreview / apply pending sync changes
agentmesh syncManual sync (rare); sync --check for CI
agentmesh restore <id> --from <runtime>Recover losing version after conflict
agentmesh ack <id>Acknowledge conflict without restoring
agentmesh reconcile-lockFix git merge conflict in lockfile
agentmesh upgradeRepin hooks after binary upgrade
agentmesh uninstallRemove AgentMesh-owned state from this repo
agentmesh uninstall --fullAlso remove AgentMesh from this computer
agentmesh watchStart watcher daemon explicitly

Full details: CLI Commands.

Global flags

FlagPurpose
-h, --helpShow help
-V, --versionPrint version
--silentErrors only (used by hooks)
-v, --verboseMore detail (-vv for debug)
--no-colorDisable ANSI colors
--cwd=<path>Run as if from <path>

Exit codes

CI scripts can rely on these stable exit codes:

CodeMeaning
0Success
1Drift detected (sync --check)
2Strict-mode CI rule violated
3Integrity check failed
4Lockfile schema unsupported — upgrade AgentMesh
5Invalid agentmesh.config.yaml
6Adapter error
7I/O error
10Cancelled (e.g., init prompt in non-TTY)
64Usage error (bad flag / missing argument)

Output conventions

MarkerMeaning
Success
Needs attention
Failure
Step in progress

Typical workflows

First setup

agentmesh scan
agentmesh init
agentmesh doctor

Something looks wrong

agentmesh status # fast check
agentmesh doctor # detailed diagnosis + recovery commands
agentmesh diff # what would sync change?

After upgrading AgentMesh

agentmesh upgrade # repin binary path in hooks
agentmesh doctor # verify

Temporarily stop AgentMesh for this repo

agentmesh stop
agentmesh start # restore local hooks later

CI pipeline

agentmesh sync --check

See CI Integration.