Authentication in the Adapty Developer CLI
Using an AI assistant? An Adapty CLI skill is available to help LLMs work with the CLI.
The CLI requires authentication to call the Adapty API.
Log in
To log in:
- In your terminal, run:
adapty auth login - The CLI prints a verification code in
XXXX-XXXXformat and opens the Adapty Dashboard in your browser. - On the authorization page, confirm the code matches your terminal output.
- Click Authorize. The browser shows “CLI authorized! You can close this tab.”
- Back in the terminal, the CLI confirms you are authenticated.
If the code expires before you authorize, or if you click Deny, run the following command again to restart the flow:
adapty auth login
Manage authentication
Check authentication status
To see your current authentication state, run:
adapty auth status
When authenticated, the output shows your email, a masked token prefix, and the path to the local config file:
Email: [email protected]
Token: abcd1234****
Config: ~/.config/adapty/config.json
When not authenticated:
Not authenticated. Run `adapty auth login`.
Verify your token
To confirm your token is valid and see your account details, run:
adapty auth whoami
Unlike adapty auth status, this command makes a live request to the server to verify the token.
Log out
To clear your stored credentials locally, run:
adapty auth logout
This clears ~/.config/adapty/config.json. The token remains valid server-side until it expires — if you need to invalidate it immediately, use adapty auth revoke instead.
Revoke your token
To invalidate the token on the server and clear it locally, run:
adapty auth revoke
Use this when you want to fully invalidate a token — for example, if your credentials may have been compromised. After revoking, run adapty auth login to authenticate again.
Token errors
If a token is revoked or becomes invalid, CLI commands return a 401 error. To re-authenticate, run:
adapty auth login