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

# CLI Commands

> Complete reference for all Voyant CLI commands

## Authentication

### voyant login

Authenticate with Voyant via browser-based OAuth.

```bash theme={null}
voyant login
voyant login --force  # Re-authenticate even if already logged in
```

### voyant logout

Clear stored credentials from your machine.

```bash theme={null}
voyant logout
```

### voyant whoami

Display your current authentication status and available workspaces.

```bash theme={null}
voyant whoami
```

**Example output:**

```
Logged in as: john@example.com (user_abc123)

Workspaces:
  wksp_abc123  Acme Travel Agency   owner
  wksp_def456  Partner Agency       member
```

## Project Setup

### voyant init

Initialize a Voyant project by creating a `voyant.json` configuration file.

```bash theme={null}
voyant init            # Interactive setup
voyant init -y         # Accept defaults without prompting
voyant init --force    # Overwrite existing configuration
```

| Option      | Description                      |
| ----------- | -------------------------------- |
| `-y, --yes` | Accept all defaults              |
| `--force`   | Overwrite existing `voyant.json` |

### voyant link

Re-link to a different project without full initialization.

```bash theme={null}
voyant link                              # Interactive selection
voyant link --workspace wksp_abc123      # Pre-select workspace
voyant link --project proj_xyz789        # Link directly to project
```

| Option             | Description           |
| ------------------ | --------------------- |
| `--workspace <id>` | Workspace ID to use   |
| `--project <id>`   | Project ID to link to |

### voyant unlink

Remove the `voyant.json` configuration file.

```bash theme={null}
voyant unlink      # Prompts for confirmation
voyant unlink -y   # Skip confirmation
```

| Option      | Description              |
| ----------- | ------------------------ |
| `-y, --yes` | Skip confirmation prompt |

## Development

### voyant dev

Authenticate your localhost for local development. This generates a session token that allows your local server to communicate with Voyant APIs.

```bash theme={null}
voyant dev                                # Standard authentication
voyant dev --url http://localhost:4000    # Override dev URL
voyant dev --no-open                      # Don't open browser
voyant dev --token-only                   # Output token only (for CI)
```

| Option         | Description                      |
| -------------- | -------------------------------- |
| `--url <url>`  | Override the dev URL from config |
| `--no-open`    | Don't open browser automatically |
| `--token-only` | Print token only, for CI/scripts |

#### Payload CMS Integration

If your project uses Payload CMS, authenticate the admin panel:

```bash theme={null}
voyant dev --payload                      # Auth dev session + Payload admin
voyant dev --payload-only                 # Only auth Payload admin
voyant dev --payload --admin-path /cms    # Custom admin path
```

| Option                | Description                                  |
| --------------------- | -------------------------------------------- |
| `--payload`           | Also authenticate Payload CMS admin          |
| `--payload-only`      | Only authenticate Payload (skip dev session) |
| `--admin-path <path>` | Payload admin path (default: `/admin`)       |

## Utilities

### voyant config

Display current project configuration from `voyant.json`.

```bash theme={null}
voyant config
```

### voyant workspaces

List all workspaces you have access to.

```bash theme={null}
voyant workspaces
```

### voyant projects

List all projects in a workspace.

```bash theme={null}
voyant projects                            # Prompts for workspace
voyant projects --workspace wksp_abc123    # Specific workspace
```

| Option             | Description                        |
| ------------------ | ---------------------------------- |
| `--workspace <id>` | Workspace ID to list projects from |

### voyant open

Open the current project in the Voyant dashboard.

```bash theme={null}
voyant open              # Open project dashboard
voyant open --workspace  # Open workspace settings
```

| Option        | Description                                |
| ------------- | ------------------------------------------ |
| `--workspace` | Open workspace settings instead of project |

### voyant status

Show deployment status for the current project.

```bash theme={null}
voyant status
```

**Example output:**

```
Project: My Travel App (proj_abc123)

Environments:
  production   v42  active    main      2 hours ago
  staging      v38  active    develop   5 hours ago
  preview      v45  building  feature   just now

Recent Deployments:
  v45  preview     building   abc1234  Add booking feature   just now
  v44  preview     inactive   def5678  Fix header            1 hour ago
  v42  production  active     jkl3456  Release 2.1.0         2 hours ago
```
