Authentication
The CLI requires authentication to interact with your Controlinfra account.
Login
Browser Authentication (Recommended)
The simplest way to authenticate is through your browser:
bash
controlinfra loginThis will:
- Open your default browser to the Controlinfra login page
- After you authenticate, the CLI will automatically receive your credentials
- Your session will be saved locally for future use
API Token Authentication
For CI/CD environments or headless servers, use an API token:
bash
controlinfra login --token <your-api-token>You can generate API tokens from your account settings.
Environment Variable
You can also set your token as an environment variable:
bash
export CONTROLINFRA_TOKEN=your-api-token
controlinfra repos listCheck Current User
Verify you're logged in and see your account details:
bash
controlinfra whoamiOutput:
┌──────────────────────────────────────────────────────────┐
│ Current User │
├──────────────────────────────────────────────────────────┤
│ Email: john@example.com │
│ Name: John Doe │
│ Role: admin │
│ Workspace: My Team │
└──────────────────────────────────────────────────────────┘Logout
To clear your stored credentials:
bash
controlinfra logoutConfiguration Storage
Credentials are stored securely in:
| Platform | Location |
|---|---|
| Linux | ~/.config/controlinfra-nodejs/config.json |
| macOS | ~/Library/Preferences/controlinfra-nodejs/config.json |
| Windows | %APPDATA%\controlinfra-nodejs\Config\config.json |
Custom API URL
For self-hosted installations, you can set a custom API URL:
bash
export CONTROLINFRA_API_URL=https://your-instance.example.com
controlinfra loginNext Steps
- Quick Reference - Common commands
- Repositories - Managing repositories