CLI
The sandywp CLI is a thin, dependency-free client over the SandyWP API.
Authenticate once, then create and manage sandboxes from your terminal.
Installation
# Install globally
npm install -g @sandywp/cli
# …or run without installing
npx @sandywp/cli <command> Requires Node.js 18+.
Authentication
sandywp auth login uses a browser flow (like gh auth login):
it opens SandyWP, you approve the device, and a personal API token is saved to ~/.sandywp/config.json.
sandywp auth login
# → opens your browser
# → click "Authorize this device"
# → ✓ Logged in to https://app.sandywp.com as [email protected] For servers or CI where no browser is available, pass a token directly:
# CI / headless: skip the browser and pass a token directly
sandywp auth login --token swp_xxxxxxxxxxxxxxxxxxxx sandywp auth logout revokes the stored token on the server and removes the
local config.
Commands
| Command | Description |
|---|---|
sandywp auth login | Log in via browser (or --token for headless) |
sandywp auth logout | Revoke this device's token and log out |
sandywp add [name] | Create a sandbox and wait until it's ready |
sandywp list | List your sandboxes |
sandywp status | Show your account, plan, and usage |
sandywp login <name> | Print a one-time login URL for a sandbox |
sandywp delete <name> | Delete a sandbox by slug |
add
Creates a sandbox. The name is optional — leave it blank for an auto-generated one.
The command waits for provisioning and shows live stages; pass --no-wait to
return immediately.
$ sandywp add my-site
Creating sandbox "my-site" — https://my-site.eu1.sandywp.dev
⠹ Installing WordPress · 9s
✓ Sandbox "my-site" is ready
url: https://my-site.eu1.sandywp.dev
status: ready list
$ sandywp list
SLUG STATUS URL
my-site ready https://my-site.eu1.sandywp.dev
demo ready https://demo.eu1.sandywp.dev status
$ sandywp status
Account: [email protected]
Plan: free
Sandboxes: 2 / 2 active (0 remaining) login
Prints a one-time magic-login URL that opens the sandbox already signed in to wp-admin. Add --open to launch it in your browser automatically.
sandywp login my-site --open delete
Deletes a sandbox by its slug (the value shown under SLUG in list).
sandywp delete my-site Flags
| Flag | Applies to | Description |
|---|---|---|
--base-url <url> | auth login | Target a non-default API host (defaults to https://app.sandywp.com) |
--token <token> | auth login | Log in headlessly with an existing token |
--no-browser | auth login | Print the authorize URL instead of opening a browser |
--no-wait | add | Return immediately instead of waiting for the sandbox to be ready |
--open | login | Open the login URL in your browser |
Configuration
Credentials are stored at ~/.sandywp/config.json (file permissions 0600):
{
"baseUrl": "https://app.sandywp.com",
"token": "swp_xxxxxxxxxxxxxxxxxxxx"
}