composio-x-pi
Pi extension that exposes Composio-backed runtime and authoring tools.
Package details
Install composio-x-pi from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:composio-x-pi- Package
composio-x-pi- Version
0.0.11- Published
- Jun 2, 2026
- Downloads
- 575/mo · 41/wk
- Author
- tridha643
- License
- MIT
- Types
- extension
- Size
- 11 MB
- Dependencies
- 2 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
Composio x Pi Extension
Pi package that installs a Pi extension for Composio-backed runtime and trigger-authoring tools.
Install
Install the published npm package with Pi:
pi install npm:composio-x-pi
For a pinned version:
pi install npm:composio-x-pi@0.0.1
During development, install from a local checkout:
cd /path/to/composio-x-pi
bun install
pi install /path/to/composio-x-pi
Try the extension for one Pi run without adding it to settings:
pi -e /path/to/composio-x-pi/src/index.ts
After editing an installed local checkout, use /reload inside Pi.
Publishing
This package is intended to be installed through Pi's npm package source, so releases should be published to npm under the composio-x-pi package name:
bun run test
bun run typecheck
bun run build
npm publish
Setup
No setup is required by default. The agent provisions a Composio identity for you on first tool use via the composio_signup tool. When a Composio tool fails with a missing-credentials error, the model is instructed to call composio_signup, which talks to https://agents.composio.dev/api/signup and writes the returned credentials to ~/.composio/anonymous_user_data.json (mode 0600).
If you already have a Composio API key, you can override the auto-provisioned signup credentials:
/composio-init
The command prompts for your key and stores it in ~/.pi/agent/extensions/composio-x-pi.json with file mode 0600. You can also pass the key as an argument (/composio-init <key>), but the interactive prompt avoids leaving the key in chat history.
Credential precedence:
COMPOSIO_API_KEYenvironment variable/composio-initstored API keycomposio_signupanonymous credentials
To later hand the auto-provisioned organization over to a human admin, either run /composio-claim <email> or ask the agent to call the composio_claim tool. Composio sends a 24-hour single-use invite to that email.
Optional environment variables:
COMPOSIO_USER_ID— defaults todefaultwhen omitted.
Commands
/composio-init— securely prompt for and store the Composio API key used by this extension./composio-claim <email>— hand the auto-provisioned Composio org to a human admin (sends a 24-hour invite to the email).
Tools
All tools are registered by default:
composio_debug_infocomposio_signupcomposio_claimcomposio_search_toolscomposio_get_tool_schemascomposio_execute_toolcomposio_manage_connectionscomposio_multi_execute_toolcomposio_remote_bash_toolcomposio_remote_workbenchcomposio_list_trigger_typescomposio_get_trigger_type_schemacomposio_create_triggercomposio_list_triggerscomposio_delete_triggersave_automation_definition
The multi-execute and remote-workbench tools are thin meta-tool wrappers: pass the raw JSON arguments expected by the corresponding COMPOSIO_* meta tool/schema.
Automation JSON handoff
save_automation_definition writes automation metadata for the host application to read.
By default it writes to Pi's global Composio automation handoff file:
~/.config/pi/composio-automations.json
Set PI_COMPOSIO_AUTOMATIONS_JSON to override the global handoff path. Passing filePath to the tool still writes a specific JSON file for that call.
The file contains a JSON array of automation definitions and the tool upserts by triggerId.
Local scripts
bun testbun run test:e2ebun run typecheckbun run buildbun run test:integrationbun run test:e2e:signupbun run dev:pi
bun run dev:pi loads the extension from src/index.ts through Pi's embedding API.
Verification
Automated checks before handoff or release:
bun run test
bun run test:e2e
bun run typecheck
bun run build
bun run test:e2e is deterministic: it loads src/index.ts through Pi's SDK in an isolated HOME sandbox, verifies registered tools/commands, executes non-network tools, and exercises /composio-init without contacting Composio.
Live signup e2e (depends on the external agents.composio.dev service):
bun run test:e2e:signup
Integration test with real Composio credentials/config:
COMPOSIO_API_KEY_TEST=...
COMPOSIO_TEST_TRIGGER_SLUG=...
COMPOSIO_TEST_TRIGGER_CONFIG_JSON='...'
# Optional: bind to a known active connected account/alias/word id.
COMPOSIO_TEST_ACCOUNT=ca_...
bun run test:integration
Manual Pi smoke test:
- Start Pi with the local extension:
pi -e ./src/index.ts - Ask the agent to run any Composio tool; it will call
composio_signupautomatically on first use. Or run/composio-initto store an existing Composio API key. - Run
composio_debug_infoand confirm runtime plus authoring tools are listed (andapiKeySourceis"signup","stored", or"env"depending on setup). - Run
composio_list_trigger_typesandcomposio_get_trigger_type_schemafor a known trigger. - Create a test trigger with
composio_create_trigger. - Confirm it appears via
composio_list_triggers. - Save the automation handoff with
save_automation_definition. - Confirm
~/.config/pi/composio-automations.json(orPI_COMPOSIO_AUTOMATIONS_JSON) contains the expected automation and the host app can read it. - Clean up with
composio_delete_trigger.
Webhook/ngrok delivery verification belongs to the host app: start the app receiver, expose it through ngrok, create/configure the Composio trigger for that URL, cause a real event, and confirm the app receives it.