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.
Doctor
bast doctor
bast doctor --json
bast doctor --fix
bast doctor --probeDiagnoses SSH config, keys, permissions, and Bast setup. Failures exit 1; warnings do not. See Doctor.
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 add legacy --hostname legacy.example --user root --password
bast hosts edit production_web --notes "Primary application server"
bast hosts edit legacy --clear-password
bast hosts favorite production_web
bast hosts hide old_server
bast hosts known-host remove production_web
bast hosts delete production_webHost edits are patches: fields you omit stay unchanged. Flags like --clear-group, --clear-notes, --clear-identity, and --clear-password remove values on purpose. --password prompts on the terminal and stores the secret locally for connect.
Advanced connection settings use dedicated flags:
bast hosts add "Production web" --hostname prod.example.com \
--proxy-jump bastion \
--forward-agent no \
--startup-command "tmux attach -t main" \
--request-tty force \
--set-env APP_ENV=production \
--local-forward "8080 localhost:80" \
--keepalive 30Repeat --set-env, --local-forward, --remote-forward, and --ssh-option for multiple values. On edit, use the matching --clear-* flag to remove a value or return to the OpenSSH default.
See Advanced host options for what every option does, syntax examples, and security notes.
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 --yesRun bast keys <command> --help for command-specific usage.
Sync commands
bast sync gcp
bast sync aws
bast sync azure
bast sync boat
bast sync upstash
bast sync vercel
bast sync hetzner
bast sync bitqate
bast sync railway
bast sync fly
bast sync digitalocean
bast sync boxd
bast sync status
bast sync disable gcp
bast sync disable boat
bast sync disable upstash
bast sync disable vercel
bast sync disable hetzner
bast sync disable bitqate
bast sync disable railway
bast sync disable fly
bast sync disable digitalocean
bast sync disable boxdBAST_NO_SYNC=1 hides Sync and rejects bast sync and the provider commands (bast boat, bast upstash, and the rest). Hosts already imported stay in the list. BAST_NO_VAULT=1 does the same for Vault and bast vault.
Sync imports cloud hosts as read-only. Cloud connections through bast connect or bast <label> use the same banner and access-preparation flow as the TUI. See GCP, AWS, Azure, Boat, Upstash Box, Vercel Sandbox, Hetzner Cloud, BitQate, Railway, Fly.io, DigitalOcean, or boxd for provider setup.
bast upstash new [--name name] [--runtime node] [--size small] [--keep-alive]
bast upstash fork <host|id>
bast upstash stop <host|id>
bast upstash resume <host|id>
bast upstash delete <host|id> [--yes]
bast upstash key [--key-file path]bast vercel token [--token-file path] [--team team_id] [--project project_id]
bast vercel new [--name name] [--vcpus 1|2|4] [--timeout 15m|1h|5h] [--ephemeral]
bast vercel fork <host|id> [--name name]
bast vercel stop <host|id>
bast vercel resume <host|id>
bast vercel delete <host|id> [--yes]
bast vercel cleanup [--yes]bast hetzner key [--name project] [--key-file path]
bast hetzner key --remove project
bast hetzner start <host|id>
bast hetzner stop <host|id> [--force]
bast hetzner restart <host|id> [--force]bast railway key [--key-file path]
bast railway new --name name (--project id|name | --new-project name) [--image image] [--start-command command] [--environment id]
bast railway stop <host|id>
bast railway resume <host|id>
bast railway delete <host|id> [--yes]bast fly new --app APP --image IMAGE [--org slug] [--region code] [--size size] [--name name]
bast fly fork <host|id> [--region code]
bast fly stop <host|id>
bast fly resume <host|id>
bast fly delete <host|id> [--yes]bast digitalocean new --name name [--region slug] [--size slug] [--image slug] [--context name]
bast digitalocean fork <host|id>
bast digitalocean stop <host|id>
bast digitalocean resume <host|id>
bast digitalocean delete <host|id> [--yes]bast do is an alias of bast digitalocean.
bast boxd new [--name name] [--org org] [--region region] [--vcpu n] [--snapshot name]
bast boxd fork <host|name> [--name name]
bast boxd stop <host|name>
bast boxd start <host|name>
bast boxd restart <host|name>
bast boxd delete <host|name> [--yes]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
bast doctor --jsonSuccess 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).
Shell completions
The script installers and Homebrew enable tab completion. Open a new terminal, type bast, and press Tab. See Shell completions.