Examples
Five examples, each in its own directory in the
repo. Every
example is a single command. pugmark run --start ... creates the session, the
handler self-bootstraps from an empty log, runs to completion, and pauses.
Build the CLI and install the SDK once:
go build -o /tmp/pugmark ./cmd/pugmark
pip install -e ./pugmark-py # or: pip install pugmark
| # | Example | LLM key? | What it shows |
|---|---|---|---|
| 1 | hello | no | Minimal smoke test that seeds an input event and appends an uppercased echo |
| 2 | go-handler | no | The same shape in Go; proves Go is a first-class handler language |
| 3 | react-tool-agent | yes | The hero: a bare-bones tool-using ReAct agent in ~80 lines |
| 4 | multi-step-workflow | yes | A deterministic N-step research pipeline (no tools) |
| 5 | lambda-deploy | yes + AWS | Ship the react agent to AWS Lambda via terraform |
What every handler has in common
However different the five look, the handler underneath makes the same three moves: it replays the log into whatever state it needs, picks a single next event by looking at the most recent one, and appends it. Crash partway through and re-running carries on from where it stopped. Fork at any point, drop in a different event, and the branch continues from there.
- hello โ The canonical handler shape in one match block, no LLM required.
- go-handler โ The same log-replay shape in Go, using only the pugmark/ipc package. No LLM, no API key.
- react-tool-agent โ The hero example: a bare-bones tool-using ReAct agent in ~80 lines, with crash-resume and fork-mid-run.
- multi-step-workflow โ A deterministic N-step research pipeline. What pugmark looks like without a tool-using react loop.
- lambda-deploy โ Ship the same react-agent code to AWS Lambda via terraform. The handler never changes, the runtime moves.