## Summary `composio --version`: 622ms to 408ms. Eager module evaluation: 364ms to 130ms. `commands/index.ts` builds the root command tree from every `.cmd.ts`, so evaluating one command evaluated all of them. Two of them reached the TypeScript compiler and the code generation pipeline at module scope. `composio execute` paid ~165ms for a compiler it never called. Stacked on #4464. Review #4463 and #4464 first. Bun 1.4.1+4661e494f, linux-x64, best of 7, analytics disabled, same script before and after: | | before | after | |---|---|---| | `composio --version` | 622ms | 408ms | | module evaluation | 363.8ms | 130.0ms | | `commands/run.cmd` | 155.8ms | 8.0ms | | `commands/generate` | 63.5ms | 2.5ms | ## Changes `Command.withHandler` runs lazily, so moving an import inside a handler body defers it. Specs, flags, descriptions and subcommand wiring still resolve eagerly, so parsing, help and "did you mean" suggestions cannot change. 1. `run.cmd.ts` was the only consumer of `import ts from 'typescript'`, through three source rewrites `composio run` applies to a user script. They move to `run-source-transforms.ts`, which the handler imports dynamically. Tests import from the new path. 2. `ts.generate.cmd.ts` and `py.generate.cmd.ts` pulled `src/generation/*` at module scope. Both resolve it inside the handler now, right before first use. These use `Effect.promise`, not `Effect.tryPromise`. A rejected import of a module bundled into this binary is a broken build, not a recoverable failure. ## Type of change - [ ] Bug fix - [ ] New feature - [x] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? Bun 1.4.1+4661e494f, Node 24.17.0, pnpm 11.8.0, linux-x64. 1. Built the binary before and after and diffed stdout, stderr and exit code across 11 invocations: `--help` at root and for generate, generate ts, generate py, run, tools and execute, plus `version`, `--version`, an unknown command and an unknown flag. Identical. The error paths are there on purpose; they exercise the parser and the suggestion code, where a shifted tree would show first. 2. `pnpm run typecheck && pnpm run validate:boundaries && pnpm run validate:skills` 3. `pnpm test`: 1326 passed, 1 skipped, 1 failed. The failure is `test/src/cli-main.test.ts`, which spawns the CLI from source against a 15s timeout and takes ~24s in this container. It fails the same way on the parent commit (25.6s and 25.2s there, 24.5s and 24.3s here). Reproduce: `cd ts/packages/cli && pnpm build:binary && time ./dist/composio --version`. After rebasing onto the updated #4463 and #4464: `pnpm run typecheck` passes, and the `run`, `generate ts`, `generate py` and `execute` suites pass (120 passed, 1 skipped). The code in this PR is unchanged. ## Screenshots (if applicable) Not applicable. ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [ ] I updated documentation as needed - [ ] I added tests or explain why not applicable - [ ] I added a changeset if this change affects published packages No docs describe module loading order. No new tests; the existing suite covers the moved functions, and the 11-invocation diff covers what this could break. A test asserting the module is not loaded eagerly would be good to have; #4469 adds a build-time check instead. `@composio/cli` is private, so no changeset. ## Additional context ~130ms of eager evaluation remains. `services/agents` is 98ms of it: Effect `Schema` definitions built at module scope. It cannot be deferred as-is because `effects/handle-agent-auth-error.ts` narrows with `error instanceof AgentAuthError` and six handlers depend on it. That is a separate change. The ~235ms pre-main bundle parse is unaffected. It scales with bundle size, and a dynamic import keeps the module in the bundle. A binary that bundles everything but runs only `console.log` still costs ~235ms. #4469 moves the code out of the bundle. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EzaE7oGVgziJ5nRvBhcci2
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 | sh
The installer puts composio on your PATH for future terminals. Open a new terminal, then run composio login. See INSTALL.md for shell setup overrides, including COMPOSIO_INSTALL_SHELL=none for install-only runs.
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 | sh |
@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.