Command reference ยท Cursor CLI
agent status | agent whoami
Shows the current authentication status plus account and endpoint info.
agent status (alias: agent whoami) is a top-level command from the CLI reference and shows the current authentication status. According to the authentication reference, the output includes whether you're signed in, your account information, and the current endpoint configuration โ relevant, for example, with differing or self-hosted API endpoints. The --format <format> flag lets you choose between text (default) and json, which makes the output machine-readable and works well for scripts or CI checks. According to the docs, status and whoami are fully synonymous; both call the same function. The command doesn't change anything about the sign-in itself, it only reads out the current state.
โ WHEN TO USE IT?
Check in a machine-readable way before a script run whether the CLI is signed in
Build agent status --format json into a CI script to check the auth status before the actual run
Quickly check which account and endpoint are currently active
Run agent whoami to display the account and endpoint configuration in the default text format
โ WHEN NOT TO?
You want to switch accounts, not just check
agent status doesn't change anything, it only displays the current state.
Better: Use agent logout followed by agent login
SOURCES
- Cursor Docs โ CLI Reference: Parameters โ cursor.com