In about ten minutes you'll start the stack, preview a change, apply it, inspect the audit log and undo it. You need Docker with Compose v2 and about 4 GB of free RAM. An NVIDIA GPU is optional but makes requests about 10× faster.
cp .env.example .env
docker compose up -dThe first start pulls qwen2.5:3b (about 2 GB). Wait until the assistant is healthy:
curl -s localhost:7000/health
# {"status":"healthy","circuit_breaker":"closed"}alias ppatch="python3 $(pwd)/cli/ppatch.py"
ppatch "lower the orders cpu limit to 80%"app: orders
~ /workload/container/resources/cpu/limitMilliCPU: 500 → 400
preview only, re-run with --apply to save
Nothing is saved yet. The model returned "80%" and code computed 80% of 500.
ppatch "lower the orders cpu limit to 80%" --applyThe output is the same diff, followed by saved as revision #1.
ppatch history orders#1 2026-11-23T10:15:02+00:00 you lower the orders cpu limit to 80%
~ /workload/container/resources/cpu/limitMilliCPU = 400
ppatch undo ordersreverted #1 as revision #2
~ /workload/container/resources/cpu/limitMilliCPU = 500
ppatch "make orders faster"The command exits with code 1 and a one-line reason. The request names no field and no value, so there's nothing grounded to change. That refusal is deliberate: see why values must come from the request.
cli/ppatch.py is a single file that uses only the Python standard library. Use it as an alias, or link it onto your PATH:
alias ppatch="python3 $(pwd)/cli/ppatch.py" # this shell
ln -s "$(pwd)/cli/ppatch.py" ~/.local/bin/ppatch # every shell (it has a shebang)| Command | Effect |
|---|---|
ppatch "<request>" |
Preview: print the diff, save nothing. |
ppatch "<request>" --apply |
Save the change and print its revision. |
ppatch history APP [--limit N] |
Audit log, newest first. N is 1–500, default 20. |
ppatch undo APP |
Revert the latest change. |
--author NAME works with every command and may come before or after it. The default is your OS user name, or anonymous if there isn't one.
Output. ~ marks a replaced value (old → new), + an added one, - a removed one, and = path (already set) a field that already had the requested value. Colors appear only on a TTY.
Environment. PPATCH_URL sets the assistant's base URL (default http://localhost:7000). A trailing slash is fine.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | The server answered with an error, couldn't be reached, or returned something unexpected. One-line message, no traceback. |
| 2 | Usage error (argparse). |
Everything the CLI does is one HTTP call to the assistant:
curl -s localhost:7000/edits -H 'Content-Type: application/json' \
-d '{"text": "lower the orders cpu limit to 80%"}' # preview
curl -s localhost:7000/edits -H 'Content-Type: application/json' \
-d '{"text": "lower the orders cpu limit to 80%", "apply": true, "author": "you"}'
curl -s localhost:7000/history/orders
curl -s -X POST "localhost:7000/undo/orders?author=you"Every field, response and status code is listed in api.md.