Getting started with Keystone CLI
The Keystone CLI lets you run tests locally, create a tunnel for cloud-based test recording, and integrate testing into your development workflow. Perfect for testing on branches, local development, or when you need more control over the testing environment.Installation
Install globally via npm
Initial setup
1. Initialize and authenticate
- Auto-detect your environment (SSH vs local)
- Open your browser for authentication (or use device flow for SSH)
- Store credentials securely in your OS keychain
- Validate the connection to Keystone
2. Authentication options
Browser authentication (default):- Opens browser automatically
- Uses PKCE flow with SHA256 code challenge
- Stores tokens in OS keychain or encrypted file
- Displays a user code and verification URL
- Enter the code at the verification URL
- CLI polls for completion automatically
3. Verify installation
- Your email and user ID
- Organization name and ID
- Token expiration time
- Granted scopes
Configuration options
Environment variables
Set these in your shell profile or.env file:
Security and credentials
Token storage
Keystone stores authentication tokens securely: Preferred method: OS Keychain- macOS: Keychain Access
- Windows: Windows Credential Store
- Linux: Secret Service API
- Location:
~/.keystone/credentials - Encryption: AES-256-GCM
- Automatic token refresh 5 minutes before expiration
Security features
- PKCE flow: SHA256 code challenge method for OAuth
- State parameter: CSRF protection in OAuth flow
- Automatic refresh: Tokens renewed automatically
- Secure storage: OS-level credential management

