Beltic logo
CLI Guide

Authentication

Authenticate with the Beltic platform using the CLI

Authentication

The Beltic CLI supports authentication with the Beltic platform, allowing you to manage your developer identity and create agents directly from the command line.

Login

Authenticate with your Beltic API key:

beltic login

This will:

  1. Prompt for your API key (masked input)
  2. Validate the key against the Beltic platform
  3. Store credentials securely in ~/.beltic/credentials
  4. Save configuration to ~/.beltic/config.yaml

Getting an API Key

  1. Log in to the Beltic Console
  2. Navigate to Settings > API Keys
  3. Click Create New Key
  4. Copy the key (it's only shown once)

Non-interactive Mode

For CI/CD pipelines or scripts, pass the API key directly:

beltic login --api-key YOUR_API_KEY

Or use the --non-interactive flag:

beltic login --api-key $BELTIC_API_KEY --non-interactive

Custom API URL

For development or self-hosted deployments:

beltic login --api-url https://custom.api.url

Whoami

Display your current authenticated identity:

beltic whoami

Example output:

Current Developer
----------------------------------------

  Developer ID: dev_m5x7k9p_a1b2c3d4e5f6
  Legal Name: Acme Corporation
  KYB Tier: tier_2 (Enhanced)
  Verified: Verified

JSON Output

For programmatic use, output as JSON:

beltic whoami --json
{
  "id": "dev_m5x7k9p_a1b2c3d4e5f6",
  "type": "developers",
  "attributes": {
    "legal_name": "Acme Corporation",
    "kyb_tier": "tier_2",
    "verification_status": "verified"
  }
}

Credential Storage

Credentials are stored in ~/.beltic/ with restricted permissions:

FilePurposePermissions
~/.beltic/credentialsAPI key storage0600 (owner read/write only)
~/.beltic/config.yamlConfiguration0644

Configuration File

The config.yaml file stores:

api_url: https://api.beltic.dev
current_developer_id: dev_xxx

Troubleshooting

"Not logged in" Error

If you see this error when running commands:

Error: Not logged in. Run 'beltic login' first.

Run beltic login to authenticate.

"Session expired" Error

If your API key has been revoked or expired:

Error: Session expired or invalid. Run 'beltic login' to re-authenticate.

Generate a new API key in the Console and run beltic login again.

Clearing Credentials

To log out and clear stored credentials, delete the credentials file:

rm ~/.beltic/credentials