mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
12 examples showing increasing levels of customization: - 01-minimal: all defaults - 02-custom-model: model and thinking level - 03-custom-prompt: replace or modify prompt - 04-skills: discover, filter, merge skills - 05-tools: built-in tools, custom tools - 06-hooks: logging, blocking, result modification - 07-context-files: AGENTS.md files - 08-slash-commands: file-based commands - 09-api-keys-and-oauth: API key resolution, OAuth config - 10-settings: compaction, retry, terminal settings - 11-sessions: persistence options - 12-full-control: replace everything Also exports FileSlashCommand type from index.ts
29 lines
755 B
Markdown
29 lines
755 B
Markdown
# Examples
|
|
|
|
Example code for pi-coding-agent.
|
|
|
|
## Directories
|
|
|
|
### [sdk/](sdk/)
|
|
Programmatic usage via `createAgentSession()`. Shows how to customize models, prompts, tools, hooks, and session management.
|
|
|
|
### [hooks/](hooks/)
|
|
Example hooks for intercepting tool calls, adding safety gates, and integrating with external systems.
|
|
|
|
### [custom-tools/](custom-tools/)
|
|
Example custom tools that extend the agent's capabilities.
|
|
|
|
## Running Examples
|
|
|
|
```bash
|
|
cd packages/coding-agent
|
|
npx tsx examples/sdk/01-minimal.ts
|
|
npx tsx examples/hooks/permission-gate.ts
|
|
```
|
|
|
|
## Documentation
|
|
|
|
- [SDK Reference](sdk/README.md)
|
|
- [Hooks Documentation](../docs/hooks.md)
|
|
- [Custom Tools Documentation](../docs/custom-tools.md)
|
|
- [Skills Documentation](../docs/skills.md)
|