Kubiya LogoKubiya Developer Docs

Configuration

Configuring the Kubiya CLI using configuration files and environment variables.

Configuration

The Kubiya CLI can be configured using the config command, configuration files, or environment variables to customize its behavior to suit your workflow.

Using the Config Command

The most straightforward way to configure the CLI is with the config command:

# Set your API key
kubiya config set api-key YOUR_API_KEY
 
# Set default output format
kubiya config set output-format json
 
# View current configuration
kubiya config view
 
# Reset a configuration value to default
kubiya config unset output-format

Configuration File

Default Config File Location

The CLI uses a YAML configuration file located at:

  • Linux/macOS: ~/.kubiya/config.yaml
  • Windows: %USERPROFILE%\.kubiya\config.yaml

A minimal configuration file might look like this:

api_key: "your-api-key"
output_format: "table"
default_teammate: "dev-assistant"

Environment Variables

Environment variables override values from the configuration file. This is useful for temporary changes or CI/CD environments.

Available Environment Variables

VariableDescriptionDefault
KUBIYA_API_KEYYour Kubiya API key-
KUBIYA_API_URLThe Kubiya API endpointhttps://api.kubiya.ai/v1
KUBIYA_CONFIG_PATHPath to the configuration file~/.kubiya/config.yaml
KUBIYA_OUTPUTDefault output format (json, yaml, table)table
KUBIYA_DEFAULT_TEAMMATEDefault teammate name for chat commands-
KUBIYA_PROFILEConfiguration profile to usedefault
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-key
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. Configuration file values
  4. Default values

Working with Multiple Environments

Create environment-specific profiles

# Create a development profile
kubiya config create-profile development
 
# Set development-specific settings
kubiya config set api-url https://dev.kubiya.ai/v1 --profile development
kubiya config set api-key DEV_API_KEY --profile development
 
# Create a production profile
kubiya config create-profile production
 
# Set production-specific settings
kubiya config set api-key PROD_API_KEY --profile production

Switch between profiles

# Switch to development profile
kubiya config use-profile development
 
# Switch to production profile
kubiya config use-profile production

Use a profile for a single command

# Run a command with a specific profile
kubiya tools execute deploy-app --profile development

For the most secure setup, use kubiya auth login rather than storing API keys in your configuration file.

Never commit your configuration file with API keys to version control. Use environment variables or a secure secrets manager for sensitive values in shared environments.

On this page