Authentication
The Doover CLI requires authentication to interact with the Doover platform. There are two primary authentication methods: interactive login for development and token-based authentication for CI/CD pipelines.
Interactive Login
The doover login command provides an interactive way to authenticate with your Doover account using username and password.
Usage
doover login
You will be prompted for:
| Prompt | Description | Default |
|---|---|---|
| Doover username | Your Doover account username | (required) |
| Doover password | Your Doover account password | (required) |
| Base API URL | The Doover API endpoint | https://my.doover.com |
| Profile name | Name for this configuration profile | default |
Example
$ doover login Doover username: myuser@example.com Doover password: ******** Base API URL: https://my.doover.com Profile name: default Login successful.
Command-Line Options
You can also provide credentials as command-line options:
doover login \ --username myuser@example.com \ --password mypassword \ --base-url https://my.doover.com \ --profile-name production
Token-Based Authentication
For CI/CD pipelines and automated workflows, use doover configure-token to set up authentication with a long-lived API token.
Usage
doover configure-token
You will be prompted for:
| Prompt | Description | Default |
|---|---|---|
| API Token | Long-lived API token from Doover | (required) |
| Agent ID | Default agent ID to use for operations | (required) |
| Base API URL | The Doover API endpoint | https://my.doover.com |
| Profile name | Name for this configuration profile | default |
| Token expiry | Number of days until token expires | None (no expiry) |
Example
$ doover configure-token API Token: your-api-token-here Agent ID: abc123 Base API URL: https://my.doover.com Profile name: ci-pipeline Token expiry (in days): 365 Successfully configured doover credentials.
Command-Line Options
doover configure-token \ --token your-api-token \ --agent-id abc123 \ --base-url https://my.doover.com \ --profile ci-pipeline \ --expiry 365
Obtaining an API Token
API tokens can be generated from the Doover web interface:
- Log in to the Doover platform
- Navigate to your account settings
- Go to the API tokens section
- Generate a new token with the required permissions
Configuration Profiles
The CLI supports multiple configuration profiles, allowing you to switch between different accounts or environments.
How Profiles Work
- Credentials are stored per profile
- The
defaultprofile is used when no profile is specified - You can create profiles for different environments (development, staging, production)
Specifying a Profile
Most commands accept a --profile option:
doover channel get my-channel --profile production
Profile Storage
Configuration is stored by pydoover's ConfigManager. Each profile entry contains:
- Username and password (for login-based auth)
- API token and expiry (for token-based auth)
- Base URL
- Default agent ID
Environment Variables
For CI/CD environments, you can configure authentication using environment variables instead of stored profiles.
| Variable | Description |
|---|---|
DOOVER_API_TOKEN | API token for authentication |
DOOVER_API_BASE_URL | Base URL for the Doover API |
Example CI/CD Configuration
# GitHub Actions example
env:
DOOVER_API_TOKEN: ${{ secrets.DOOVER_API_TOKEN }}
DOOVER_API_BASE_URL: https://my.doover.com
steps:
- name: Deploy to Doover
run: doover app publish --skip-container
# Shell script example export DOOVER_API_TOKEN="your-token-here" export DOOVER_API_BASE_URL="https://my.doover.com" doover app publish
Switching Environments
When working with multiple Doover environments (development, staging, production), create separate profiles:
# Configure development environment doover login --profile dev --base-url https://dev.doover.com # Configure staging environment doover configure-token --profile staging --base-url https://staging.d.doover.com # Configure production environment doover configure-token --profile prod --base-url https://my.doover.com
Then use the --profile option with commands:
# Deploy to staging doover app publish --profile staging # Check channels in production doover channel get my-channel --profile prod
Troubleshooting
Login Failed
If you see "Login failed. Please try again.", verify:
- Your username and password are correct
- The base URL is accessible
- Your account has the necessary permissions
Enable debug mode for more details:
doover --debug login
Token Configuration Errors
Common errors when configuring tokens:
| Error | Cause | Solution |
|---|---|---|
| "Agent token was incorrect" | Invalid API token | Verify the token in the Doover web interface |
| "Agent ID or Base URL was incorrect" | Invalid agent ID or URL | Check the agent ID and ensure the URL is correct |
| "Base URL was incorrect" | Cannot reach the API | Verify network connectivity and URL |
Profile Already Exists
When configuring a profile that already exists:
$ doover configure-token --profile default There's already a config entry with this profile. Do you want to overwrite it? [y/N]
Confirm with y to overwrite, or use a different profile name.