Skip to content

sb Command

The sb command is a pure client tool for managing existing supervisors and terminals. It doesn't spawn any processes itself—it only connects to existing terminals.

Usage

sb [command] [flags]

Commands

sb attach (alias: a)

Attach to an existing terminal:

sb attach <name-or-id>
sb attach my-terminal
sb attach abc123

Flags:

  • --id <id>: Terminal ID (mutually exclusive with --name)
  • --name <name>: Terminal name (mutually exclusive with --id)
  • --socket <file>: Socket file path

sb detach

Detach from a terminal:

sb detach
sb detach <name-or-id>

sb get

Query terminals, supervisors, and profiles:

# List terminals
sb get terminals

# List supervisors
sb get supervisors

# List profiles
sb get profiles

# Get specific terminal
sb get terminal <name-or-id>

# Get specific supervisor
sb get supervisor <name-or-id>

# Get specific profile
sb get profile <name>

Flags:

  • -a, --all: Show all terminals/supervisors including exited ones
  • -o, --output <format>: Output format (json, yaml, or human-readable)

sb prune

Prune old terminals and supervisors:

sb prune
sb prune --older-than 30d

Flags:

  • --older-than <duration>: Prune terminals/supervisors older than duration (e.g., 30d, 1w, 2h)

sb version

Show version information:

sb version

sb autocomplete

Generate shell completion:

sb autocomplete bash
sb autocomplete zsh

Persistent Flags

These flags apply to all sb commands:

  • --config <file>: Config file (default: $HOME/.sbsh/config.yaml)
  • -v, --verbose: Enable verbose logging
  • --log-level <level>: Log level (debug, info, warn, error)
  • --run-path <path>: Run path directory

Examples

List Active Terminals

sb get terminals

Attach to Terminal by Name

sb attach my-terminal

Attach to Terminal by ID

sb attach abc123

List All Terminals (Including Exited)

sb get terminals -a

Get Terminal Details (JSON)

sb get terminal my-terminal -o json

Get Profile Details

sb get profile terraform-prd

Prune Old Terminals

sb prune --older-than 7d

Output Formats

Human-Readable (Default)

sb get terminals

JSON

sb get terminals -o json

YAML

sb get terminals -o yaml

See Also