Skip to main content

Tutorial Source Code

Clone the repo and follow along: git clone https://github.com/markpollack/agent-client-tutorial.git

Learning Path

This tutorial takes you from zero to running real agent tasks. Each lesson builds on the previous one, progressing from simple file creation to multi-step git operations.
1

First Task

Create a file using an agent — the simplest possible task. Set up a project, configure a provider, and verify the result.Start Lesson 1 →
2

Multi-Provider

Run the same task with Claude, Codex, and Gemini. The client code stays the same — only the model construction changes.Start Lesson 2 →
3

Read and Transform

Read log files, count severity levels, and write a structured CSV summary. Agents working with existing files and producing structured output.Start Lesson 3 →
4

Git Operations

Find lost commits on a detached HEAD and merge them into master. Agents working with version control and multi-step reasoning.Start Lesson 4 →

Prerequisites

  • Java 17+
  • Maven 3.9+
  • At least one CLI agent installed:
    • Claude Code: npm install -g @anthropic-ai/claude-code
    • Codex CLI: npm install -g @openai/codex
    • Gemini CLI: npm install -g @google/gemini-cli

Source Code

All tutorial code is available in the agent-client-tutorial repository:
LessonDirectoryWhat it demonstrates
0101-create-file/Simplest task — create a file
02(doc-only)Multi-provider portability
0302-read-and-transform/File reading, data transformation, structured output
0403-git-operations/Git history inspection, merge recovery