Automate ByteNests with the bn command line
Install bn, sign in once, and create VMs, databases and apps from your terminal or a CI pipeline.
Clicking through a form is fine for your first server. By the third one, or the first time a pipeline needs a fresh machine, you want a command you can paste. That is what bn is for.
Install it
bn is a single program for Windows, macOS and Linux. Run the install line for your system, then check it works.
curl -fsSL https://bytenests.com/cli/install.sh | sh
bn --version
irm https://bytenests.com/cli/install.ps1 | iex
bn --version
To update later, run the same command again.
Sign in
bn auth login opens your browser so you can approve the sign-in. bn gets its own token, which shows up under Settings → API tokens as a CLI sign-in, and you can revoke it there at any time. On a server with no browser, use bn auth login --no-browser and open the printed address on another device.
From nothing to a VM you can SSH into
bn ssh-key add --name laptop --file ~/.ssh/id_ed25519.pub
bn image list
bn plan list
bn vm create --name web-1 --image ubuntu-24.04 --plan small --ssh-key laptop --wait
bn vm ssh web-1
Run bn vm create with no flags and it asks for each choice instead, shows the price before anything is created, and prints the one-line command so you can repeat it next time. Add --dry-run to check a price without creating or paying for anything.
Databases and apps too
bn covers more than VMs. The same tool creates managed databases, App Platform apps, object storage buckets and your container registry:
bn db create shop-db --engine postgres --plan db-2 --wait
bn app create api --repo https://github.com/acme/api --port 3000 --database shop-db --wait
bn app logs api
Attaching the database gives the app its own database user and a DATABASE_URL variable, so there is no password to copy around. bn db options and bn app options list the engines, sizes and prices.
Use it in CI
For pipelines, create a token under Settings → API tokens. Pick Read only for dashboards and monitoring, Full access for anything that creates or deletes, and give it an expiry date. Store it as a secret in your CI and expose it as BN_TOKEN; bn uses it without writing it to disk.
export BN_TOKEN=bnt_...
ip=$(bn vm create --name ci-runner --image debian-12 --plan small \
--ssh-key-file ~/.ssh/id_ed25519.pub --yes --wait --query 0.publicIps.0)
ssh bytenests@"$ip" ./deploy.sh
-o json prints the full API answer, --query picks out one field, and every kind of failure has its own exit code. vm create also sends a retry-safe key with each VM, so a dropped connection never creates or bills a second machine.
The full command list is in the bn documentation, and everything bn does is also available over the REST API.