Installation
Install with a single command:
curl -fsSL https://bithost.io/cli | bash
The installer places the bh binary in ~/.local/bin/. If your shell can't find bh after installing, add it to your PATH:
export PATH="$HOME/.local/bin:$PATH"
To make this permanent, add the line above to your ~/.bashrc or ~/.zshrc.
Building from source (contributors only)
Only needed if you want to contribute to or modify the CLI. Requires Go to be installed.
git clone https://github.com/bithostio/bh.git
cd bh
make build
Quick Start
After installing, configure authentication with your API key:
bh auth
Get your API key from dashboard.bithost.io/api/keys.
Check your account balance and details:
bh user
Interactive TUI
Launch the full-screen terminal UI for visual server management:
bh manage
The TUI includes:
- Dashboard with server list and account balance
- Create servers with a step-by-step wizard
- Manage SSH keys
- Delete servers with confirmation
- Copy SSH commands to clipboard
- Auto-refresh server status
- Vim-style navigation (j/k, q to quit)
CLI Commands
Server Management
# List active servers
bh servers list
# List all servers including failed
bh servers list --all
# Create a server
bh servers new --name myserver --provider digital_ocean --region 2 --size 5 --image 10 --keys 1,2
# Create a server with backups enabled
bh servers new --name myserver --provider digital_ocean --region 2 --size 5 --image 10 --keys 1,2 --backups
# Delete a server (with confirmation prompt)
bh servers delete <id>
# Delete a server without confirmation
bh servers delete <id> --force
Resource Discovery
Providers are identified by slug strings (e.g. digital_ocean). Use bh providers to list available slugs.
# List available providers
bh providers
# List regions for a provider
bh regions --provider digital_ocean
# List sizes/plans for a region
bh sizes --provider digital_ocean --region <region-id>
# List OS images
bh images --provider digital_ocean
bh images --provider digital_ocean --arch arm # filter by architecture (default: x86)
SSH Key Management
# List SSH keys
bh ssh-keys list
# Add SSH key (interactive prompts)
bh ssh-keys add
# Add SSH key from file
bh ssh-keys add --label "my-key" --file ~/.ssh/id_rsa.pub
# Add SSH key directly
bh ssh-keys add --label "my-key" --key "ssh-rsa AAAA..."
# Add SSH key for a specific provider (default: digital_ocean)
bh ssh-keys add --label "my-key" --file ~/.ssh/id_rsa.pub --provider digital_ocean
Account
# Show user info (name, email, balance, server limit)
bh user
# Configure API key
bh auth
Configuration
Config is stored in ~/.bh/config.json with 0600 permissions:
{
"api_key": "your-api-key",
"api_base_url": "https://dashboard.bithost.io/api/v1/"
}
Environment variable overrides:
BH_API_KEY- API keyBH_API_URL- API base URL
Troubleshooting
Run bh auth to set up your API key.
Get a new API key from dashboard.bithost.io/api/keys.
Add keys with bh ssh-keys add or at dashboard.bithost.io/keys.
Top up at dashboard.bithost.io.
Source on GitHub: github.com/bithostio/bh