Skip to main content
The 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

string
default:"true"
Charm Hyper - Charm’s managed AI service with access to multiple models.Default platform when no argument is provided.
string
GitHub Copilot - GitHub’s AI pair programmer.Aliases: github, github-copilot

Arguments

string
default:"hyper"
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:
  1. Device code generation: Crush requests a device code from Hyper
  2. User code display: A short code is displayed (and copied to clipboard if possible)
  3. Browser opening: Press Enter to open the verification URL
  4. Code entry: Paste the code in your browser
  5. Token exchange: Crush polls for authorization and exchanges tokens
  6. Verification: The access token is verified
  7. Storage: Credentials are saved to your crush.json

Example Output

GitHub Copilot Authentication

When authenticating with GitHub Copilot:
  1. Token detection: Checks for existing Copilot tokens on disk
  2. Token refresh: If found, attempts to refresh the existing token
  3. Device code flow: If no token exists, initiates OAuth device flow
  4. Browser authorization: User authorizes via GitHub
  5. Token polling: Crush waits for authorization completion
  6. 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 your crush.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:
  • hyper
  • copilot
  • github
  • github-copilot

Browser Doesn’t Open

If the browser fails to open automatically:
Manually copy the displayed URL and open it in your browser.

Token Refresh Failed

If token refresh fails:

Interrupt During Authentication

Press Ctrl+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 0700 permissions (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

The login command has the following alias:

See Also