@attrove/cli
v0.1.9
Published
CLI for Attrove — sign up, configure MCP servers, and manage credentials
Maintainers
Readme
@attrove/cli
The Attrove command-line interface for hosted MCP installs, CLI auth, and advanced local fallback workflows.
It gives you:
- Hosted MCP install commands for Claude Code, Cursor, and Claude Desktop
- A global Attrove login for SDK, agent, CI, and local stdio fallback flows
- Optional
.envexport for project-local SDK work viaenv write - Machine-readable setup and health checks for agents and CI
Quick Start
Hosted MCP (recommended)
npx @attrove/cli install claude-codeThat writes a hosted MCP config pointing at https://api.attrove.com/mcp.
Open Claude Code, Cursor, or Claude Desktop and complete OAuth on first use.
No sk_ secret is embedded into the client config.
Other supported hosted installs:
npx @attrove/cli install cursor
npx @attrove/cli install claude-desktopDefaults:
claude-codeinstalls to project scope (.mcp.json)cursorinstalls to user scopeclaude-desktopinstalls to user scope
--scope project is only valid for claude-code; other clients reject it
with a clear error.
Advanced Local Fallback
npx @attrove/cli login
npx @attrove/cli local install claude-code
npx @attrove/cli whoamiUse this only if you intentionally want the local stdio server. It reuses globally stored CLI credentials or falls back to embedded ATTROVE_* env config.
Command Model
install
npx @attrove/cli install claude-code
npx @attrove/cli install cursor
npx @attrove/cli install claude-desktop
npx @attrove/cli install claude-code --scope user
npx @attrove/cli install claude-code --jsonWrites hosted remote MCP config for supported clients. This is the default onboarding path.
local install / local uninstall
npx @attrove/cli local install [client|--all]
npx @attrove/cli local uninstall [client|--all]
npx @attrove/cli local install claude-code --jsonConfigures or removes the advanced local stdio fallback for supported clients. login is required before local install.
login
npx @attrove/cli login
npx @attrove/cli login --forceSigns in through a browser flow and stores the authenticated user globally. This is primarily for SDK, agent, CI, and advanced local MCP workflows.
Use init only as a backwards-compatible alias:
npx @attrove/cli initwhoami
npx @attrove/cli whoami
npx @attrove/cli whoami --jsonShows:
- Where credentials are coming from (
globalor local.env) - Which profile is active
- Which MCP clients already have Attrove configured
connect
npx @attrove/cli connect --session <session-id>
npx @attrove/cli connect --session <session-id> --json
npx @attrove/cli connect gmail --token <pit_token> --user-id <user-id>Starts the end-user OAuth handoff from a terminal or agent context. Prefer --session for partner-issued durable connect sessions.
env write
npx @attrove/cli env write
npx @attrove/cli env write ./apps/example --jsonWrites ATTROVE_SECRET_KEY and ATTROVE_USER_ID to a project-local .env.
doctor
npx @attrove/cli doctor
npx @attrove/cli doctor --jsonChecks:
- CLI version
- 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 --jsonRemoves:
- Global Attrove credentials
- The current project
.envcredentials, if present - Attrove MCP entries from detected clients
Legacy mcp
npx @attrove/cli mcp installThe legacy mcp command now fails fast with migration guidance:
- Use
install <client>for hosted MCP - Use
local installorlocal uninstallfor the advanced stdio fallback
Agent / CI Flow
Create a browser-auth session:
npx @attrove/cli login --jsonThat 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 install claude-code --json
npx @attrove/cli local install claude-code --json
npx @attrove/cli whoami --json
npx @attrove/cli env write --json
npx @attrove/cli doctor --json
npx @attrove/cli logout --jsonGlobal 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_DIRATTROVE_PROFILE
Supported Clients
Hosted install targets:
- Claude Code
- Cursor
- Claude Desktop
Advanced local fallback targets:
- Claude Code
- Cursor
- Claude Desktop
- Windsurf
- VS Code
Environment Overrides
ATTROVE_API_ORIGINorATTROVE_BASE_URLATTROVE_DASHBOARD_ORIGINATTROVE_CONFIG_DIRATTROVE_PROFILE
Notes
- Hosted remote MCP is the default path.
- The local stdio server is an advanced fallback.
- The underlying stdio MCP package is
@attrove/mcp. - For hosted remote MCP details, see Attrove MCP docs.
