ssh & port-forwarding

SonicInfra Compute Instances, from your terminal.

sonic is the official SonicInfra CLI. Authenticate with a magic link, then SSH into any Compute Instance, forward its ports, or inject a key — all over an authenticated tunnel straight into your Compute Instance.

$ curl -fsSL sonicinfra.com/cli/install.sh | sh
Read the docs →
$ ▌
Features

Built for Compute Instance access, not ceremony.

⌁
Direct SSH, no bastion
sonic ssh <vm> opens an SSH session directly to your compute instance.
▧
Manage any resource
sonic instances create web-01 --instanceType ne.2 --image ubuntu-24-04 — list, get, create, update, and delete work for every resource type the API exposes, with fields generated straight from its OpenAPI spec.
⇄
Native ssh & scp
sonic ssh-setup adds a ProxyCommand entry to ~/.ssh/config once, so plain ssh myvm.sonicinfra, scp, and rsync tunnel through sonic automatically — no wrapper needed.
◧
Port-forwarding built in
sonic port-forward <vm> <port> forwards any Compute Instance port to localhost. Use local:remote to pick your own local port.
◈
Magic-link auth
sonic login authenticates you via an emailed link. Sessions are stored locally — no long-lived API keys to leak.
⚙
CI-friendly machine tokens
sonic machine-token request mints a short-lived, scoped token (up to 90 days) for pipelines; machine-token use consumes it non-interactively.
▤
Key injection via guest agent
sonic ssh-copy-id <vm> pushes your public key into a Compute Instance, even before it's reachable over the network.
⚡
Boot-aware connections
sonic ssh polls Compute Instance readiness before connecting, so scripts don't race a still-starting machine.
Install

Get sonic.

Shell script (Linux)
curl -fsSL sonicinfra.com/cli/install.sh | sh
Bash completion
curl -fsSL sonicinfra.com/cli/versions/latest/sonic-completion.bash | sudo tee /etc/bash_completion.d/sonic > /dev/null
Manual binary download
Quick reference

The commands you'll actually run.

sonic login
Authenticate via a magic-link email from SonicInfra.
sonic <resource> list / get / create / update / delete
Manage any API resource — instances, volumes, images, ssh-keys, load-balancers, and more — with fields generated straight from the API's OpenAPI spec. E.g. sonic instances create web-01 --instanceType ne.2 --image ubuntu-24-04. Run sonic <resource> with no action, or sonic <anything>, to see what's available. list takes --fields name,field2,... and --no-header for scripting.
sonic wait-for <operation_id>
Poll an async operation (the operation_id a create/update prints) until it finishes, same as the dashboard's own polling.
sonic ssh <vm>
Open an SSH session to a Compute Instance. Accepts user@vm; always waits until it's ready before connecting.
sonic ssh-setup
One-time setup: adds a Host *.sonicinfra / ProxyCommand entry to ~/.ssh/config so plain ssh, scp, and rsync reach Compute Instances directly, e.g. ssh myvm.sonicinfra.
sonic port-forward <vm> <port>
Forward a Compute Instance port to localhost. Use local:remote to choose the local port.
sonic ssh-copy-id <vm>
Inject your public key into a Compute Instance.
sonic status / sonic logout
Show or clear the current authentication state.
sonic machine-token request / use
Mint and consume long-lived tokens for CI.