Scripts, pipes & CI
The CLI composes like any other command-line tool: stdin in, stdout out, JSON when you want structure. Every example below runs headless — no prompt, no interaction.
Piping context in
Piped mode reads stdin as the prompt's context. A few patterns that come up constantly:
# Review a diff before you push
git diff | tempr "review this change for bugs and missing tests"
# Explain a failure from your build log
cat build.log | tempr "why did this fail? cite the relevant lines"
# Summarize a file without opening it
cat ./src/Payment/PaymentRequest.cs | tempr "add XML doc comments"One-shot agent turns
Piping is for context; for tasks that should do something, give the agent the goal directly. In scripts, add -y so tool calls don't wait for approval:
tempr -y "fix the failing test in CartServiceTests and run the suite"-y/--yolo auto-approves every tool call — file edits and whitelisted commands included. Use it for scoped tasks in workspaces you control, the same way you'd pipe a script into sh.
The JSON event stream
Add --json to any run to get newline-delimited JSON instead of formatted text — one event per line, machine-readable:
tempr --json -y "list the public types in this project" \
| grep '"type":"assistant-done"' \
| tail -n 1Event types cover the full agent lifecycle: assistant-start, assistant-delta, assistant-done, tool-call-start, tool-call-done, and iteration-limit-reached. Stream it, filter it, or tee it to a log — each line is a standalone JSON object.
Resuming sessions
Every run is saved automatically. List them, then pick one back up — the full conversation context comes with it:
tempr history
tempr --id <SESSION_ID> "continue — apply the same fix to CheckoutTests"In CI
The same pieces — one-shot run, auto-approve, JSON output — compose into pipeline steps. A minimal GitHub Actions job:
name: tempr-review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- run: dotnet tool install -g Tempr.Cli
- run: tempr auth "${{ secrets.TEMPR_LICENSE_KEY }}"
- run: git diff origin/main... | tempr --json -m <model-id> "review this PR"- Store your license key as a repository secret — never inline it.
- Pass
-m <model-id>explicitly so the run doesn't depend on a machine-local default. - Keep the task read-only (review, summarize, triage) unless the workspace is disposable — CI is exactly where
-ydeserves a second thought.
Next steps
- CLI command reference — every command, flag, and REPL shortcut.
- Agent modes & personas — scope a run with a specialist persona.
- Providers & BYOK — which keys and models the CLI can use.