> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rafftechnologies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Raff CLI

> Manage Raff resources from your terminal — VMs, volumes, snapshots, backups, VPCs, public IPs, firewalls, SSH keys, API keys, and team & access control. The CLI uses the same public API as the dashboard, with the same role-based authorization model.

<sub>Updated May 10, 2026</sub>

The **Raff CLI** (`raff`) is a single static binary that wraps the Raff public API for terminal use. Same API key auth as the dashboard, same role-based scoping, same resources — just driven from the command line. It's the right tool for one-off operations, scripted workflows, and CI/CD pipelines.

For declarative infrastructure (commit your VM and project definitions to git), use [Terraform](/reference/terraform/introduction) instead. CLI is imperative; Terraform is declarative.

## What you can do with the CLI

| Resource                | Commands                                                                                                                                                                                                                                      |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Configure**           | `raff configure` — set API key, base URL, default project                                                                                                                                                                                     |
| **Virtual Machines**    | [`raff vm`](/reference/cli/vm) — full lifecycle: create, delete, power, reboot, hard-reboot, reinstall, factory-reset, rename, reset-password, resize, resize-disk, save-image, plus IP / firewall / VPC attach-detach, tags, notes, networks |
| **Volumes**             | [`raff volume`](/reference/cli/volume) — list, get, create, delete, resize, attach, detach                                                                                                                                                    |
| **Snapshots**           | [`raff snapshot`](/reference/cli/snapshot) — list, get, create, rename, restore, delete                                                                                                                                                       |
| **Backups**             | [`raff backup`](/reference/cli/backup) — backups + recurring schedules with retention                                                                                                                                                         |
| **VPCs**                | [`raff vpc`](/reference/cli/vpc) — list, get, create, update, delete, cidr-suggestions                                                                                                                                                        |
| **Public IPs**          | [`raff ip`](/reference/cli/ip) — list, get, reserve, release, change                                                                                                                                                                          |
| **Firewalls**           | [`raff security-group`](/reference/cli/security-group) — list, templates, get, create, update, delete                                                                                                                                         |
| **SSH Keys**            | [`raff ssh-key`](/reference/cli/ssh-key) — register, list, rename, delete                                                                                                                                                                     |
| **API Keys**            | [`raff api-key`](/reference/cli/api-key) — create, regenerate, revoke                                                                                                                                                                         |
| **Projects**            | [`raff project`](/reference/cli/project) — list, get, create, update, delete + members                                                                                                                                                        |
| **Members**             | [`raff member`](/reference/cli/member) — account-level membership                                                                                                                                                                             |
| **Roles & Permissions** | [`raff role`](/reference/cli/role), [`raff permission`](/reference/cli/permission) — IAM                                                                                                                                                      |
| **Invitations**         | [`raff invitation`](/reference/cli/invitation) — send + cancel                                                                                                                                                                                |
| **Catalog / lookup**    | [`raff region`](/reference/cli/region), [`raff template`](/reference/cli/template), [`raff pricing`](/reference/cli/pricing) — discovery for required IDs                                                                                     |

Every command supports `--output json` for parseable output (default is human-readable tables). Every command honors the same auth precedence: CLI flag > env var > config file.

## Quick start

```bash theme={null}
# Install
go install github.com/RaffTechnologies/raff-cli/cmd/raff@latest

# Configure (writes to ~/.raff/config.yaml)
raff configure

# Pick the project you want to work with
raff project list

# Create a VM
raff vm create \
  --name web-01 \
  --template-id <template-uuid> \
  --pricing-id 9 \
  --region us-east \
  --project-id <project-id>

# Watch it come up
raff vm list --output json | jq '.[] | {name, status}'

# When you're done
raff vm delete <vm-id>
```

## Authentication and configuration

The CLI looks for credentials in this order:

1. **CLI flags** (`--api-key`, `--api-url`, `--project-id`)
2. **Environment variables** (`RAFF_API_KEY`, `RAFF_API_URL`, `RAFF_PROJECT_ID`)
3. **Config file** (`~/.raff/config.yaml`)

`raff configure` walks you through writing the config file. Multiple profiles are supported with `--profile <name>` so you can keep `prod`, `staging`, and `dev` credentials side-by-side.

For CI/CD where there's no interactive shell, set `RAFF_API_KEY` and `RAFF_PROJECT_ID` as secrets and skip the config file entirely. See [Configure](/reference/cli/configure) for the full setup walkthrough.

## Output formats

```bash theme={null}
# Default table output — human-readable
raff vm list

# JSON output — for scripting
raff vm list --output json

# Pipe through jq for transformations
raff vm list --output json | jq '.[] | select(.status == "running") | .id'
```

The JSON shape matches the [public API response schema](/api-reference/endpoints). Anything you can do with `curl` you can do with `raff <command> --output json`.

## Cross-cutting flags

| Flag                    | What it does                                                                |
| ----------------------- | --------------------------------------------------------------------------- |
| `--api-url <url>`       | Override the API base URL — defaults to production                          |
| `--api-key <key>`       | Override the API key for this command                                       |
| `--project-id <uuid>`   | Override the default project for this command                               |
| `-o, --output <format>` | `table` (default) or `json`                                                 |
| `--profile <name>`      | Use a named profile from your config file                                   |
| `--help`                | Show help for any command (`raff vm --help`, `raff vm create --help`, etc.) |

## What's covered

The CLI tracks the public API surface — everything in the [API Reference](/api-reference/endpoints) is available through the CLI. Admin-only endpoints (admin-service has its own internal tooling) are not exposed; this is by design. Customer-facing parity is full.

## Where to go next

<CardGroup cols={3}>
  <Card title="Install the CLI" icon="download" href="/reference/cli/install">
    Build from source, install via go, or grab a release binary.
  </Card>

  <Card title="Configure" icon="gear" href="/reference/cli/configure">
    Set up API key, profiles, and defaults.
  </Card>

  <Card title="VM commands" icon="server" href="/reference/cli/vm">
    The full set of VM commands with examples.
  </Card>

  <Card title="Volume commands" icon="cube" href="/reference/cli/volume">
    Block storage management.
  </Card>

  <Card title="Backup commands" icon="shield" href="/reference/cli/backup">
    Backups + recurring schedules.
  </Card>

  <Card title="Project commands" icon="folder" href="/reference/cli/project">
    Create and manage projects.
  </Card>
</CardGroup>
