CLI Overview

teactl is the command-line interface for managing Teabar environments. It provides commands for creating, managing, and monitoring lab environments, plus an interactive TUI for real-time monitoring.

Quick Start

# Install
curl -fsSL https://teabar.dev/install.sh | sh

# Authenticate
teactl auth login

# Create an environment
teactl env create --blueprint gitlab-cicd --name my-workshop

# List environments
teactl env list

# Delete an environment
teactl env delete my-workshop

Installation

# Quick install (Linux/macOS)
curl -fsSL https://teabar.dev/install.sh | sh

# Quick install (Windows PowerShell)
iwr https://teabar.dev/install.ps1 -UseBasicParsing | iex

Command Groups

Command Structure

teactl [global-flags] <command> <subcommand> [flags] [args]

Global Flags

FlagShortDescription
--org-oOrganization context
--project-pProject context
--outputOutput format (table, json, yaml)
--quiet-qMinimal output
--verbose-vDebug output
--no-interactiveDisable prompts
--no-colorDisable colors
--configConfig file path

Full Command Reference

Authentication

teactl auth login              # OIDC device flow login
teactl auth logout             # Clear credentials
teactl auth status             # Show auth status
teactl auth whoami             # Current user info
teactl auth token create       # Create API token
teactl auth token list         # List API tokens
teactl auth token revoke       # Revoke API token

Environments

teactl env create              # Create environment (wizard)
teactl env list                # List environments
teactl env get <name>          # Show environment details
teactl env start <name>        # Wake sleeping environment
teactl env stop <name>         # Put to sleep
teactl env delete <name>       # Delete environment
teactl env logs <name>         # Stream logs
teactl env exec <name>         # Execute command

Blueprints

teactl blueprint create        # Create blueprint
teactl blueprint list          # List blueprints
teactl blueprint get <name>    # Show blueprint details
teactl blueprint validate      # Validate blueprint
teactl blueprint render        # Render with variables
teactl blueprint push          # Push to registry
teactl blueprint pull          # Pull from registry

Catalog

teactl catalog search <query>  # Search blueprints
teactl catalog browse          # TUI catalog browser
teactl catalog install <name>  # Install to project

Access

teactl access kubeconfig <env> # Get kubeconfig
teactl access ssh <env>        # SSH to VM
teactl access terminal <env>   # Open web terminal
teactl access port-forward     # Forward ports
teactl access url <env>        # List access URLs
teactl access credentials      # Show credentials

Participants

teactl participant invite      # Invite via magic link
teactl participant create      # Create with credentials
teactl participant codes       # Generate access codes
teactl participant list        # List participants
teactl participant revoke      # Revoke access

Checkpoints

teactl checkpoint create <env> # Create checkpoint
teactl checkpoint list <env>   # List checkpoints
teactl checkpoint restore <id> # Restore checkpoint
teactl checkpoint diff <id>    # Compare checkpoints
teactl checkpoint delete <id>  # Delete checkpoint

Activity

teactl activity list <env>     # List activity
teactl activity watch <env>    # Live activity TUI
teactl activity export <env>   # Export to CSV/JSON
teactl activity stats <env>    # Activity statistics

Organization & Projects

teactl org list                # List organizations
teactl org switch <name>       # Switch organization
teactl project list            # List projects
teactl project switch <name>   # Switch project

Configuration

teactl config init             # Setup wizard
teactl config set <key> <val>  # Set config value
teactl config get <key>        # Get config value
teactl config list             # Show all config

Local Execution

teactl local start             # Start local operator
teactl local stop              # Stop local operator
teactl local status            # Show local operator status
teactl local logs              # View operator logs
teactl local restart           # Restart operator
teactl local config            # Configure local providers

See Local Execution for detailed usage.

TUI

teactl ui                      # Launch TUI
teactl ui --view logs          # Start on logs view
teactl ui --view catalog       # Start on catalog view
teactl ui --view activity      # Start on activity view

Configuration

Configuration is stored in ~/.teactl/config.yaml:

api:
  url: https://api.teabar.dev
  timeout: 30s

current_context: default

contexts:
  default:
    organization: my-company
    project: default
  work:
    organization: acme-corp
    project: production

output:
  format: table
  color: auto

tui:
  theme: auto
  refresh_interval: 5s

Environment Variables

VariableDescription
TEABAR_SERVERAPI server URL
TEABAR_TOKENAPI token (for CI/CD)
TEABAR_ORGDefault organization
TEABAR_PROJECTDefault project
TEABAR_OUTPUTOutput format
TEABAR_NO_INTERACTIVEDisable prompts
TEABAR_PROXMOX_URLProxmox API URL
TEABAR_PROXMOX_TOKEN_IDProxmox API token ID
TEABAR_PROXMOX_SECRETProxmox API token secret
TEABAR_PROXMOX_TLS_INSECURESkip TLS verification for Proxmox
TEABAR_HCLOUD_TOKENHetzner Cloud API token
NO_COLORDisable colors

Shell Completion

Enable tab completion for commands, flags, and resource names:

# Bash
source <(teactl completion bash)

# Zsh
source <(teactl completion zsh)

# Fish
teactl completion fish | source

See Shell Completion Guide for permanent setup.

Interactive TUI

Launch the full-screen terminal interface:

teactl ui

The TUI provides:

  • Environments view - List and manage environments
  • Logs view - Stream and search logs
  • Catalog view - Browse blueprints with preview
  • Activity view - Monitor participant activity

CI/CD Integration

Use API tokens for non-interactive automation:

# Create a token
teactl auth token create --name "CI Pipeline" --scope environment

# Use in CI
export TEABAR_TOKEN="your-token"
export TEABAR_NO_INTERACTIVE=1

teactl env create --blueprint test-env --name "ci-$BUILD_ID" --wait

See Authentication for CI/CD examples.

Next Steps

ende