env Commands
Commands for creating, managing, and monitoring Teabar environments.
teactl env create
Create a new environment from a blueprint.
teactl env create [flags] Flags
| Flag | Short | Description |
|---|---|---|
--blueprint | -b | Blueprint name or community blueprint |
--file | -f | Path to blueprint YAML file |
--name | -n | Environment name (auto-generated if omitted) |
--set | Set variable values (key=value) | |
--values | Path to values YAML file | |
--wait | -w | Wait for environment to be ready |
--timeout | Wait timeout (default: 30m) |
Examples
# From community blueprint
teactl env create --blueprint kubernetes-basic --name my-cluster
# From local file
teactl env create -f workshop.yaml --name march-training
# With variables
teactl env create -f workshop.yaml
--set participants=25
--set duration=8h
--name march-training
# With values file
teactl env create -f workshop.yaml --values prod-values.yaml --name prod-env teactl env list
List all environments.
teactl env list [flags] Flags
| Flag | Short | Description |
|---|---|---|
--all | -a | Show all environments (including destroyed) |
--output | -o | Output format (table, json, yaml) |
--filter | Filter by label (key=value) |
Examples
# List active environments
teactl env list
# Output as JSON
teactl env list -o json
# Filter by label
teactl env list --filter team=devops Sample output:
NAME STATUS AGE TTL BLUEPRINT
march-training Running 2h30m 5h30m cicd-training
k8s-workshop Running 45m 7h15m kubernetes-basic
test-env Creating 2m - custom teactl env describe
Show detailed information about an environment.
teactl env describe <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--output | -o | Output format (table, json, yaml) |
Examples
teactl env describe march-training Sample output:
Name: march-training
Status: Running
Created: 2024-01-15 09:30:00 UTC
TTL: 5h 30m remaining
Blueprint: cicd-training
Provider: hetzner (eu-central)
Components:
NAME TYPE STATUS ENDPOINT
gitlab gitlab Ready https://gitlab.march-training.env.teabar.dev
runners gitlab-runner Ready 2/2 online
Participants:
ACTIVE: 18/20
Resources:
CPU: 24 cores (allocated)
Memory: 48 Gi (allocated)
Storage: 200 Gi (allocated)
Cost:
Current session: $8.50
Rate: $1.50/hour teactl env destroy
Destroy an environment and release all resources.
teactl env destroy <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--force | -f | Skip confirmation prompt |
--wait | -w | Wait for destruction to complete |
Examples
# Interactive confirmation
teactl env destroy march-training
# Skip confirmation
teactl env destroy march-training --force Warning
teactl env start
Start (wake) a sleeping environment.
teactl env start <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--wait | -w | Wait until environment is running |
--timeout | Wait timeout (default: 10m) |
Examples
# Start a sleeping environment
teactl env start march-training
# Start and wait until ready
teactl env start march-training --wait
# Start multiple environments
teactl env start march-training demo-env staging teactl env stop
Stop (sleep) a running environment to save costs.
teactl env stop <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--strategy | -s | Sleep strategy (scale-to-zero, vm-stop, hibernate) |
--wait | -w | Wait until environment is sleeping |
Examples
# Stop with default strategy
teactl env stop march-training
# Stop with specific strategy
teactl env stop march-training --strategy hibernate
# Stop multiple environments
teactl env stop --all-matching "workshop-*" Sleep Strategies
| Strategy | Resume Time | Cost Savings | Best For |
|---|---|---|---|
scale-to-zero | ~30s | ~90% | Kubernetes environments |
vm-stop | ~2m | ~80% | VM-based environments |
hibernate | ~5-10m | ~95% | Long-term storage |
See Sleep Mode & Scheduling for more details.
teactl env schedule
Configure automatic start/stop schedules for an environment.
teactl env schedule <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--sleep | Time to sleep (HH:MM or cron) | |
--wake | Time to wake (HH:MM or cron) | |
--timezone | Timezone (default: UTC) | |
--weekdays-only | Only run schedule on weekdays | |
--days | Specific days (mon,tue,wed…) | |
--clear | Remove schedule |
Examples
# Business hours schedule (weekdays 9-6)
teactl env schedule march-training
--wake "09:00"
--sleep "18:00"
--timezone "America/New_York"
--weekdays-only
# Custom days
teactl env schedule march-training
--wake "08:00"
--sleep "17:00"
--days "tue,wed,thu"
# Clear schedule
teactl env schedule march-training --clear
# View current schedule
teactl env get march-training --show-schedule See Sleep Mode & Scheduling for more details.
teactl env extend
Extend an environment’s TTL (time-to-live).
teactl env extend <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--add | -a | Duration to add (e.g., 2h, 4h, 1d) |
--until | Set absolute expiration (datetime) | |
--no-ttl | Remove TTL (run indefinitely) |
Examples
# Add 4 hours to TTL
teactl env extend march-training --add 4h
# Add 1 day
teactl env extend march-training -a 1d
# Set absolute expiration
teactl env extend march-training --until "2024-01-20 18:00"
# Remove TTL entirely
teactl env extend march-training --no-ttl See TTL & Automatic Cleanup for more details.
teactl env checkpoint
Create a checkpoint (snapshot) of an environment.
teactl env checkpoint <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--checkpoint-name | -c | Name for the checkpoint |
--description | -d | Description of the checkpoint |
Examples
teactl env checkpoint march-training
--checkpoint-name end-of-day-1
--description "After completing module 3" teactl env restore
Restore an environment from a checkpoint.
teactl env restore <checkpoint> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--name | -n | Name for restored environment |
--ttl | TTL for restored environment |
Examples
teactl env restore end-of-day-1 --name day2-training --ttl 8h teactl env participants
List participant access links and status.
teactl env participants <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--output | -o | Output format (table, json, yaml, links) |
--active | Show only active participants |
Examples
# Show all participants
teactl env participants march-training
# Just the links (for sharing)
teactl env participants march-training -o links teactl env watch
Watch environment activity in real-time.
teactl env watch <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--events | -e | Event types to watch (comma-separated) |
--participant | -p | Watch specific participant |
Examples
# Watch all activity
teactl env watch march-training
# Watch specific events
teactl env watch march-training -e git-push,pipeline-run
# Watch specific participant
teactl env watch march-training -p participant-5 teactl env logs
View logs from environment components.
teactl env logs <name> [component] [flags] Flags
| Flag | Short | Description |
|---|---|---|
--follow | -f | Follow log output |
--tail | Number of lines to show (default: 100) | |
--since | Show logs since duration (e.g., 1h) |
Examples
# All logs
teactl env logs march-training
# Specific component
teactl env logs march-training gitlab
# Follow logs
teactl env logs march-training gitlab -f
# Last hour
teactl env logs march-training --since 1h teactl env creds
Get access credentials for an environment.
teactl env creds <name> [flags] Flags
| Flag | Short | Description |
|---|---|---|
--component | -c | Specific component credentials |
--export | -e | Export as environment variables |
Examples
# Show all credentials
teactl env creds march-training
# Specific component
teactl env creds march-training --component gitlab
# Export kubeconfig
teactl env creds march-training -c cluster --export > kubeconfig teactl env costs
View cost breakdown for an environment.
teactl env costs <name> [flags] Examples
teactl env costs march-training Sample output:
Cost Summary for 'march-training'
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Duration: 6h 45m
Status: Running
Components:
GitLab (4 vCPU, 8Gi): $3.40
Runners (2x 2 vCPU): $1.60
Workspaces (20x 1 vCPU): $2.50
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Current Total: $7.50
Projected (8h): $8.90