Kubiya LogoKubiya Developer Docs

Configuration

Configuring the Kubiya CLI using environment variables.

Configuration

The Kubiya CLI can be configured using environment variables to customize its behavior to suit your workflow.

Environment Variables

Environment variables are the primary way to configure the Kubiya CLI.

Available Environment Variables

VariableDescriptionDefault
KUBIYA_API_KEYYour Kubiya API token-
KUBIYA_API_URLThe Kubiya API endpointhttps://api.kubiya.ai/v1
KUBIYA_OUTPUTDefault output format (json, yaml, table)table
KUBIYA_DEFAULT_TEAMMATEDefault teammate name for chat commands-
KUBIYA_TIMEOUTGlobal timeout for API requests (seconds)60
KUBIYA_LOG_LEVELLogging level (debug, info, warn, error)info
KUBIYA_NO_COLORDisable colored output if set to any value-
# Example: Set environment variables for a session
export KUBIYA_API_KEY=your-api-token
export KUBIYA_OUTPUT=json
export KUBIYA_DEFAULT_TEAMMATE=devops-expert

Configuration Precedence

The CLI resolves configuration in the following order (highest precedence first):

  1. Command-line flags (e.g., --output json)
  2. Environment variables (e.g., KUBIYA_OUTPUT=json)
  3. Default values

Working with Multiple Environments

Create environment-specific scripts

You can create shell scripts for different environments:

#!/bin/bash
export KUBIYA_API_KEY=DEV_API_TOKEN
export KUBIYA_API_URL=https://dev.kubiya.ai/v1
export KUBIYA_OUTPUT=json
#!/bin/bash
export KUBIYA_API_KEY=PROD_API_TOKEN
export KUBIYA_API_URL=https://api.kubiya.ai/v1
export KUBIYA_OUTPUT=json

Switch between environments

# Switch to development environment
source ./dev-env.sh
 
# Switch to production environment
source ./prod-env.sh

Use environment variables for a single command

# Run a command with specific environment variables
KUBIYA_API_KEY=DEV_API_TOKEN kubiya tools execute deploy-app

Never commit your scripts with API tokens to version control. Use a secure secrets manager for sensitive values in shared environments.

On this page