11# CLI
22
33` Arcp.Cli ` ships an ` arcp ` executable. It is a thin operational tool
4- for running runtimes, submitting jobs, and inspecting the SDK version.
4+ for running a demo runtime, submitting one-off jobs, and printing the
5+ SDK version.
56
67## Install
78
@@ -17,28 +18,27 @@ dotnet add package Arcp.Cli
1718
1819## ` arcp serve `
1920
20- Start a runtime that hosts a single named echo agent over WebSocket or
21- stdio. Most production deployments embed ` ArcpServer ` programmatically;
22- ` serve ` is for ad-hoc testing and reproductions.
21+ Start a runtime that hosts a single ` echo ` agent over WebSocket. Most
22+ production deployments embed ` ArcpServer ` programmatically; ` serve ` is
23+ for ad-hoc testing and reproductions.
2324
2425``` sh
2526arcp serve \
2627 --host 127.0.0.1 \
2728 --port 7777 \
28- --token tok \
29- --principal me@example.com
29+ --token tok
3030```
3131
3232Flags:
3333
34- | Flag | Default | Notes |
35- | --------------------------- | ----------- | ----- |
36- | ` --transport <ws\|stdio > ` | ` ws ` | ` stdio ` makes this a subprocess runtime . |
37- | ` --host <host > ` | ` 127.0.0.1 ` | Bind address for WebSocket. |
38- | ` --port <port > ` | ` 7777 ` | Bind port for WebSocket . |
39- | ` --path <path> ` | ` /arcp ` | URL path for the WebSocket upgrade. |
40- | ` --token <token> ` | — | Required. Static bearer accepted by the verifier. |
41- | ` --principal <id> ` | — | Principal returned when the token verifies. |
34+ | Flag | Default | Notes |
35+ | ----------------- | ----------- | ----- |
36+ | ` --host <host > ` | ` 127.0.0.1 ` | Bind address for WebSocket . |
37+ | ` --port <port > ` | ` 7777 ` | Bind port for WebSocket. |
38+ | ` --token <token > ` | ` tok-demo ` | Static bearer accepted by the verifier . |
39+
40+ The runtime accepts WebSocket upgrades at the path ` /arcp ` and exposes
41+ ` /healthz ` for liveness probes.
4242
4343## ` arcp submit `
4444
@@ -49,66 +49,41 @@ and CI.
4949arcp submit \
5050 --url ws://127.0.0.1:7777/arcp \
5151 --token tok \
52- --agent my-agent \
53- --input ' {"hi":1}' \
54- --idempotency-key run-2026-W19
52+ --agent echo \
53+ --input ' {"hi":1}'
5554```
5655
5756Flags:
5857
59- | Flag | Notes |
60- | ------------------------- | ----- |
61- | ` --url <ws-url> ` | Runtime URL. |
62- | ` --token <token> ` | Bearer token. |
63- | ` --agent <name[@ver]> ` | Registered agent name, optionally pinned to a version. |
64- | ` --input <json> ` | Inline JSON payload. |
65- | ` --input-file <path> ` | Read payload from a file (mutually exclusive with ` --input ` ). |
66- | ` --idempotency-key <key> ` | Optional deduplication key (spec §7.2). |
67- | ` --max-runtime-sec <n> ` | Hard wall-clock timeout for the job. |
68- | ` --lease <json> ` | Lease object as JSON (spec §9). |
69- | ` --trace-id <hex> ` | 32-hex W3C trace ID to propagate. |
70-
71- Stdout receives the final ` job.result ` payload as JSON. Events are
72- streamed to stderr in human-readable form (` [seq] kind message ` ).
58+ | Flag | Default | Notes |
59+ | ----------------- | -------------------------- | ----- |
60+ | ` --url <ws-url> ` | ` ws://127.0.0.1:7777/arcp ` | Runtime URL. |
61+ | ` --token <token> ` | ` tok-demo ` | Bearer token. |
62+ | ` --agent <name> ` | ` echo ` | Registered agent name. |
63+ | ` --input <json> ` | ` {} ` | Inline JSON payload. |
64+
65+ Stdout receives ` connected: ` and ` accepted: ` status lines plus the
66+ final ` result: status=... ` line.
7367
7468## ` arcp version `
7569
76- Print the SDK and wire-format versions :
70+ Print the protocol version :
7771
7872``` sh
7973arcp version
80- # Arcp.Cli 1.0.0 (wire 1.1)
74+ # arcp 1.1
8175```
8276
8377## Exit codes
8478
8579| Code | Meaning |
8680| ---- | ------- |
87- | ` 0 ` | Job completed with ` final_status: "success" ` . |
88- | ` 1 ` | Runtime/server error (auth failure, bind failure, unknown agent). |
89- | ` 2 ` | Job terminated with ` error ` , ` cancelled ` , or ` timed_out ` . |
90- | ` 64 ` | Bad CLI arguments. |
91-
92- ## stdio mode
93-
94- ` --transport stdio ` makes ` arcp serve ` read envelopes from stdin and
95- write them to stdout, turning the process into a child-agent runtime.
96- The parent is the ARCP client. Pipe agent logs to stderr or silence
97- them — any non-envelope byte on stdout corrupts the channel.
98-
99- ``` csharp
100- // Parent process in C#:
101- using var proc = Process .Start (new ProcessStartInfo
102- {
103- FileName = " arcp" ,
104- Arguments = " serve --transport stdio --token tok --principal me" ,
105- RedirectStandardInput = true ,
106- RedirectStandardOutput = true ,
107- UseShellExecute = false ,
108- });
109- var transport = new StdioTransport (
110- proc ! .StandardOutput .BaseStream ,
111- proc .StandardInput .BaseStream );
112- ```
113-
114- See [ Transports — stdio] ( ./transports.md#stdio ) for the full pattern.
81+ | ` 0 ` | Command succeeded (` submit ` requires ` final_status: "success" ` ). |
82+ | ` 1 ` | Submit terminated with a non-success status. |
83+ | ` 2 ` | Unknown subcommand. |
84+
85+ For richer flags (idempotency keys, stdio transport, lease constraints,
86+ trace IDs, file-based input), drive ` ArcpClient ` directly from a small
87+ host program — the CLI is intentionally minimal. See
88+ [ Recipes] ( ./recipes.md ) and the [ samples] ( ../samples/ ) for end-to-end
89+ examples.
0 commit comments