Skip to main content
The Kubiya CLI authenticates with the Control Plane using API keys. This guide covers authentication setup, configuration management, and best practices.

Quick Setup

Get Your API Key

  1. Via Composer (Web UI)
    • Navigate to https://compose.kubiya.ai
    • Go to SettingsAPI Keys
    • Click Generate New API Key
    • Copy your key (it will only be shown once)
  2. Via API

Configure the CLI

Verify Authentication

Expected output:

Configuration Options

Environment Variables

string
required
Your Kubiya API authentication key. Get this from the Composer UI or API.
string
default:"https://api.kubiya.ai/api/v1"
Base URL for Kubiya API endpoints
string
default:"https://control-plane.kubiya.ai"
Control Plane URL for worker registration and management
string
Override for Control Plane URL (takes precedence over CONTROL_PLANE_URL)
boolean
default:"false"
Enable debug logging for troubleshooting
string
default:"INFO"
Set logging verbosity: DEBUG, INFO, WARN, ERROR

Configuration File

Create ~/.kubiya/config.yaml:

Priority Order

The CLI resolves configuration in this order (highest to lowest priority):
  1. Command-line flags (--api-key, --base-url)
  2. Environment variables (KUBIYA_API_KEY, CONTROL_PLANE_URL)
  3. Configuration file (~/.kubiya/config.yaml)
  4. Default values
Example:

Control Plane Connection

Understanding the Control Plane

The Control Plane is the central management and orchestration layer that:
  • Manages all platform resources (agents, teams, projects)
  • Coordinates workflow execution via Temporal
  • Handles worker registration and health monitoring
  • Provides event streaming and session persistence
  • Enforces policies and access control

Control Plane Operations

Resource Management

Worker Registration

Workflow Execution

Custom Control Plane

For on-premise or custom deployments:

Multi-Environment Configuration

Using Environment-Specific Keys

Environment Switcher Script

Create ~/.kubiya/switch-env.sh:
Usage:

Security Best Practices

API Key Management

Never commit API keys to version control or share them in plain text.
Do:
  • ✅ Store keys in environment variables
  • ✅ Use secrets management tools (Vault, AWS Secrets Manager)
  • ✅ Rotate keys regularly
  • ✅ Use short-lived keys for CI/CD
  • ✅ Restrict key permissions to minimum required
Don’t:
  • ❌ Commit keys to Git repositories
  • ❌ Share keys via email or chat
  • ❌ Use the same key across environments
  • ❌ Store keys in application code
  • ❌ Use overly permissive keys

Key Rotation

CI/CD Integration

Store keys as secrets in your CI/CD platform:

Network Security

For restricted environments:

Troubleshooting

Authentication Failed

Connection Refused

SSL Certificate Errors

Invalid API Key Format

API keys must:
  • Start with kby_
  • Be alphanumeric with underscores
  • Have minimum length requirements

Command Reference

Next Steps

Worker Management

Deploy and manage workers on your infrastructure

Control Plane Resources

Learn to manage agents, teams, and other resources

Workflow Execution

Execute automated workflows via the control plane

Environment Variables

Complete reference of all configuration options