Skip to main content

vers login

Login to the Vers platform using your API token.

Usage

vers login                    # Interactive login (secure input)
vers login --token   # Login with token directly

Options

OptionDescription
--token, -tAPI token for authentication

Examples

Interactive login

vers login
Enter your API key (input will be hidden): 
Validating API key...
API key validated successfully
Successfully authenticated with Vers

Direct token login

vers login --token sk-vers-api01-abc123...
Validating API key...
API key validated successfully
Successfully authenticated with Vers

How it works

The login command:
  1. Gets API key: Either from --token flag or secure interactive input
  2. Validates key: Makes a POST request to /api/validate endpoint
  3. Saves locally: Stores the validated API key securely on your machine
  4. Confirms success: Shows authentication confirmation

Getting your API key

You can get your API key from: https://vers.sh/billing
  1. Sign up or log into your Vers account
  2. Navigate to the billing page
  3. Generate or copy your API key after payment
  4. Use it with vers login

Security features

Hidden input

When using interactive mode, your API key input is completely hidden:
vers login
Enter your API key (input will be hidden): [no characters shown]

Server validation

Every API key is validated against the Vers platform before being saved:
Validating API key...
API key validated successfully

Local storage

The API key is stored securely on your local machine and is not shared with version control systems.

Error handling

Invalid API key

vers login --token invalid-key
Validating API key...
Error: invalid API key - please check your key and try again

Empty API key

vers login --token ""
Error: API key cannot be empty

Network issues

vers login
Enter your API key (input will be hidden): 
Validating API key...
Error: could not validate API key: connection refused

Server errors

vers login
Validating API key...
Error: validation failed with status 500 - please try again

Prerequisites

See Also

  • vers logout - Sign out from current account
  • vers init - Initialize projects (requires authentication)