CLI ยท bh

CLI Docs

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
bithost.io Balance: $75.36   Servers: 1/10
[email protected]   v0.1.1
SERVERS
NAMEIPSTATUSCOSTPROVIDER
> server 111.111.111.111 active $0.02 digital_ocean
n: new server • s: ssh keys • t: top up • r: refresh • enter: details • d: delete • q: quit

The TUI includes:

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:

Troubleshooting

"config not found"

Run bh auth to set up your API key.

"Authentication failed"

Get a new API key from dashboard.bithost.io/api/keys.

"No SSH keys found"

Add keys with bh ssh-keys add or at dashboard.bithost.io/keys.

Low balance

Top up at dashboard.bithost.io.

Source on GitHub: github.com/bithostio/bh

Top up in crypto.
Be root in a minute.

No cards. No KYC. Uninterrupted service since 2014. For people who'd rather not explain why they need a server.

Deploy a server โ†’