Execution contexts with variables, secrets, and integrations for agent operations.
Quick Start
# List environments
kubiya environment list
Output:
π Environments (1)
ID NAME DESCRIPTION
2667caff-8d0e-4b5e-9c1a-3e5f0a7b2c9d Default Environment Default environment for agents
# Get environment details
kubiya environment get < environment-i d >
# Create environment
kubiya environment create --file environment.yaml
List Environments
# List all environments
kubiya environment list
# JSON output
kubiya environment list --output json
Output:
π Environments (3)
ID NAME DESCRIPTION
2667caff-8d0e-4b5e-9c1a-3e5f0a7b2c9d Default Environment Default environment for agents
a1b2c3d4-e5f6-7890-abcd-ef1234567890 Production Production environment with AWS
b2c3d4e5-f6a7-8901-bcde-f12345678901 Staging Staging environment for testing
Get Environment Details
View complete environment configuration including variables, secrets, and integrations:
# View environment configuration
kubiya environment get < environment-i d >
Output:
π Environment Details
ID: 2667caff-8d0e-4b5e-9c1a-3e5f0a7b2c9d
Name: Production
Description: Production environment with AWS integration
Variables:
DATABASE_URL: postgres://prod-db.example.com:5432/mydb
API_ENDPOINT: https://api.example.com
LOG_LEVEL: info
Secrets:
- aws-credentials
- db-password
- api-key
Integrations:
- github
- slack
- aws
Created: 2025-01-10 14:23:45
Updated: 2025-01-15 09:12:30
Create Environment
Create a new environment from a YAML configuration file:
# Create from file
kubiya environment create --file environment.yaml
environment.yaml:
name : production
description : Production environment
variables :
DATABASE_URL : "postgres://..."
API_ENDPOINT : "https://api.example.com"
LOG_LEVEL : "info"
secrets :
- aws-credentials
- db-password
integrations :
- github
- slack
Example with multiple integrations:
name : staging
description : Staging environment for testing
variables :
DATABASE_URL : "postgres://staging-db.example.com:5432/mydb"
API_ENDPOINT : "https://staging-api.example.com"
DEBUG : "true"
secrets :
- staging-aws-credentials
- staging-db-password
integrations :
- github
- slack
- datadog
- pagerduty
Update Environment
Update an existing environment configuration:
# Update environment configuration
kubiya environment update < environment-i d > --file environment.yaml
The update will merge new configuration with existing settings. To replace completely, delete and recreate the environment.
Delete Environment
# Delete environment
kubiya environment delete < environment-i d >
Deleting an environment does not delete agents or teams using it. They will need to be reconfigured with a new environment.
Best Practices
Organization
Separate environments by stage (dev, staging, production)
Use descriptive names and detailed descriptions
Document variable purposes in environment descriptions
Maintain environment definitions in version control
Security
Never store sensitive data in plain text variables - always use secrets
Rotate secrets regularly with automated processes
Use role-based access control for environment management
Encrypt secrets at rest
Enable and review audit logs for environment changes
Variable Management
Use consistent naming conventions (UPPER_SNAKE_CASE for env vars)
Document required vs optional variables
Provide sensible defaults where possible
Use environment-specific values (donβt share credentials across envs)
Integration Management
Only add integrations that are actually used
Review integration permissions regularly
Test integrations after adding or updating
Document integration setup requirements
Command Reference
# List environments
kubiya environment list [--output json | yaml]
# Get environment details
kubiya environment get < i d >
# Create environment
kubiya environment create --file env.yaml
# Update environment
kubiya environment update < i d > --file env.yaml
# Delete environment
kubiya environment delete < i d >
Next Steps
Core Resources Create agents and teams in environments
Capabilities Configure skills and policies for environments
Workers Deploy workers for environment execution
On-Demand Execution Execute tasks in configured environments