Progressive examples for Agent Client — a portable Java API for autonomous CLI agents (Claude Code, Codex, Gemini).
Full tutorial with explanations: lab.pollack.ai/docs/agent-client/tutorial
git clone https://github.com/markpollack/agent-client-tutorial.git
cd agent-client-tutorial
# Run with Claude (default)
./mvnw spring-boot:run -pl 01-create-file
# Run with Codex
./mvnw spring-boot:run -pl 01-create-file -Dspring.profiles.active=codex
# Run with Gemini
./mvnw spring-boot:run -pl 01-create-file -Dspring.profiles.active=gemini| # | Directory | What It Demonstrates | Docs |
|---|---|---|---|
| 01 | create-file | Simplest task — create a file with all three providers | Lesson 1 |
| 02 | read-and-transform | Read log files, count severities, write CSV | Lesson 3 |
| 03 | git-operations | Find lost commits, merge into master | Lesson 4 |
- Java 17+
- At least one CLI agent installed and authenticated:
| Provider | Install | Auth |
|---|---|---|
| Claude Code | npm install -g @anthropic-ai/claude-code |
claude auth login |
| OpenAI Codex | npm install -g @openai/codex |
Set OPENAI_API_KEY |
| Gemini CLI | npm install -g @google/gemini-cli |
Set GOOGLE_API_KEY |