**Stacked on #3927** (A1 — direct-to-PostHog + install→Apollo identity). Targets that branch; will auto-retarget to `next` when #3927 merges. Review only this diff. ## What Makes every CLI event self-describe its funnel stage, so the adoption funnel can be queried without string-matching event names — which is how it silently broke in the first place. - **`journey_stage`** on every event: `install | setup | login | connect | execute | other`. Declared as an exported typed const plus a single exhaustive map, `as const satisfies Record<CliAnalyticsEventName, CliJourneyStage>` — so **the compiler refuses to build if a future event has no stage**. No per-event literals; stamped in one shared builder. - **`cli_channel`** alongside `cli_version`, reusing the existing `inferSkillReleaseChannel()` / `CLI_RELEASE_CHANNELS`. Makes "did this fix reach stable users?" answerable — the question that went unanswered in the 0.2.30 assetless-release incident. - **Installer origin fix:** `install.sh` ran `"$exe" install` *without* `COMPOSIO_CLI_INVOCATION_ORIGIN=installer` (the `setup` call on line 410 had it), so a genuine install was indistinguishable from a user running `composio install` by hand. Now tagged, with a regression test that reads `install.sh` and asserts it. ## Stage mapping (reviewed against 30d volume) `install` = `CLI_INSTALL_*` · `setup` = `CLI_SETUP_*` + `CLI_PLUGIN_*` · `login` = `CLI_LOGIN_*` · `connect` = `CLI_LINK_*` · `execute` = `CLI_EXECUTE_*` + `CLI_TOOL_INVOCATION_*` · `other` = `CLI_COMMAND_*`, `CLI_SEARCH_*`, `CLI_PROXY_*`, `CLI_RUN_*`, `CLI_LOGOUT_*` Judgment calls, made with data rather than by default: - **`proxy` → `other`.** 2,060 of 2,140 proxy users (96%) already execute; only 80 are proxy-only. Reclassifying would move the activated cohort ~1%, so `execute` stays precisely "tool execution". - **`run` → `other`.** `run` children emit their own execute events carrying `parent_run_id`; staging the parent as `execute` would double-count. - **`search` → `other`.** Not a required funnel stage. Candidate for a "discovery" step later if the flow page wants one. ## Note for whoever builds the flow page `CLI_TOOL_INVOCATION_*` and `CLI_EXECUTE_FAILED` can both fire for a single failure, so the `execute` stage **double-counts at the event level**. Count **distinct users per stage**, not events. ## Known coverage limit npm and Homebrew installs don't run `install.sh`, so they emit no `CLI_INSTALL_*`. The `install` stage means "installed via install.sh", not all installs. ## Verification `pnpm typecheck` clean · `validate:boundaries` OK (46 disables, **zero added**) · CLI suite **107 files / 971 passed** (+15 tests) · `dispatch.ts` identity/transport untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
composio.dev • Documentation • Quickstart • Changelog
Composio
Composio gives your AI agents 1000+ pre-authenticated toolkits, per-user sessions, authentication, triggers, and a sandbox, so you can ship agents that turn intent into action.
This is the Composio SDK monorepo. It contains:
@composio/core: TypeScript SDKcomposio: Python SDKcomposioCLI: search, execute, and script tools from your shell- Provider adapters for OpenAI Agents, Claude Agent SDK, Vercel AI SDK, LangChain, and more
Quickstart
Create a session for a user, hand its tools to your agent, and let the agent take action across 1000+ apps. Grab a COMPOSIO_API_KEY from the dashboard first.
TypeScript
npm install @composio/core @composio/openai-agents @openai/agents
@composio/coreintentionally packages its TypeScript source and SDK docs so the installed package is inspectable to coding agents. If you want a smaller install with the same API, use@composio/slim.
import { Composio } from "@composio/core";
import { OpenAIAgentsProvider } from "@composio/openai-agents";
import { Agent, run } from "@openai/agents";
const composio = new Composio({ provider: new OpenAIAgentsProvider() });
// Each session is scoped to one of your users
const session = await composio.create("user_123");
const tools = await session.tools();
const agent = new Agent({
name: "Personal Assistant",
instructions: "You are a helpful assistant. Use Composio tools to take action.",
tools,
});
const result = await run(agent, "Summarize my emails from today");
console.log(result.finalOutput);
Python
pip install composio composio-openai-agents openai-agents
from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner
composio = Composio(provider=OpenAIAgentsProvider())
# Each session is scoped to one of your users
session = composio.create(user_id="user_123")
tools = session.tools()
agent = Agent(
name="Personal Assistant",
instructions="You are a helpful assistant. Use Composio tools to take action.",
tools=tools,
)
result = Runner.run_sync(starting_agent=agent, input="Summarize my emails from today")
print(result.final_output)
By default a session gets meta tools that discover, authenticate, and execute app tools at runtime, so you don't load hundreds of tool definitions into context. Store session.session_id and reuse it with composio.use() across turns. See what a session is and configuring sessions for restricting toolkits, auth configs, and connected accounts.
Prefer MCP? Every session also exposes a hosted MCP endpoint. Pass mcp: true to composio.create() and point Claude, Cursor, or any MCP client at session.mcp.url. See sessions via MCP.
CLI
The composio CLI runs Composio from your shell and gives coding agents like Claude Code a local tool surface.
curl -fsSL https://composio.dev/install | bash
composio login
Use composio search to find tools, composio execute to run them, composio link to connect accounts, and composio run to script workflows in TypeScript. See the CLI docs.
Providers
A provider adapts Composio tools to your agent framework's native tool format:
| Provider | TypeScript | Python |
|---|---|---|
| OpenAI | @composio/openai |
composio-openai |
| OpenAI Agents | @composio/openai-agents |
composio-openai-agents |
| Anthropic | @composio/anthropic |
composio-anthropic |
| Claude Agent SDK | @composio/claude-agent-sdk |
composio-claude-agent-sdk |
| Vercel AI SDK | @composio/vercel |
— |
| Google GenAI | @composio/google |
composio-gemini, composio-google |
| Google ADK | — | composio-google-adk |
| LangChain | @composio/langchain |
composio-langchain |
| LangGraph | via @composio/langchain |
composio-langgraph |
| LlamaIndex | @composio/llamaindex |
composio-llamaindex |
| Mastra | @composio/mastra |
— |
| Pi | @composio/experimental* |
— |
| Cloudflare Workers AI | @composio/cloudflare |
— |
| CrewAI | — | composio-crewai |
| AutoGen | — | composio-autogen |
* The Pi provider is experimental and ships from @composio/experimental.
Don't see your framework? Build a custom provider, or skip providers entirely and connect over MCP.
All packages
Everything published from this repo:
| Package | Description |
|---|---|
@composio/core |
TypeScript SDK |
@composio/slim |
@composio/core without packaged source or docs; same API, smaller install |
composio CLI |
Standalone CLI binary: curl -fsSL https://composio.dev/install | bash |
@composio/experimental |
Experimental integrations, including the Pi provider |
@composio/json-schema-to-zod |
JSON Schema to Zod conversion |
@composio/* provider adapters |
OpenAI, OpenAI Agents, Anthropic, Claude Agent SDK, Vercel, Google, LangChain, LlamaIndex, Mastra, Cloudflare |
composio |
Python SDK |
composio-* provider adapters |
OpenAI, OpenAI Agents, Anthropic, Claude Agent SDK, Gemini, Google, Google ADK, LangChain, LangGraph, LlamaIndex, CrewAI, AutoGen |
Repository layout
ts/ TypeScript SDK workspace
packages/core/ @composio/core
packages/providers/ Provider adapters
packages/cli/ Composio CLI
python/ Python SDK and provider packages
docs/ Documentation site (docs.composio.dev)
The TypeScript SDK is tested against Node 22+; the Python SDK supports Python 3.10+.
Development
mise install # pinned toolchain (Node, Python, pnpm)
pnpm install
pnpm build
pnpm test
Python commands run from python/; see python/README.md. We welcome contributions to both SDKs; read the contribution guidelines before submitting pull requests.
Support
License
MIT. See LICENSE.