Skip to content

Commit 400f1c9

Browse files
author
Chojan Shang
committed
docs: update to include gemini
Signed-off-by: Chojan Shang <chojan.shang@vesoft.com>
1 parent 970aa93 commit 400f1c9

3 files changed

Lines changed: 64 additions & 1 deletion

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<a href="https://agentclientprotocol.com/" >
2+
<img alt="Agent Client Protocol" src="https://zed.dev/img/acp/banner-dark.webp">
3+
</a>
4+
15
# Agent Client Protocol (Python)
26

37
Python SDK for the Agent Client Protocol (ACP). Build agents that speak ACP over stdio so tools like Zed can orchestrate them.
@@ -10,6 +14,7 @@ Python SDK for the Agent Client Protocol (ACP). Build agents that speak ACP over
1014
- Async base classes and JSON-RPC plumbing that keep stdio agents tiny
1115
- Process helpers such as `spawn_agent_process` for embedding agents and clients directly in Python
1216
- Batteries-included examples that exercise streaming updates, file I/O, and permission flows
17+
- Optional Gemini CLI bridge (`examples/gemini.py`) for the `gemini --experimental-acp` integration
1318

1419
## Install
1520

@@ -124,13 +129,33 @@ Full example with streaming and lifecycle hooks lives in [examples/echo_agent.py
124129
- `examples/client.py`: interactive console client that can launch any ACP agent via stdio
125130
- `examples/agent.py`: richer agent showcasing initialization, authentication, and chunked updates
126131
- `examples/duet.py`: launches both example agent and client using `spawn_agent_process`
132+
- `examples/gemini.py`: connects to the Gemini CLI in `--experimental-acp` mode, with optional auto-approval and sandbox flags
127133

128134
## Documentation
129135

130136
- Project docs (MkDocs): https://psiace.github.io/agent-client-protocol-python/
131137
- Local sources: `docs/`
132138
- [Quickstart](docs/quickstart.md)
133139

140+
## Gemini CLI bridge
141+
142+
Want to exercise the `gemini` CLI over ACP? The repository includes a Python replica of the Go SDK's REPL:
143+
144+
```bash
145+
python examples/gemini.py --yolo # auto-approve permissions
146+
python examples/gemini.py --sandbox --model gemini-2.5-pro
147+
```
148+
149+
Defaults assume the CLI is discoverable via `PATH`; override with `--gemini` or `ACP_GEMINI_BIN=/path/to/gemini`.
150+
151+
The smoke test (`tests/test_gemini_example.py`) is opt-in to avoid false negatives when the CLI is unavailable or lacks credentials. Enable it locally with:
152+
153+
```bash
154+
ACP_ENABLE_GEMINI_TESTS=1 ACP_GEMINI_BIN=/path/to/gemini uv run python -m pytest tests/test_gemini_example.py
155+
```
156+
157+
The test gracefully skips when authentication prompts (e.g. missing `GOOGLE_CLOUD_PROJECT`) block the interaction.
158+
134159
## Development workflow
135160

136161
```bash

docs/index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<a href="https://agentclientprotocol.com/" >
2+
<img alt="Agent Client Protocol" src="https://zed.dev/img/acp/banner-dark.webp">
3+
</a>
4+
15
# Agent Client Protocol SDK (Python)
26

37
Welcome to the Python SDK for the Agent Client Protocol (ACP). The package ships ready-to-use transports, typed protocol models, and examples that stream messages to ACP-aware clients such as Zed.
@@ -7,7 +11,7 @@ Welcome to the Python SDK for the Agent Client Protocol (ACP). The package ships
711
- Pydantic models generated from the upstream ACP schema (`acp.schema`)
812
- Async agent/client wrappers with JSON-RPC task supervision built in
913
- Process helpers (`spawn_agent_process`, `spawn_client_process`) for embedding ACP nodes inside Python applications
10-
- Examples that showcase streaming updates, file operations, and permission flows
14+
- Examples that showcase streaming updates, file operations, permission flows, and even a Gemini CLI bridge (`examples/gemini.py`)
1115

1216
## Getting started
1317

@@ -23,6 +27,22 @@ Welcome to the Python SDK for the Agent Client Protocol (ACP). The package ships
2327

2428
Prefer a guided tour? Head to the [Quickstart](quickstart.md) for terminal, editor, and programmatic launch walkthroughs.
2529

30+
## Gemini CLI bridge
31+
32+
If you have access to the Gemini CLI (`gemini --experimental-acp`), run:
33+
34+
```bash
35+
python examples/gemini.py --yolo
36+
```
37+
38+
Flags mirror the Go SDK example:
39+
40+
- `--gemini /path/to/cli` or `ACP_GEMINI_BIN` to override discovery
41+
- `--model`, `--sandbox`, `--debug` forwarded verbatim
42+
- `--yolo` auto-approves permission prompts with sensible defaults
43+
44+
An opt-in smoke test lives at `tests/test_gemini_example.py`. Enable it with `ACP_ENABLE_GEMINI_TESTS=1` (and optionally `ACP_GEMINI_TEST_ARGS`) when the CLI is authenticated; otherwise the test stays skipped.
45+
2646
## Documentation map
2747

2848
- [Quickstart](quickstart.md): install, run, and embed the echo agent, plus next steps for extending it

docs/quickstart.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,21 @@ Hook it up with `AgentSideConnection` inside an async entrypoint and wire it to
106106
- [`examples/echo_agent.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/echo_agent.py) for the smallest streaming agent
107107
- [`examples/agent.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/agent.py) for an implementation that negotiates capabilities and streams richer updates
108108
- [`examples/duet.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/duet.py) to see `spawn_agent_process` in action alongside the interactive client
109+
- [`examples/gemini.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/gemini.py) to drive the Gemini CLI (`--experimental-acp`) directly from Python
110+
111+
## 5. Optional: Talk to the Gemini CLI
112+
113+
If you have the Gemini CLI installed and authenticated:
114+
115+
```bash
116+
python examples/gemini.py --yolo # auto-approve permission prompts
117+
python examples/gemini.py --sandbox --model gemini-1.5-pro
118+
```
119+
120+
Environment helpers:
121+
122+
- `ACP_GEMINI_BIN` — override the CLI path (defaults to `PATH` lookup)
123+
- `ACP_GEMINI_TEST_ARGS` — extra flags forwarded during the smoke test
124+
- `ACP_ENABLE_GEMINI_TESTS=1` — opt-in toggle for `tests/test_gemini_example.py`
125+
126+
Authentication hiccups (e.g. missing `GOOGLE_CLOUD_PROJECT`) are surfaced but treated as skips during testing so the suite stays green on machines without credentials.

0 commit comments

Comments
 (0)