acpx 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -12
- package/README.md +123 -61
- package/dist/cli.js +1665 -222
- package/package.json +33 -5
package/LICENSE
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
1
|
+
MIT License
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
3
|
+
Copyright (c) 2026 Janitr AI
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,102 +1,164 @@
|
|
|
1
1
|
# acpx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your agents love acpx! 🤖❤️ They hate having to scrape characters from a PTY session 😤
|
|
4
|
+
|
|
5
|
+
`acpx` is a headless CLI client for the [Agent Client Protocol (ACP)](https://agentclientprotocol.com), so AI agents and orchestrators can talk to coding agents over a structured protocol instead of PTY scraping.
|
|
6
|
+
|
|
7
|
+
One command surface for Codex, Claude, Gemini, OpenCode, Pi, or custom ACP servers. Built for agent-to-agent communication over the command line.
|
|
8
|
+
|
|
9
|
+
- **Persistent sessions**: multi-turn conversations that survive across invocations, scoped per repo
|
|
10
|
+
- **Named sessions**: run parallel workstreams in the same repo (`-s backend`, `-s frontend`)
|
|
11
|
+
- **Prompt queueing**: submit prompts while one is already running, they execute in order
|
|
12
|
+
- **Fire-and-forget**: `--no-wait` queues a prompt and returns immediately
|
|
13
|
+
- **Structured output**: typed ACP messages (thinking, tool calls, diffs) instead of ANSI scraping
|
|
14
|
+
- **Any ACP agent**: built-in registry + `--agent` escape hatch for custom servers
|
|
15
|
+
- **One-shot mode**: `exec` for stateless fire-and-forget tasks
|
|
4
16
|
|
|
5
17
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
$ acpx codex "find the flaky test and fix it"
|
|
19
|
+
|
|
20
|
+
[thinking] Investigating test suite for flaky failures
|
|
21
|
+
|
|
22
|
+
[tool] Run npm test -- --reporter=verbose (running)
|
|
23
|
+
[tool] Run npm test -- --reporter=verbose (completed)
|
|
24
|
+
output:
|
|
25
|
+
✓ auth.login (0.8s)
|
|
26
|
+
✗ checkout.submit (timed out after 5000ms)
|
|
27
|
+
✓ cart.add (0.3s)
|
|
28
|
+
|
|
29
|
+
[thinking] Found it — checkout.submit has a race condition in the async setup
|
|
15
30
|
|
|
16
|
-
|
|
31
|
+
[tool] Edit src/checkout.test.ts (completed)
|
|
32
|
+
output:
|
|
33
|
+
Success. Updated 1 file.
|
|
17
34
|
|
|
18
|
-
|
|
35
|
+
[tool] Run npm test -- checkout.submit (completed)
|
|
36
|
+
output:
|
|
37
|
+
✓ checkout.submit (0.4s)
|
|
19
38
|
|
|
20
|
-
|
|
39
|
+
Fixed: added `await` to the setup hook in checkout.submit. The test was
|
|
40
|
+
reading stale state from the previous run.
|
|
41
|
+
|
|
42
|
+
[done] end_turn
|
|
43
|
+
```
|
|
21
44
|
|
|
22
45
|
## Install
|
|
23
46
|
|
|
24
47
|
```bash
|
|
25
|
-
npm
|
|
26
|
-
# or
|
|
27
|
-
npx acpx run --agent codex-acp "Hello"
|
|
48
|
+
npm i -g acpx
|
|
28
49
|
```
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
`acpx` manages persistent sessions, so prefer a global install. Avoid `npx acpx ...` for normal use.
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
## Agent prerequisites
|
|
33
54
|
|
|
34
|
-
|
|
35
|
-
# Codex
|
|
36
|
-
npm install -g @zed-industries/codex-acp
|
|
55
|
+
`acpx` auto-downloads ACP adapters with `npx` on first use. You do not need to install adapter packages manually.
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
npm install -g @zed-industries/claude-code-acp
|
|
57
|
+
The only prerequisite is the underlying coding agent you want to use:
|
|
40
58
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
- `acpx codex` -> Codex CLI: https://codex.openai.com
|
|
60
|
+
- `acpx claude` -> Claude Code: https://claude.ai/code
|
|
61
|
+
- `acpx gemini` -> Gemini CLI: https://github.com/google/gemini-cli
|
|
62
|
+
- `acpx opencode` -> OpenCode: https://opencode.ai
|
|
63
|
+
- `acpx pi` -> Pi Coding Agent: https://github.com/mariozechner/pi
|
|
44
64
|
|
|
45
|
-
## Usage
|
|
46
|
-
|
|
47
|
-
### One-shot (`run`)
|
|
65
|
+
## Usage examples
|
|
48
66
|
|
|
49
67
|
```bash
|
|
50
|
-
#
|
|
51
|
-
acpx
|
|
68
|
+
acpx codex 'fix the tests' # implicit prompt (persistent session)
|
|
69
|
+
acpx codex prompt 'fix the tests' # explicit prompt subcommand
|
|
70
|
+
acpx codex --no-wait 'draft test migration plan' # enqueue without waiting if session is busy
|
|
71
|
+
acpx exec 'summarize this repo' # default agent shortcut (codex)
|
|
72
|
+
acpx codex exec 'what does this repo do?' # one-shot, no saved session
|
|
73
|
+
|
|
74
|
+
acpx codex -s api 'implement cursor pagination' # named session
|
|
75
|
+
acpx codex -s docs 'rewrite API docs' # parallel work in another named session
|
|
52
76
|
|
|
53
|
-
#
|
|
54
|
-
acpx
|
|
77
|
+
acpx codex sessions # list sessions for codex command
|
|
78
|
+
acpx codex sessions list # explicit list
|
|
79
|
+
acpx codex sessions close # close cwd-scoped default session
|
|
80
|
+
acpx codex sessions close api # close cwd-scoped named session
|
|
55
81
|
|
|
56
|
-
|
|
57
|
-
acpx
|
|
82
|
+
acpx claude 'refactor auth middleware' # built-in claude agent
|
|
83
|
+
acpx gemini 'add startup logging' # built-in gemini agent
|
|
58
84
|
|
|
59
|
-
#
|
|
60
|
-
|
|
85
|
+
acpx my-agent 'review this patch' # unknown name -> raw command
|
|
86
|
+
acpx --agent './bin/dev-acp --profile ci' 'run checks' # --agent escape hatch
|
|
61
87
|
```
|
|
62
88
|
|
|
63
|
-
|
|
89
|
+
## Practical scenarios
|
|
64
90
|
|
|
65
91
|
```bash
|
|
66
|
-
#
|
|
67
|
-
acpx
|
|
68
|
-
#
|
|
92
|
+
# Review a PR in a dedicated session and auto-approve permissions
|
|
93
|
+
acpx --cwd ~/repos/shop --approve-all codex -s pr-842 \
|
|
94
|
+
'Review PR #842 for regressions and propose a minimal fix'
|
|
69
95
|
|
|
70
|
-
#
|
|
71
|
-
acpx
|
|
72
|
-
acpx
|
|
96
|
+
# Keep parallel streams for the same repo
|
|
97
|
+
acpx codex -s bugfix 'isolate flaky checkout test'
|
|
98
|
+
acpx codex -s release 'draft release notes from recent commits'
|
|
99
|
+
```
|
|
73
100
|
|
|
74
|
-
|
|
75
|
-
acpx session list
|
|
101
|
+
## Global options in practice
|
|
76
102
|
|
|
77
|
-
|
|
78
|
-
acpx
|
|
103
|
+
```bash
|
|
104
|
+
acpx --approve-all codex 'apply the patch and run tests'
|
|
105
|
+
acpx --approve-reads codex 'inspect repo structure and suggest plan' # default mode
|
|
106
|
+
acpx --deny-all codex 'explain what you can do without tool access'
|
|
107
|
+
|
|
108
|
+
acpx --cwd ~/repos/backend codex 'review recent auth changes'
|
|
109
|
+
acpx --format text codex 'summarize your findings'
|
|
110
|
+
acpx --format json codex exec 'review changed files'
|
|
111
|
+
acpx --format quiet codex 'final recommendation only'
|
|
112
|
+
|
|
113
|
+
acpx --timeout 90 codex 'investigate intermittent test timeout'
|
|
114
|
+
acpx --verbose codex 'debug why adapter startup is failing'
|
|
79
115
|
```
|
|
80
116
|
|
|
81
|
-
|
|
117
|
+
## Output formats
|
|
82
118
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
| json | `--format json` | Structured ndjson for machines |
|
|
87
|
-
| quiet | `--format quiet` | Final text output only |
|
|
119
|
+
```bash
|
|
120
|
+
# text (default): human-readable stream with tool updates
|
|
121
|
+
acpx codex 'review this PR'
|
|
88
122
|
|
|
89
|
-
|
|
123
|
+
# json: NDJSON events, useful for automation
|
|
124
|
+
acpx --format json codex exec 'review this PR' \
|
|
125
|
+
| jq -r 'select(.type=="tool_call") | [.status, .title] | @tsv'
|
|
90
126
|
|
|
127
|
+
# quiet: final assistant text only
|
|
128
|
+
acpx --format quiet codex 'give me a 3-line summary'
|
|
91
129
|
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
130
|
+
|
|
131
|
+
## Built-in agents and custom servers
|
|
132
|
+
|
|
133
|
+
Built-ins:
|
|
134
|
+
|
|
135
|
+
| Agent | Adapter | Wraps |
|
|
136
|
+
| ---------- | ---------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
137
|
+
| `codex` | [codex-acp](https://github.com/zed-industries/codex-acp) | [Codex CLI](https://codex.openai.com) |
|
|
138
|
+
| `claude` | [claude-agent-acp](https://github.com/zed-industries/claude-agent-acp) | [Claude Code](https://claude.ai/code) |
|
|
139
|
+
| `gemini` | native | [Gemini CLI](https://github.com/google/gemini-cli) |
|
|
140
|
+
| `opencode` | native | [OpenCode](https://opencode.ai) |
|
|
141
|
+
| `pi` | [pi-acp](https://github.com/svkozak/pi-acp) | [Pi Coding Agent](https://github.com/mariozechner/pi) |
|
|
142
|
+
|
|
143
|
+
Use `--agent` as an escape hatch for custom ACP servers:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
acpx --agent ./my-custom-acp-server 'do something'
|
|
96
147
|
```
|
|
97
148
|
|
|
98
|
-
|
|
149
|
+
## Session behavior
|
|
150
|
+
|
|
151
|
+
- Prompt commands use saved sessions scoped to `(agent command, cwd, optional name)`.
|
|
152
|
+
- `-s <name>` creates/selects a parallel named session in the same repo.
|
|
153
|
+
- Prompt submissions are queue-aware per session. If a prompt is already running, new prompts are queued and drained by the running `acpx` process.
|
|
154
|
+
- `--no-wait` submits to that queue and returns immediately.
|
|
155
|
+
- `exec` is always one-shot and does not reuse saved sessions.
|
|
156
|
+
- Session metadata is stored under `~/.acpx/sessions/`.
|
|
157
|
+
|
|
158
|
+
## Full CLI reference
|
|
159
|
+
|
|
160
|
+
See `docs/CLI.md`.
|
|
99
161
|
|
|
100
162
|
## License
|
|
101
163
|
|
|
102
|
-
|
|
164
|
+
MIT
|