Plugin System
Code CLI supports plugins that extend its capabilities with custom tools, authentication flows, permission checks, and more.
Plugin Types
| Type | Description | Example |
|---|---|---|
| npm package | Published npm module | @poly/codecli-plugin-jest |
| Local file | JavaScript/TypeScript module on disk | ./plugins/my-plugin.ts |
Plugin Hooks
| Hook | Description |
|---|---|
| auth | Custom authentication flow for a provider |
| tool | Register a new tool the agent can use |
| internalTool | Internal tools not exposed to the agent |
| permission | Custom permission checks |
Configuration
Creating a Plugin
Plugins export a factory function that receives the Code CLI API and returns an object with hook implementations: