Access Commands

The teactl access commands provide access to environment resources including kubeconfigs, SSH connections, web terminals, port forwarding, and credentials.

teactl access kubeconfig

Get or merge kubeconfig for an environment’s Kubernetes cluster.

teactl access kubeconfig <env> [flags]

Flags

FlagDescription
--mergeMerge into ~/.kube/config
--output <file>Write to file instead of stdout
--cluster <name>Specific cluster (if multiple)

Examples

# Print kubeconfig to stdout
teactl access kubeconfig march-seminar

# Merge into default kubeconfig
teactl access kubeconfig march-seminar --merge

# Save to specific file
teactl access kubeconfig march-seminar --output ./kubeconfig.yaml

# Use immediately with kubectl
export KUBECONFIG=$(teactl access kubeconfig march-seminar --output /tmp/kc-$$.yaml && echo /tmp/kc-$$.yaml)
kubectl get pods

Automatic clipboard:

When getting kubeconfig, the export command is automatically copied:

$ teactl access kubeconfig march-seminar --output ./kubeconfig.yaml
✓ Kubeconfig saved to ./kubeconfig.yaml
✓ Copied to clipboard: export KUBECONFIG=./kubeconfig.yaml

Help output (generated)

Get kubeconfig to access the environment's Kubernetes cluster.

By default, saves to ~/.kube/teabar/<env>.yaml
Use --merge to add to your existing kubeconfig.
Use --print to output to stdout.

Examples:
  teactl access kubeconfig my-env
  teactl access kubeconfig my-env --print
  teactl access kubeconfig my-env --merge
  teactl access kubeconfig my-env -o ~/my-kubeconfig.yaml

Usage:
  teactl access kubeconfig <environment> [flags]

Flags:
  -f, --file string   Output file path
  -h, --help          help for kubeconfig
      --merge         Merge into default kubeconfig
      --print         Print kubeconfig to stdout

Global Flags:
      --api-url string        Teabar API URL
      --config string         config file (default is $HOME/.teactl.yaml)
      --no-color              Disable colored output
      --org string            Organization to use (overrides config)
      --organization string   Organization to use (alias of --org)
  -o, --output string         Output format (table, json, yaml) (default "table")
      --project string        Project to use (overrides config)
      --project-id string     Project to use (alias of --project)
  -q, --quiet                 Suppress non-essential output
  -v, --verbose               Enable verbose output

Multiple Clusters

If an environment has multiple clusters:

# List clusters
teactl access kubeconfig march-seminar --list

# Get specific cluster
teactl access kubeconfig march-seminar --cluster participant-cluster

teactl access ssh

SSH into a VM in the environment.

teactl access ssh <env> [target] [flags]

Flags

FlagDescription
--user <user>SSH username (default: detected from VM config)
--port <port>SSH port (default: 22)
--identity <file>SSH private key file

Examples

# Interactive target selection
teactl access ssh march-seminar

# Specific VM
teactl access ssh march-seminar bastion

# With custom user
teactl access ssh march-seminar bastion --user admin

# Run command
teactl access ssh march-seminar bastion -- ls -la

Interactive selection:

$ teactl access ssh march-seminar
? Select target:
  > bastion (10.0.1.10)
    worker-1 (10.0.1.20)
    worker-2 (10.0.1.21)
    participant-1 (10.0.2.1)
    participant-2 (10.0.2.2)

Connecting to bastion...
Welcome to Ubuntu 22.04 LTS
root@bastion:~$

Jump Hosts

For VMs without public IPs, use a jump host:

# Via bastion
teactl access ssh march-seminar worker-1 --jump bastion

# Direct (if public IP available)
teactl access ssh march-seminar bastion

teactl access terminal

Open a web terminal in your browser.

teactl access terminal <env> [target] [flags]

Flags

FlagDescription
--no-browserPrint URL instead of opening browser
--participant <id>Open as specific participant

Examples

# Open web terminal
teactl access terminal march-seminar

# Get URL without opening
teactl access terminal march-seminar --no-browser

# Specific participant's terminal
teactl access terminal march-seminar --participant 3
$ teactl access terminal march-seminar
Opening terminal in browser...
URL: https://terminal.march-seminar.env.teabar.dev

teactl access port-forward

Forward local ports to services in the environment.

teactl access port-forward <env> [flags]

Flags

FlagDescription
--pod <name>Pod name (supports glob patterns)
--service <name>Service name
--port <local:remote>Port mapping (can specify multiple)
--address <addr>Local address to bind (default: 127.0.0.1)

Examples

# Interactive selection
teactl access port-forward march-seminar

# Specific pod
teactl access port-forward march-seminar --pod gitlab-webservice-abc123 --port 8080:80

# Service
teactl access port-forward march-seminar --service gitlab --port 8080:80

# Multiple ports
teactl access port-forward march-seminar --service gitlab --port 8080:80 --port 8443:443

# All interfaces (expose to network)
teactl access port-forward march-seminar --service gitlab --port 8080:80 --address 0.0.0.0

Interactive selection:

$ teactl access port-forward march-seminar
? Select target type:
  > Pod
    Service

? Select pod:
    gitlab-webservice-7f8b9 (Running)
  > postgresql-0 (Running)
    redis-master-0 (Running)

? Port mapping (local:remote): 5432:5432

Forwarding 127.0.0.1:5432 -> postgresql-0:5432
Press Ctrl+C to stop.

Handling connection from 127.0.0.1:52341...

teactl access url

List access URLs for environment services.

teactl access url <env> [flags]

Flags

FlagDescription
--openOpen URLs in browser
--service <name>Filter by service name
--output <format>Output format (table, json, yaml)

Examples

# List all URLs
teactl access url march-seminar

# Open all URLs in browser
teactl access url march-seminar --open

# Specific service
teactl access url march-seminar --service gitlab --open

Sample output:

$ teactl access url march-seminar
SERVICE     URL                                           STATUS
GitLab      https://gitlab.march-seminar.env.teabar.dev   Ready
ArgoCD      https://argocd.march-seminar.env.teabar.dev   Ready
Grafana     https://grafana.march-seminar.env.teabar.dev  Ready
Registry    https://registry.march-seminar.env.teabar.dev Ready

teactl access credentials

Show or copy credentials for environment services.

teactl access credentials <env> [flags]

Flags

FlagDescription
--name <name>Filter by credential name
--copyCopy to clipboard
--showShow secret values (default: masked)
--output <format>Output format (table, json, yaml)

Examples

# List credentials (masked)
teactl access credentials march-seminar

# Show specific credential
teactl access credentials march-seminar --name gitlab-root-password --show

# Copy to clipboard
teactl access credentials march-seminar --name gitlab-root-password --copy

Sample output:

$ teactl access credentials march-seminar
NAME                    TYPE        VALUE
gitlab-root-password    password    ********
gitlab-runner-token     token       ********
argocd-admin-password   password    ********
grafana-admin-password  password    ********

Use --show to display values, or --copy to copy to clipboard.
$ teactl access credentials march-seminar --name gitlab-root-password --show
NAME                    TYPE        VALUE
gitlab-root-password    password    K7mPx2nQw9AbCdEf

✓ Copied to clipboard

teactl access expose

Expose ports for participants (admin only).

teactl access expose <env> [flags]

Flags

FlagDescription
--participant <id>Participant ID
--all-participantsExpose for all participants
--port <port>Port to expose
--publicMake publicly accessible (no auth)
--name <name>Display name for the port

Examples

# Expose port 3000 for participant 5
teactl access expose march-seminar --participant 5 --port 3000 --name "Dev Server"

# Expose for all participants
teactl access expose march-seminar --all-participants --port 8080

# Public exposure (no auth required)
teactl access expose march-seminar --participant 5 --port 3000 --public

teactl access unexpose

Remove port exposure.

teactl access unexpose <env> [flags]

Flags

FlagDescription
--participant <id>Participant ID
--port <port>Port to unexpose

Examples

teactl access unexpose march-seminar --participant 5 --port 3000

teactl access ports

List all exposed ports.

teactl access ports <env> [flags]

Examples

$ teactl access ports march-seminar
PARTICIPANT  PORT   NAME         PUBLIC  URL
5            3000   Dev Server   No      https://p5-3000.march-seminar.env.teabar.dev
5            8080   App          Yes     https://p5-8080.march-seminar.env.teabar.dev
7            3000   Dev Server   No      https://p7-3000.march-seminar.env.teabar.dev

teactl access sessions

List active terminal and IDE sessions.

teactl access sessions <env> [flags]

Examples

$ teactl access sessions march-seminar
PARTICIPANT  TYPE      STARTED       IDLE     SESSION ID
3            terminal  10 min ago    2m       sess_abc123
5            ide       45 min ago    5m       sess_def456
7            terminal  2 min ago     10s      sess_ghi789

teactl access terminate

Terminate a terminal or IDE session.

teactl access terminate <env> --session <id> [flags]

Examples

# Terminate specific session
teactl access terminate march-seminar --session sess_abc123

# With confirmation
teactl access terminate march-seminar --session sess_abc123
$ teactl access terminate march-seminar --session sess_abc123
Session: sess_abc123
Participant: 3
Type: terminal
Started: 10 minutes ago

Terminate this session? [y/N] y

✓ Session terminated

Common Workflows

Database Access

# Forward PostgreSQL port
teactl access port-forward march-seminar 
  --service postgresql 
  --port 5432:5432

# In another terminal, connect with psql
psql -h localhost -p 5432 -U postgres

Local Kubernetes Development

# Get kubeconfig
teactl access kubeconfig march-seminar --merge

# Switch context
kubectl config use-context march-seminar

# Deploy locally built image
kubectl set image deployment/myapp myapp=localhost:5000/myapp:dev

Quick Service Access

# Open all services in browser
teactl access url march-seminar --open

# Get GitLab credentials and open
teactl access credentials march-seminar --name gitlab-root-password --copy
teactl access url march-seminar --service gitlab --open

Related Commands

ende