CLI
Generate type definitions and manage authentication
The Composio CLI helps you generate type-safe code and manage your Composio workspace.
Installation
Install the Composio CLI using the installation script:
curl -fsSL https://composio.dev/install | bashOr using wget:
wget -qO- https://composio.dev/install | bashAuthentication
Manage your Composio authentication directly from the terminal.
Login
Authenticate with your Composio account:
composio loginThis opens your browser to complete authentication and stores your API key locally.
To authenticate without opening a browser (useful for SSH/remote sessions):
composio login --no-browserThis displays a URL to manually open in your browser.
Check authentication status
Verify your current authentication:
composio whoamiThis displays your current API key or indicates if you're not authenticated.
Logout
Remove stored authentication:
composio logoutGenerate type definitions
Generate TypeScript or Python type definitions for all Composio tools. These types provide type safety when using direct tool execution (composio.tools.execute()), helping you pass the correct parameters and catch errors early.
Auto-detect and generate
The CLI auto-detects your project language. In your project directory:
composio generateFor TypeScript projects only, include individual tool types:
composio generate --type-toolsThe CLI automatically:
- Detects your project type (Python or TypeScript)
- Generates appropriate type definitions
Specify output directory
composio generate --output-dir ./my-typesLanguage-specific commands
For explicit control, use language-specific commands:
Basic generation:
composio ts generateGenerate as single file:
composio ts generate --compactInclude individual tool types:
composio ts generate --type-toolsGenerate both .ts and .js files:
composio ts generate --transpiledCustom output directory:
composio ts generate --output-dir ./my-typesBasic generation:
composio py generateCustom output directory:
composio py generate --output-dir ./my_types