Bast

Command line

Manage hosts and keys from the shell, with JSON output for scripts and automation.

Everything in the TUI is also available from the shell. That matters for scripts, automation, and tools that need stable output.

Host commands

bast hosts list --sort group
bast hosts show production_web
bast hosts add "Production web" --hostname prod.example.com --user deploy --group Work/Production --tag web
bast hosts edit production_web --notes "Primary application server"
bast hosts favorite production_web
bast hosts hide old_server
bast hosts known-host remove production_web
bast hosts delete production_web

Host edits are patches: fields you omit stay unchanged. Flags like --clear-group, --clear-notes, and --clear-identity remove values on purpose.

Run bast hosts <command> --help for the full option list per command.

Key commands

bast keys list
bast keys generate work --algorithm ed25519
bast keys import work --private ~/.ssh/id_ed25519
bast keys comment work --comment "Work laptop"
bast keys public work
bast keys install work --host production_web
bast keys export work --directory ~/Desktop --yes
bast keys delete work --yes

Run bast keys <command> --help for command-specific usage.

JSON mode

Pass --json anywhere in the command for machine-readable output. It disables prompts, so pair it with flags like --yes for destructive actions:

bast hosts list --json
bast --json hosts show Production_web
bast keys generate automation --no-passphrase --json

Success looks like {"ok":true,"data":...}. Errors go to stderr with a non-zero exit code. Commands that need an interactive SSH session or passphrase entry reject --json with interactive_required.

Prompts and confirmations

Commands prompt for missing input and sensitive confirmations when attached to a terminal. Pass --yes to explicitly approve deletion, known-host removal, or private-key export in unattended use. Pass --no-input to never prompt (fields must be provided via flags).

On this page