Skip to main content
The composio login command authenticates your CLI with the Composio platform.

Usage

Authentication Modes

Browser-Based Login (Default)

Opens your browser for OAuth authentication:
Terminal output:
The CLI:
  1. Creates a CLI session
  2. Opens your browser to the login URL
  3. Polls for authentication completion
  4. Stores your credentials in ~/.composio/user-config.json

No-Browser Mode

For headless environments or SSH sessions:
Displays the login URL without opening a browser. Copy and paste the URL into a browser manually.

Non-Interactive Login

For CI/CD, automation, or agent environments:
All three flags are required together:
  • --api-key - Your user API key (starts with uak_)
  • --org-id - Organization ID
  • --project-id - Project nano ID (starts with pr_)
Non-interactive login validates credentials against the Composio API. If validation fails (400/401/403), the login will fail.

Options

boolean
default:"false"
Login without browser interaction. Displays the login URL without opening it.
string
API key for non-interactive login (agents/CI). Must be used with --org-id and --project-id.
string
Organization ID for non-interactive login. Must be used with --api-key and --project-id.
string
Project ID for non-interactive login. Must be used with --api-key and --org-id.

Examples

Interactive Login

Opens browser, authenticates, and stores credentials.

Headless Login

Displays URL for manual browser authentication.

CI/CD Login

Authenticates using environment variables (no browser required).

Scripted Login with JSON Output

The CLI outputs structured JSON to stdout for scripting:

Configuration Storage

Credentials are stored in ~/.composio/user-config.json:
The user-config.json file contains your API key. Keep it secure and never commit it to version control.

Session Scope

The login command creates a user-scoped session, which provides global credentials for all projects.

Multi-Project Support

The login flow enriches your credentials with organization and project metadata:
  1. OAuth flow completes and provides a user API key
  2. Session info API fetches org/project details
  3. Credentials stored for multi-tenant support

Troubleshooting

Already Logged In

If you’re already authenticated:
To log in with a different account, manually clear your credentials from ~/.composio/user-config.json and run composio login again.

Browser Doesn’t Open

If the browser fails to open automatically:
Use --no-browser and copy the URL manually.

Login Timeout

If authentication takes too long:
The CLI retries up to 15 times (about 75 seconds). If it times out, run composio login again.

Validation Errors (Non-Interactive)

For non-interactive login with invalid credentials:
Verify your API key, org ID, and project ID are correct.

Next Steps

whoami

Check your logged-in account

generate

Generate type-safe code