Skip to main content
Manage authentication for the HopX CLI using the auth command. Authenticate via OAuth, manage API keys, and verify authentication status.

Command Syntax

Subcommands

login

Authenticate with HopX via browser OAuth. Syntax:
Options:
  • --provider TEXT - OAuth provider: GoogleOAuth, GitHubOAuth (default: GoogleOAuth)
  • --no-browser - Headless mode: manually paste callback URL (for servers without browsers)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 1 - Authentication failed
  • 5 - Timeout

logout

Log out and clear stored credentials. Syntax:
Examples:
Expected Output:
Exit Codes:
  • 0 - Success

status

Check authentication status. Syntax:
Examples:
Expected Output:
Exit Codes:
  • 0 - Authenticated
  • 3 - Not authenticated

validate

Validate current API key. Syntax:
Examples:
Expected Output:
Exit Codes:
  • 0 - Valid
  • 3 - Invalid or missing

refresh

Refresh OAuth token. Syntax:
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error

keys

Manage API keys.

keys list

List all API keys. Syntax:
Examples:
Expected Output:

keys create

Create a new API key. Syntax:
Options:
  • --name TEXT - API key name (auto-generated if not provided)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error

keys revoke

Revoke an API key. Syntax:
Arguments:
  • KEY_ID - API key ID to revoke (required)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Key not found

keys info

Get information about an API key. Syntax:
Arguments:
  • KEY_ID - API key ID (required)
Examples:
Expected Output:

Authentication Methods

Method 2: Environment Variable

Method 3: Config File

API keys are automatically stored in ~/.hopx/credentials.yaml after creation.

Shell Scripting Examples

Check Authentication Before Running Commands

Create and Use API Key

Next Steps