acpx 0.1.0
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 +15 -0
- package/README.md +102 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1452 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# acpx
|
|
2
|
+
|
|
3
|
+
Headless CLI client for the [Agent Client Protocol (ACP)](https://agentclientprotocol.com) — talk to coding agents from the command line.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# One-shot: run a prompt against Codex, stream output, exit when done
|
|
7
|
+
acpx run --agent codex-acp --cwd ./my-project "Refactor the auth module"
|
|
8
|
+
|
|
9
|
+
# Multi-turn: create a session, send messages
|
|
10
|
+
acpx session create --agent codex-acp --cwd ./my-project
|
|
11
|
+
acpx session send <id> "Refactor the auth module"
|
|
12
|
+
acpx session send <id> "Now add tests"
|
|
13
|
+
acpx session close <id>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Why?
|
|
17
|
+
|
|
18
|
+
ACP adapters exist for every major coding agent ([Codex](https://github.com/zed-industries/codex-acp), [Claude Code](https://github.com/zed-industries/claude-code-acp), [Gemini CLI](https://github.com/google-gemini/gemini-cli), etc.) but every ACP client is a GUI app or editor plugin.
|
|
19
|
+
|
|
20
|
+
`acpx` is the missing piece: a simple CLI that lets **agents talk to agents** (or humans script agents) over structured ACP instead of scraping terminal output.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g acpx
|
|
26
|
+
# or
|
|
27
|
+
npx acpx run --agent codex-acp "Hello"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Prerequisites
|
|
31
|
+
|
|
32
|
+
You need an ACP-compatible agent installed:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Codex
|
|
36
|
+
npm install -g @zed-industries/codex-acp
|
|
37
|
+
|
|
38
|
+
# Claude Code
|
|
39
|
+
npm install -g @zed-industries/claude-code-acp
|
|
40
|
+
|
|
41
|
+
# Gemini CLI (native ACP support)
|
|
42
|
+
npm install -g @google/gemini-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### One-shot (`run`)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Simple prompt
|
|
51
|
+
acpx run --agent codex-acp --cwd /repo "Fix the failing tests"
|
|
52
|
+
|
|
53
|
+
# Auto-approve all tool calls
|
|
54
|
+
acpx run --agent codex-acp --cwd /repo --approve-all "Build a REST API"
|
|
55
|
+
|
|
56
|
+
# JSON output for programmatic use
|
|
57
|
+
acpx run --agent codex-acp --cwd /repo --format json "Add logging"
|
|
58
|
+
|
|
59
|
+
# Pipe prompt from stdin
|
|
60
|
+
echo "Refactor to async/await" | acpx run --agent codex-acp --cwd /repo
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Multi-turn sessions
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Create session
|
|
67
|
+
acpx session create --agent codex-acp --cwd /repo
|
|
68
|
+
# → abc123
|
|
69
|
+
|
|
70
|
+
# Send messages (streams results, exits on completion)
|
|
71
|
+
acpx session send abc123 "Refactor the auth module"
|
|
72
|
+
acpx session send abc123 "Now add tests for it"
|
|
73
|
+
|
|
74
|
+
# List sessions
|
|
75
|
+
acpx session list
|
|
76
|
+
|
|
77
|
+
# Close when done
|
|
78
|
+
acpx session close abc123
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Output formats
|
|
82
|
+
|
|
83
|
+
| Format | Flag | Description |
|
|
84
|
+
|--------|------|-------------|
|
|
85
|
+
| text | `--format text` | Human-readable streaming (default) |
|
|
86
|
+
| json | `--format json` | Structured ndjson for machines |
|
|
87
|
+
| quiet | `--format quiet` | Final text output only |
|
|
88
|
+
|
|
89
|
+
## How it works
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
┌─────────┐ stdio/ndjson ┌──────────────┐ wraps ┌─────────┐
|
|
93
|
+
│ acpx │ ◄──────────────────► │ ACP adapter │ ◄───────────► │ Agent │
|
|
94
|
+
│ (client) │ ACP protocol │ (codex-acp) │ │ (Codex) │
|
|
95
|
+
└─────────┘ └──────────────┘ └─────────┘
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
acpx spawns the ACP adapter as a child process, communicates over the ACP protocol (JSON-RPC over stdio), and translates structured events (tool calls, text, permissions) into CLI output.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
Apache-2.0
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|