pi-mono/packages/coding-agent/examples
Christian Klotz 25cc5c7bf4
docs(coding-agent): refresh documentation (#9898)
* docs(coding-agent): improve getting started documentation

* docs(coding-agent): correct getting started details

* docs(coding-agent): clarify SDK entry point

* docs(coding-agent): restructure guides and references

* docs(coding-agent): improve getting started guides

* docs(coding-agent): refresh integration guides

* docs(coding-agent): improve terminal and CLI guides

* docs(coding-agent): refresh customisation guides

* docs(coding-agent): clarify project trust terminology

* docs(coding-agent): simplify customisation guidance

* docs(coding-agent): improve runtime and reference guidance

* Fix settings reference

* feat(coding-agent): add Crowdin documentation sync

* docs(coding-agent): separate CLI and slash command references

* docs(coding-agent): correct compaction reference

* docs(coding-agent): streamline package documentation

* docs(coding-agent): split RPC reference documentation

* Update configuration docs

* Shorten config docs

* docs(coding-agent): refine configuration references

* docs(coding-agent): streamline settings reference

* docs(coding-agent): clarify configuration reference

* docs(coding-agent): clarify project trust exception

* docs(coding-agent): simplify keybindings reference

* docs(coding-agent): remove Crowdin integration

* docs(coding-agent): turn themes reference into guide

* docs(coding-agent): consolidate model and authentication docs

* docs(tui): require Component.invalidate() (fixes #9358)

* docs(coding-agent): document offline catalog behavior (fixes #8684)

* docs(coding-agent): preserve established documentation routes

* docs(coding-agent): reorganize documentation navigation

* docs(coding-agent): correct audited behavior

Clarify provider, session, local-model, Termux, TUI, SDK, debug, and extension behavior. Simplify the documentation audit to report only clear user-visible contradictions.

* docs(coding-agent): fix broken documentation links
2026-09-22 16:48:19 +02:00
..
extensions Release v0.87.0 2026-09-21 18:31:52 +02:00
plugins/pi-example-plugin feat: add transactional replicated state 2026-09-21 16:07:59 +02:00
sdk docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
README.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
rpc-client.ts docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
rpc-extension-ui.ts docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00

Examples

Example code for the pi-coding-agent SDK, process integration, and extensions.

CLI integration

rpc-client.ts uses the typed RpcClient to run Pi in a child process, stream events, and wait for the run to settle.

Build the coding-agent package before running it from a repository checkout:

npx tsx examples/rpc-client.ts "Explain this repository"

Directories

sdk/

Programmatic usage via createAgentSession(). Shows how to customize models, prompts, tools, extensions, and session management.

extensions/

Example extensions demonstrating:

  • Lifecycle event handlers (tool interception, safety gates, context modifications)
  • Custom tools (todo lists, questions, subagents, output truncation)
  • Commands and keyboard shortcuts
  • Custom UI (footers, headers, editors, overlays)
  • Git integration (checkpoints, auto-commit)
  • System prompt modifications and custom compaction
  • External integrations (SSH, file watchers, system theme sync)
  • Custom providers (Anthropic with custom streaming, GitLab Duo)

plugins/pi-example-plugin/

An experimental plugin package that Pi automatically builds into separate Session-worker and TUI Chord facets.

Documentation