crush login command handles OAuth authentication for providers that support it, making it easy to connect Crush to your AI accounts.
Usage
Description
Authenticate Crush with supported platforms using OAuth device flow. This command manages the complete OAuth flow including:- Initiating device authorization
- Opening the browser for authentication
- Polling for token completion
- Storing credentials securely in your Crush configuration
Supported Platforms
Charm Hyper - Charm’s managed AI service with access to multiple models.Default platform when no argument is provided.
GitHub Copilot - GitHub’s AI pair programmer.Aliases:
github, github-copilotArguments
The platform to authenticate with. Must be one of:
hyper, copilot, github, or github-copilot.If omitted, defaults to hyper.Global Flags
All global flags are available:--cwd, --data-dir, --debug
Examples
Authentication Flows
Hyper Authentication
When authenticating with Hyper:- Device code generation: Crush requests a device code from Hyper
- User code display: A short code is displayed (and copied to clipboard if possible)
- Browser opening: Press Enter to open the verification URL
- Code entry: Paste the code in your browser
- Token exchange: Crush polls for authorization and exchanges tokens
- Verification: The access token is verified
- Storage: Credentials are saved to your
crush.json
Example Output
GitHub Copilot Authentication
When authenticating with GitHub Copilot:- Token detection: Checks for existing Copilot tokens on disk
- Token refresh: If found, attempts to refresh the existing token
- Device code flow: If no token exists, initiates OAuth device flow
- Browser authorization: User authorizes via GitHub
- Token polling: Crush waits for authorization completion
- Storage: Credentials are saved to your
crush.json
Example Output (New User)
Example Output (Existing Token)
Copilot Not Available
If GitHub Copilot is not available for your account:Configuration Storage
Authentication tokens are stored in yourcrush.json file:
Token Management
Automatic Refresh
Crush automatically refreshes expired OAuth tokens when:- Starting a new session
- Running a command
- Making API requests
Manual Re-authentication
To re-authenticate (e.g., if tokens are invalid):Viewing Token Status
To check if you’re authenticated:Troubleshooting
”hyper not enabled”
This error occurs when trying to authenticate with Hyper, but it’s not available. Hyper may require:- A specific build of Crush
- Beta access
- Environment configuration
”unknown platform”
You specified an invalid platform name. Valid options are:hypercopilotgithubgithub-copilot
Browser Doesn’t Open
If the browser fails to open automatically:Token Refresh Failed
If token refresh fails:Interrupt During Authentication
PressCtrl+C to cancel the authentication process. The command responds to SIGINT and SIGTERM signals.
Security Considerations
- Clipboard access: The Hyper flow attempts to copy the device code to your clipboard for convenience
- Token storage: OAuth tokens are stored in plain text in
crush.json- protect this file with appropriate permissions - File permissions: The Crush data directory is created with
0700permissions (owner-only access) - No password storage: OAuth tokens are used instead of passwords
- Refresh tokens: Stored securely and used to obtain new access tokens
Aliases
Thelogin command has the following alias:
See Also
- Providers - Configuring AI providers
- Configuration - Understanding crush.json