The vpsm CLI
vpsm connects your computer to private databases and k3s clusters on your servers through an encrypted tunnel. No database or Kubernetes port is ever opened to the internet.
Install
Prebuilt downloads: [CLI DOWNLOAD LINK, not published yet]. Until then, build it from source with Go: runmake cliin theagent/folder of the source tree. The binary is written toagent/bin/vpsm.
Create an access token
The CLI signs in with a personal API token for one organization.
- In your workspace, open Settings → Security and find API tokens for <your org>.
- Enter a Token name (for example
laptop) and pick when it Expires (default 90 days). - Tick the permissions it needs. For the CLI:
org:read,db:readanddb:queryfor databases, andcluster:readfor clusters. You can only grant permissions you have yourself. - Click Create and confirm your password. Copy the token now: it starts with
vpsm_pat_and is shown only once.
A token can never do more than your role allows, even if your role changes later. Revoke it from the same page with Revoke.
Sign in
vpsm login --api https://<api host>Paste the token when asked (or pass --token, though that leaves it in your shell history). The CLI checks the token and prints Logged in as <you> to <org>. The token is saved in your user config folder (vpsm/config.json, readable only by you). --api can also come from the VPSM_API environment variable.
vpsm whoami # who and which organization you are signed in as
vpsm versionvpsm db connect
vpsm db connect <name or id> [--port 15432]Opens a local port on 127.0.0.1 that forwards to the database on its server. Default ports: PostgreSQL 15432, MySQL 13306, Redis 16379. The CLI prints a ready-made connection command, for example:
psql 'postgres://app:<password>@127.0.0.1:15432/app'Fill in the password from the database page (Connect → Show connection URL). Press Ctrl-C to stop.
Each connection you open gets its own short-lived, single-use ticket tied to you, the database and your IP address. Traffic goes through our API and the server's agent; nothing listens on the server.
vpsm kube connect
vpsm kube connect <name or id> [--port 16443] [--kubeconfig <path>]This does two things:
- Writes a kubeconfig, by default
~/.kube/vpsm-<cluster id>.json(readable only by you), pointing athttps://127.0.0.1:16443with the cluster's CA. - Opens the tunnel to the cluster's API server. TLS runs end to end from kubectl to the cluster.
Then, in another terminal:
export KUBECONFIG=~/.kube/vpsm-<cluster id>.json
kubectl get pods -Akubectl gets its credentials from vpsm itself: a Kubernetes token valid for one hour, cached until shortly before it expires. If your token has cluster:manage and you hold that permission, you get admin access in the cluster; otherwise read-only access. When you lose access in VPS Manager, your cluster tokens are removed too.