pi-opensync-plugin
Pi extension to sync sessions to OpenSync dashboards
Package details
Install pi-opensync-plugin from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-opensync-plugin- Package
pi-opensync-plugin- Version
0.3.0- Published
- Apr 4, 2026
- Downloads
- 177/mo · 9/wk
- Author
- joshthomas
- License
- MIT
- Types
- extension
- Size
- 131.3 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-opensync-plugin
A pi coding agent extension that syncs sessions to OpenSync dashboards.
Requirements
- pi >= 0.65.0
- OpenSync account (hosted or self-hosted) and API key
Features
- Real-time sync: Sessions and messages sync as you work
- Fork support: Forked sessions create new OpenSync sessions with
[Fork::parentId]prefix - Configurable: Choose what to sync (tool calls, thinking content)
- Non-intrusive: Silent failures, optional debug logging
Installation
Install as a pi package globally:
pi install npm:pi-opensync-plugin
For project-local installation (auto-installs for teammates), use the -l flag when calling pi install:
pi install -l npm:pi-opensync-plugin
To try without installing, pass the -e flag to temporarily add it to your extensions for the duration of a session:
pi -e npm:pi-opensync-plugin
For any of the above commands, you can also use the repository URL in place of the NPM package to install:
pi install git:github.com/joshuadavidthomas/pi-opensync-plugin
# or the full URL
pi install https://github.com/joshuadavidthomas/pi-opensync-plugin
For manual installation, clone the repository to any place pi coding agent looks for extensions:
git clone https://github.com/joshuadavidthomas/pi-opensync-plugin ~/.pi/agent/extensions/pi-opensync-plugin
Configuration
Once installed, run /opensync:config in pi to interactively configure the extension. At a minimum, the Convex URL and API key from OpenSync is required -- both can be found on the settings page.
The config file is located at ~/.config/pi-opensync-plugin/config.json.
Available Options
| Config File | Environment Variable | Description | Default | Required? |
|---|---|---|---|---|
apiKey |
PI_OPENSYNC_API_KEY |
Your OpenSync API key (osk_...) | ✅ | |
autoSync |
PI_OPENSYNC_AUTO_SYNC |
Enable automatic syncing | true |
|
convexUrl |
PI_OPENSYNC_CONVEX_URL |
OpenSync Convex deployment URL | ✅ | |
debug |
PI_OPENSYNC_DEBUG |
Enable debug logging | false |
|
syncThinking |
PI_OPENSYNC_THINKING |
Include thinking content | false |
|
syncToolCalls |
PI_OPENSYNC_TOOL_CALLS |
Sync tool calls | false |
How It Works
The extension listens to pi's lifecycle events and syncs data to OpenSync:
- Session Start: Creates a new session in OpenSync with project info
- User Input: Syncs each user message in real-time
- Assistant Response: Syncs assistant messages with token usage
- Session End: Finalizes the session with duration and totals
Fork Handling
When you fork a session in pi (/fork), the extension:
- Creates a new OpenSync session with title prefix
[Fork::parentId] - Batch-syncs all existing messages from the fork point
- Continues real-time syncing for new messages
This means forked sessions contain the complete conversation history, which is intentional for traceability.
Development
bun install # Install dependencies
bun run test # Run tests
bun run test:watch # Run tests in watch mode
bun run typecheck # Type check
License
pi-opensync-plugin is licensed under the MIT license. See the LICENSE file for more information.