C

Cursor CLI

CLI discovered

Details
Command
agent
Docs
https://cursor.com/docs/cli/overview
Authentication
Cursor user API key env CURSOR_API_KEY + Cursor user API key $ agent --api-key <your_api_key> discovered
Cursor user API key api_key $ agent login

Acquired by the CLI — running agent login opens the auth flow and stores the credential.

Cursor service account API key env CURSOR_API_KEY + Cursor service account API key $ agent --api-key <your_api_key> discovered
Cursor service account API key api_key Get key ↗

Create a service account from your team's enterprise settings as described in Service Accounts, then generate an API key for that service account from Cursor team settings. Service account API keys can be used for automation with Cloud Agents, the SDK, and the CLI.

Cursor user API key api_key discovered $ agent login