Skip to content
English
Dashboard

CLI Authentication

Before the CLI can manage machines, sign in with your SnapVM account.

Run:

snapvm login

The CLI opens a browser authentication flow. Complete sign-in in the browser, then return to your terminal.

If the browser does not open automatically, use the URL printed by the CLI.

List the machines available to your account:

snapvm list

By default, snapvm list shows machines owned by you in the selected organization. Organization owners and admins can use --all or --user-id when they need a broader view.

snapvm list --all
snapvm list --user-id me
snapvm list --output json

Use --org when your account has access to more than one organization:

snapvm --org my-team list

You can also set the default organization for your shell session:

export SNAPVM_ORG="my-team"

Most machine commands accept a machine name or ID. You can also set a default machine for a command:

snapvm --machine frontend-lab console

For a project directory, prefer local context:

snapvm use frontend-lab
snapvm exec pwd

The CLI defaults to the public SnapVM service. If your workspace administrator gives you a custom SnapVM URL, use the matching option:

snapvm login --web-url https://snapvm.example.com
snapvm --api-url https://snapvm.example.com/api list

For repeated use, set the environment variables your administrator provides:

export SNAPVM_WEB_URL="https://snapvm.example.com"
export SNAPVM_API_URL="https://snapvm.example.com/api"

Remove stored CLI credentials:

snapvm logout

Run snapvm login again when you need to reconnect the CLI.

Copy the authentication URL printed in the terminal, open it in your browser, complete sign-in, and return to the CLI.

Run:

snapvm login

If the problem continues, log out and sign in again:

snapvm logout
snapvm login

Confirm that you selected the expected organization and that the console shows machines for your account. If access looks wrong, contact your workspace administrator.