Skip to content

CLI Reference

The oacp CLI provides commands for initializing workspaces, sending messages, validating schemas, and checking environment health.

Create a new project workspace under $OACP_HOME/projects/.

Terminal window
oacp init <project-name>

Scaffolds a complete OACP workspace with agent directories, shared memory files, and packet storage. The project name must be a valid directory name (lowercase alphanumeric and hyphens).

$OACP_HOME/projects/<project-name>/
├── agents/
│ ├── claude/
│ │ ├── inbox/
│ │ └── outbox/
│ ├── codex/
│ │ ├── inbox/
│ │ └── outbox/
│ └── gemini/
│ ├── inbox/
│ └── outbox/
├── memory/
│ ├── project_facts.md
│ ├── decision_log.md
│ └── open_threads.md
├── packets/
│ ├── review/
│ └── findings/
├── merges/
└── workspace.json
VariableDescriptionDefault
OACP_HOMERoot directory for all OACP projects~/oacp

If OACP_HOME is not set, it defaults to ~/oacp. The directory is created automatically if it does not exist.

Terminal window
export OACP_HOME=~/oacp
oacp init billing-service
# Created workspace at ~/oacp/projects/billing-service/

Send a protocol-compliant inbox message to another agent.

Terminal window
oacp send <project> --from <sender> --to <recipient> --type <type> \
--subject <subject> --body <body>

Composes a YAML message file and writes it to the recipient’s inbox/ directory. A copy is saved in the sender’s outbox/. The message is assigned a unique ID and timestamp automatically.

FlagRequiredDescription
--fromYesSender agent name (e.g., claude, codex)
--toYesRecipient agent name
--typeYesMessage type (see Message Types)
--subjectYesShort subject line
--bodyYesMessage body (multi-line supported)
--priorityNoPriority level: P0, P1, P2, P3 (default: P2)
--parent-message-idNoID of the message being replied to, for threading

The --type flag accepts any of the 12 defined message types: task_request, question, notification, follow_up, handoff, handoff_complete, review_request, review_feedback, review_addressed, review_lgtm, brainstorm_request, brainstorm_followup.

See Message Types for details on each type.

Terminal window
oacp send my-project \
--from claude \
--to codex \
--type review_request \
--priority P1 \
--subject "Review auth middleware PR" \
--body "PR #42 adds JWT validation to the API gateway.
Branch: feat/auth-middleware
Please review for security issues and test coverage."

This writes a YAML file to:

$OACP_HOME/projects/my-project/agents/codex/inbox/20260313T1430Z_claude_review_request.yaml

And saves a copy to:

$OACP_HOME/projects/my-project/agents/claude/outbox/20260313T1430Z_claude_review_request.yaml

Check environment and workspace health.

Terminal window
# Global health check
oacp doctor
# Project-specific check
oacp doctor --project <name>

Runs a series of diagnostic checks and reports pass/fail status for each, similar to flutter doctor. Use the global form to verify your environment is set up correctly. Use --project to validate a specific workspace’s structure and configuration.

Global checks (always run):

CheckWhat It Verifies
Python versionPython 3.9+ is installed and on PATH
Required packagespyyaml is importable
OACP_HOMEEnvironment variable is set and the directory exists

Project checks (with --project):

CheckWhat It Verifies
Workspace structureagents/, memory/, packets/ directories exist
Agent directoriesEach agent has inbox/ and outbox/ subdirectories
Memory filesproject_facts.md, decision_log.md, open_threads.md are present
workspace.jsonFile exists and contains valid JSON
$ oacp doctor
[ok] Python 3.12.4
[ok] pyyaml 6.0.2
[ok] OACP_HOME=/Users/you/oacp
[ok] 2 projects found
$ oacp doctor --project billing-service
[ok] workspace.json valid
[ok] agents/ — 3 agents configured (claude, codex, gemini)
[ok] memory/ — all required files present
[ok] packets/ — review/ and findings/ exist

Validate an inbox or outbox YAML message against the protocol schema.

Terminal window
oacp validate <path-to-message.yaml>

Parses a YAML message file and checks it against the OACP message schema. Reports any missing required fields, invalid values, or format violations. Exits with code 0 on success, code 1 on validation failure.

ValidationDescription
Required fieldsid, from, to, type, priority, created_at_utc, subject, body are present
Type validitytype is one of the 12 defined message types
Timestamp formatcreated_at_utc is valid ISO 8601 UTC (e.g., 2026-03-13T14:30:00Z)
Priority valuespriority is P0, P1, P2, or P3
ID formatid follows msg-<timestamp>-<sender>-<rand> convention
Terminal window
$ oacp validate ~/oacp/projects/my-project/agents/codex/inbox/20260313T1430Z_claude_task_request.yaml
[ok] Message is valid.
$ oacp validate bad-message.yaml
[error] Missing required field: subject
[error] Invalid type: "request" (expected one of: task_request, question, ...)