@attrove/cli
The Attrove command-line interface for developers, local MCP clients, and agentic workflows.
It gives you:
- A global Attrove login for the current machine
- One-command MCP installation for Claude Desktop, Cursor, Claude Code, VS Code, and Windsurf
- Optional
.env export for project-local SDK work via env write
- Machine-readable setup and health checks for agents and CI
Quick Start
npx @attrove/cli login
npx @attrove/cli mcp install
npx @attrove/cli whoami
login opens a CLI-specific browser flow, completes sign-in, stores credentials globally, and can optionally wire up detected MCP clients.
Command Model
login
npx @attrove/cli login
Signs in through a browser flow that works for both new and existing users and stores the authenticated user globally.
If you are already logged in on this machine, login shows the active account and next steps instead of reopening the browser. Use --force to re-authenticate.
Use init only as a backwards-compatible alias:
npx @attrove/cli init
whoami
npx @attrove/cli whoami
npx @attrove/cli whoami --json
Shows:
- Where credentials are coming from (
global or local .env)
- Which profile is active
- Which MCP clients already have Attrove configured
mcp install
npx @attrove/cli mcp install
npx @attrove/cli mcp install cursor
npx @attrove/cli mcp install --all --json
Installs Attrove into detected MCP clients using global CLI auth. Secrets are not embedded into the client config.
mcp uninstall
npx @attrove/cli mcp uninstall
npx @attrove/cli mcp uninstall claude --json
Removes Attrove from supported MCP client configs.
env write
npx @attrove/cli env write
npx @attrove/cli env write ./apps/example --json
Writes ATTROVE_SECRET_KEY and ATTROVE_USER_ID to a project-local .env.
doctor
npx @attrove/cli doctor
npx @attrove/cli doctor --json
Checks:
- CLI version (with update notification)
- Credential availability
- Authenticated API connectivity
- Detected MCP client configuration
The command exits with status 1 if any check reports an issue.
logout
npx @attrove/cli logout
npx @attrove/cli logout --json
Removes:
- Global Attrove credentials
- The current project
.env credentials, if present
- Attrove MCP entries from detected clients
Agent / CI Flow
Create a browser-auth session:
npx @attrove/cli login --json
That prints a single JSON object:
{
"type": "attrove_cli_setup_session",
"version": 1,
"status": "awaiting_browser_auth",
"sessionId": "...",
"pollToken": "...",
"authorizeUrl": "...",
"expiresAt": "...",
"pollIntervalMs": 2000
}
After the user completes sign-in, resume the session:
npx @attrove/cli login --json --session-id <id> --poll-token <token>
To keep polling until completion:
npx @attrove/cli login --json --wait --session-id <id> --poll-token <token>
On success:
{
"type": "attrove_cli_setup_status",
"version": 1,
"status": "complete",
"sessionId": "...",
"expiresAt": "...",
"completedAt": "...",
"secretKey": "sk_...",
"userId": "...",
"userEmail": "..."
}
Machine-readable follow-up commands:
npx @attrove/cli whoami --json
npx @attrove/cli mcp install --json
npx @attrove/cli env write --json
npx @attrove/cli doctor --json
npx @attrove/cli logout --json
Global Auth Store
The CLI stores credentials globally and treats that store as the source of truth.
When available, the secret key is stored in the platform credential store:
- macOS: Keychain
- Linux: Secret Service via
secret-tool
- Windows: DPAPI-protected local secret file
If secure storage is unavailable, the CLI falls back to the metadata file below
with restricted permissions.
Default config locations:
- macOS:
~/Library/Application Support/Attrove/config.json
- Linux:
~/.config/attrove/config.json
- Windows:
%APPDATA%/Attrove/config.json
Overrides:
ATTROVE_CONFIG_DIR
ATTROVE_PROFILE
Supported MCP Clients
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json |
| Claude Code | ~/.claude.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| VS Code | ~/Library/Application Support/Code/User/mcp.json |
Paths shown are for macOS. The CLI resolves Windows and Linux paths automatically.
Environment Overrides
ATTROVE_API_ORIGIN or ATTROVE_BASE_URL
ATTROVE_DASHBOARD_ORIGIN
ATTROVE_CONFIG_DIR
ATTROVE_PROFILE
Notes