Skip to main content
Early Access - The Dcycle CLI is currently available for enterprise customers. Contact us to learn more about access.

Logging In

The CLI uses the same credentials as the Dcycle web application.

Interactive Login

dc auth login
This opens an interactive prompt for email and password.

Non-Interactive Login

For automation and scripting:
dc auth login --email [email protected] --password your_password
Avoid storing passwords in scripts. Consider using environment variables or secure secret management.

Checking Session Status

View your current authentication state:
dc auth status
Output example:
✓ Authenticated

  User:         John Doe ([email protected])
  Organization: Acme Corp
  Host:         https://api.dcycle.io
  Token:        eyJhbG...xyz (valid)

Logging Out

dc auth logout
This removes your stored credentials from the local configuration.

Configuring Environments

The CLI can connect to different Dcycle environments.

List Available Hosts

dc config host list
Output:
Available hosts:
  * prod      https://api.dcycle.io (current)
    staging   https://api.staging.dcycle.io
    local     http://localhost:8000

Switch Environment

# Production (default)
dc config host set prod

# Staging environment
dc config host set staging

# Local development
dc config host set local
Development and staging environments automatically disable SSL verification for self-signed certificates.

Configuration File

The CLI stores configuration in ~/.dcycle/config.yaml:
# ~/.dcycle/config.yaml
host: https://api.dcycle.io
token: eyJhbGciOiJIUzI1NiIs...
organization_id: ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
organization_name: Acme Corp
user_email: [email protected]
user_name: John Doe

Configuration Priority

  1. Command-line flags (highest priority)
  2. Environment variables (DCYCLE_API_KEY, DCYCLE_HOST)
  3. Configuration file (~/.dcycle/config.yaml)
  4. Defaults (lowest priority)

Environment Variables

For CI/CD and automation:
VariableDescription
DCYCLE_API_KEYAPI key for authentication (alternative to login)
DCYCLE_HOSTOverride the API host URL
DCYCLE_ORG_IDOverride the active organization
# Example: Using API key in CI/CD
export DCYCLE_API_KEY=your_api_key
export DCYCLE_ORG_ID=your_org_id
dc vehicle list

Troubleshooting

Permission Errors (403/404)

  1. Verify your session is valid:
    dc auth status
    
  2. Check you’re in the correct organization:
    dc org list
    dc org set <correct-org-id>
    

Token Expired

Re-authenticate:
dc auth login

SSL Certificate Errors

For staging/development environments:
dc config host set staging  # Auto-disables SSL verification

Next Steps