This file is for contributors and coding agents working in this repository.
Keep it focused on how to develop, validate, and ship acpx.
Use these files for the other concerns:
README.mdfor user-facing install and usagedocs/CLI.mdfor CLI referenceVISION.mdfor product direction and boundariesCONTRIBUTING.mdfor PR expectationsskills/acpx/SKILL.mdfor agent-usage guidance
When you need implementation detail, prefer the in-repo references below instead of expanding this file into a full technical spec.
- GitHub:
https://github.com/openclaw/acpx - npm:
https://www.npmjs.com/package/acpx - Default branch:
main - Runtime: Node.js
>=22.12.0 - Package manager:
pnpm@10.23.0
acpxshould be the smallest useful ACP client: a lightweight CLI that lets one agent talk to another agent through the Agent Client Protocol without PTY scraping or adapter-specific glue.- The goal is not to build a giant orchestration layer. The goal is to make ACP practical, robust, and easy to compose in real workflows.
- The primary user is another agent, orchestrator, or harness. Human usability still matters, but it is a secondary constraint.
acpxshould not try to do too many things at once.- If a feature does not make
acpxa better ACP client or backend, it probably does not belong in core. - In
acpx, data models, config keys, keywords, flags, output shapes, and naming conventions are part of the product surface. - They should be scrutinized multiple times before being added or changed. Convenience is not enough. Every new convention creates long-term compatibility cost.
- The default stance should be to add fewer conventions, make them clearer, and keep them stable.
- Read
VISION.mdbefore changing user-visible behavior or conventions.
Install dependencies:
pnpm installRun the CLI from source:
pnpm run dev -- --helpBuild the distributable CLI:
pnpm run build
node dist/cli.js --helpPublished install/use:
npm install -g acpx@latest
# or
npx acpx@latest --help- Make changes in
src/,test/, docs, or workflow files. - Use
pnpm run dev -- ...for quick manual checks. - Run the smallest relevant validation command while iterating.
- Before opening or updating a PR, run the full checks for the scope you changed.
Example ordering policy:
piopenclawcodexclaudegeminicursorcopilot
This ordering is mandatory whenever multiple built-in agents appear in the same example set. Agents after those may appear in any order, but the precedence above MUST NOT be broken. Any PR that introduces or preserves example ordering that violates this rule MUST be modified until it adheres to this ordering before merge.
Main landing documentation policy:
- This repo will receive many contributions. Contributors will sometimes try, intentionally or unintentionally, to promote their own harness or product through the docs.
- Main landing docs such as
README.mdanddocs/CLI.mdMUST remain impartial. They MUST NOT become promotional surfaces for specific harnesses. piandopenclaware the primary citizens. They may appear at the top of main landing docs, in that order.codexandclaudeare the next most important citizens because they are the most widely used. These four harnesses —pi,openclaw,codex, andclaude— are the only harnesses that may be used as named examples in main landing docs, and the only ones whose specific quirks or harness-specific details may be called out there.- The only main-landing exceptions are the neutral built-in agents table in
README.mdand the neutral built-in agents list inagents/README.md. Those lists MAY include every supported built-in harness, but they MUST remain exhaustive, factual, and non-promotional. They MUST NOT single out non-primary harnesses for extra emphasis. - Harness-specific docs for other supported agents MUST live under
agents/and MUST use capitalized filenames, for exampleagents/Cursor.mdandagents/Copilot.md. - No other specific harness MUST BE ALLOWED to receive special placement, singled-out examples, or harness-specific promotion in main landing docs. This rule applies even when the change is framed as harmless, helpful, or accidental.
- Other harnesses may still be supported elsewhere in the repo, but main landing docs must describe them impartially and MUST NOT promote them unjustly.
- Documentation MUST NOT include adapter package version specifiers or semver ranges such as
pi-acp@^0.0.22or@zed-industries/codex-acp@^0.9.5. Keep documentation generic. Keep actual adapter pinning in code, config, or release logic instead.
Harness documentation synchronization policy:
- Any PR that adds, removes, renames, or materially changes a built-in harness agent, harness-specific workflow, or harness-facing behavior MUST update
skills/acpx/SKILL.mdin the same change. - The same PR MUST also update the matching harness doc under
agents/using the existing capitalized filename convention such asagents/Cursor.mdoragents/Copilot.md. - If a harness-specific doc does not exist yet, create
agents/{Agent}.mdas part of the same change instead of leaving the harness documented only in shared surfaces. - Do not merge harness-facing changes when
skills/acpx/SKILL.mdand the matchingagents/{Agent}.mdare out of sync.
pnpm run build— build the distributable CLIpnpm run test— local test run without coverage gatepnpm run test:coverage— CI-equivalent test run with coverage thresholdspnpm run typecheck— TypeScript typecheckpnpm run lint— source linting plus persisted-key casing checkspnpm run format:check— formatting checkpnpm run check— format, typecheck, lint, build, and coverage testspnpm run check:docs— docs format and markdown lintpnpm run perf:report— performance reporting helper
- Run
pnpm run testorpnpm run test:coveragebefore pushing when you touch runtime logic. - Changelog entries should cover user-facing changes only. Do not add internal release-process or meta-only notes.
- Changelog placement: add new entries under
CHANGELOG.md## Unreleased, appending to the end of the target section (### Changes,### Breaking, or### Fixes) instead of inserting at the top. - Changelog attribution: use concise
Thanks @authorattribution and avoid repeating multiple attribution styles in the same line. - Pure test-only changes generally do not need a changelog entry unless they change user-visible behavior or the maintainer explicitly wants one.
- Repo-local
/landprinstructions live at.pi/prompts/landpr.md. When landing or merging a PR in this repo, follow that process. - Pull request titles MUST use conventional prefixes such as
feat:,fix:,docs:,chore:,refactor:, ortest:and should summarize the actual change directly. - Do not prefix pull request titles with agent markers such as
[codex]or other AI-assistance tags. If AI assistance should be disclosed, put that in the PR description instead. - Local
codex review --base ...runs in this repo can legitimately take up to 30 minutes. Do not declare them stuck before that timeout unless you have stronger evidence than elapsed time alone. - For workflow changes, prefer prompt and policy changes inside existing ACP nodes over adding new workflow nodes, helper actions, or deterministic side-logic.
- If the problem is mainly judgment or policy, keep that judgment in the ACP lane unless the runtime truly needs a distinct new execution capability.
- Preserve the existing flow graph shape by default. Assume "no new node" unless a new node adds a real execution boundary, timeout boundary, artifact collection boundary, or capability the current node cannot own cleanly.
- For persistent ACP flow sessions, preserve the underlying agent session across
steps. If the live ACP connection dies, the correct recovery is reconnect and
session/loadthe same session. Do not silently replace a dead persistent session with a fresh one. If the original persistent session cannot be resumed, fail the node or workflow clearly instead. - Before
/landpr, run/reviewprand require explicit evidence for bug-fix claims. Do not merge bug-fix PRs based only on issue text, PR text, or AI rationale. - Minimum merge gate for bug-fix PRs:
- symptom evidence (repro, log, or failing test)
- verified root cause in code with file/line
- fix touches the implicated code path
- regression test when feasible; otherwise include manual verification proof and why no test was added
- Use concise, action-oriented commit messages and keep unrelated refactors out of the same commit when possible.
- Group changelog updates with the PR that introduces the user-facing change instead of batching them later.
- When referring to pull requests in comments, notes, or final reports, use a
full URL or a Markdown link. In lists, a short Markdown link label such as
#123is preferred over bare PR numbers.
Use these examples when you need the most basic acpx flows while developing
or validating the CLI:
acpx codex sessions new
acpx codex 'fix the failing test'
acpx codex prompt 'rewrite AGENTS.md for contributors'
acpx codex exec 'summarize this repo'
acpx exec 'summarize this repo' # defaults to codex
acpx codex sessions list
acpx codex sessions show
acpx codex status
acpx codex cancel
acpx codex sessions new --name docs
acpx codex -s docs 'rewrite CLI docs'
acpx config show
acpx config init
acpx --format json codex exec 'review changed files'- Docs-only changes in
docs/**,README.md, orCONTRIBUTING.md: runpnpm run check:docs - Code changes in
src/**,test/**,scripts/**,package.json, or workflow files: runpnpm run check - Code plus docs changes:
run both
pnpm run checkandpnpm run check:docs - Quick iteration on runtime or test changes:
use
pnpm run testfirst, thenpnpm run checkbefore pushing - Changes to flags, config, output, agent registry names, session behavior, queueing, or persistence formats:
always run
pnpm run check
AGENTS.md changes are not treated as docs-only by CI right now, so changes to
this file should be treated like regular repo changes for validation purposes.
CI lives in .github/workflows/ci.yml.
- Pull requests and pushes run against
main - CI first detects change scope
- Docs-only changes skip the code matrix
- Docs changes run the
Docsjob viapnpm run check:docs - Non-doc changes run:
pnpm run format:checkpnpm run typecheckpnpm run lintpnpm run buildpnpm run test:coverage
- CI installs dependencies with
pnpm install --frozen-lockfile - CI uses Node 24 by default; the
Testjob runs on Node 22
Release automation lives in .github/workflows/release.yml.
- Releases run when a
vX.Y.Ztag is pushed - The workflow installs dependencies with
pnpm install --frozen-lockfile - It validates
package.jsonrelease metadata before publishing - It validates that the tag matches
package.jsonversion and that the tagged commit is onmain - It runs
pnpm run lint,pnpm run typecheck, andpnpm run build - It publishes directly to npm with trusted publishing and provenance
The release workflow currently requires these package.json values:
author:OpenClaw Team <dev@openclaw.ai>repository.url:https://github.com/openclaw/acpx
Do not change release metadata or publishing behavior casually.
src/— CLI and runtime implementationtest/— Node test suitescripts/— repo maintenance and perf helpersREADME.md— install and usage docsdocs/CLI.md— full CLI referenceVISION.md— product boundariesCONTRIBUTING.md— contribution workflow
src/cli-core.ts— top-level CLI entrypoint and output policy handlingsrc/acp/client.ts— ACP client integrationsrc/cli/config.ts— config loading and defaultssrc/agent-registry.ts— built-in agent names and commandssrc/cli/session/runtime.tsandsrc/cli/session/— CLI session lifecycle and runtime behaviorsrc/cli/queue/ipc.tsandsrc/cli/queue/ipc-server.ts— queue IPC behaviortest/integration.test.ts— end-to-end CLI expectations.github/workflows/ci.yml— CI behavior.github/workflows/release.yml— release workflow