Prerequisites
- Java 17 or later
- Maven 3.8+ (or use the included
./mvnwwrapper) - For client modules (01-11, 21): Gemini CLI with
--experimental-acpflag, and aGEMINI_API_KEY. The tutorial uses Gemini as a real ACP agent to talk to — the SDK launches it as a subprocess and communicates over stdin/stdout. - For agent modules (12-19, 22): no external dependencies. You build the agent and the tutorial provides a test client that launches it.
Tutorial Structure
| Part | Modules | Topics |
|---|---|---|
| 1. Client Basics | 01-11 | Connect, sessions, prompts, streaming, updates, file handlers, permissions, resume, cancel, errors |
| 2. Building Agents | 12-19 | Echo agent, handlers, updates, requests, testing, capabilities, terminal, MCP |
| 3. Advanced | 21-22 | Async client, async agent (Project Reactor) |
| 4. IDE Integration | 28-30 | Zed, JetBrains, VS Code |
Getting the Code
Running a Module
Agent modules run locally with no API key:GEMINI_API_KEY:
Three Agent API Styles
The SDK provides three ways to build agents:| Style | Entry Point | Programming Model |
|---|---|---|
| Annotation-based | @AcpAgent, @Prompt | Declarative, least boilerplate |
| Sync | AcpAgent.sync() | Blocking handlers, plain return values |
| Async | AcpAgent.async() | Reactive, Project Reactor Mono |