Skip to main content

Pi Local

The pi_local adapter runs the Pi coding agent locally. It supports provider/model routing, session resume, bundle-based instructions, and Baton-managed project-context injection.

Prerequisites

  • Pi CLI installed (pi command available)
  • a configured Pi provider/model environment

Configuration Fields

FieldTypeRequiredDescription
cwdstringYesWorking directory for the agent process (absolute path; created automatically if missing when permitted)
modelstringYesPi model ID in provider/model format
instructionsFilePathstringNoAbsolute path to the bundle entry file appended to Pi's system prompt
promptTemplatestringNoUser prompt template passed to Pi
thinkingstringNoThinking level (off, minimal, low, medium, high, xhigh)
commandstringNoCLI executable name (defaults to pi)
envobjectNoEnvironment variables (supports secret refs)
timeoutSecnumberNoRun timeout in seconds
graceSecnumberNoGrace period before force-kill

Session Persistence

Pi local stores Baton-managed sessions and resumes them with --session across heartbeats.

Tooling Model

Pi exposes its own local tool set for file and shell operations. Baton orchestrates the run and captures logs, status, and usage.

Instructions And Project Context

Pi local receives:

  • the bundle entry file through instructionsFilePath
  • composed project instructions generated from project conventions and governance reminders

This keeps reusable role behavior separate from project-specific context.

Environment Test

Use the UI environment test to verify:

  • Pi CLI is installed
  • the configured model is valid
  • the working directory is available
  • the CLI can complete a simple probe successfully