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

# Ornn Compute CLI

> Install and use the Ornn Compute CLI (ornn) to sign in from a terminal and run tenant-scoped reservation, access, and billing commands through the same web authorization layer as the browser app.

Use the Ornn Compute CLI (`ornn`) to sign in from a terminal and run tenant-scoped reservation, access, and billing commands through the same web authorization layer as the browser app.

## Easy install

Install from the hosted web app:

```bash theme={null}
curl -fsSL https://compute.ornn.com/cli/install | sh
```

For local development:

```bash theme={null}
curl -fsSL http://localhost:3000/cli/install | sh
```

The installer:

* prints a short Ornn Compute welcome banner and login prompt
* requires Node.js 20 or newer and `npm`
* installs `@ornncompute/cli` globally
* installs the `ornn` command
* adds the npm global bin directory to your shell profile if needed
* writes `ORNN_AUTH_BASE_URL` for the host that served the installer

Set `ORNN_INSTALL_BANNER=0` to skip the banner or `ORNN_INSTALL_ANIMATION=0` to keep the banner static in scripted installs.

After install, restart your shell or source the updated profile, then run:

```bash theme={null}
ornn login
ornn whoami
```

## Browser login

`ornn login` uses a browser device flow:

1. The CLI asks the web app for a one-time device code.
2. The CLI opens a browser to `/cli/device/<code>` when possible.
3. You sign in with the normal Ornn web login flow.
4. Once the browser session is authenticated, the CLI device request is approved automatically.
5. The CLI stores the approved session in `~/.config/ornn/auth.json`.

If the browser cannot open automatically (for example, on a remote SSH machine), copy the printed URL into any browser, sign in there, and leave the terminal running. The terminal will keep polling until the browser login approves or the request expires.

```bash theme={null}
ornn login
```

Useful options:

```bash theme={null}
ornn login --no-browser
ornn login --auth-base https://compute.ornn.com
ornn login --timeout 600
```

## Commands

```bash theme={null}
ornn help [command]
ornn login [--auth-base <url>] [--no-browser] [--timeout <seconds>]
ornn whoami [--json]
ornn status [--json]
ornn availability list [--gpu-type <type>] [--facility <name>] [--operator <name>] [--json]
ornn availability show <listing-id> [--open] [--json]
ornn buy <listing-id> [--no-open] [--json]
ornn bid create <listing-id> --gpu-count <n> --min-gpu-count <n> --start-date <yyyy-mm-dd> --end-date <yyyy-mm-dd> --price <usd> [--no-open] [--json]
ornn bid list [--json]
ornn bid show <bid-id> [--open] [--json]
ornn bid update <bid-id> --gpu-count <n> --min-gpu-count <n> --start-date <yyyy-mm-dd> --end-date <yyyy-mm-dd> --price <usd>
ornn bid withdraw <bid-id>
ornn reservations list [--status <status>] [--json]
ornn reservations show <reservation-id> [--open] [--json]
ornn reservations checkout <reservation-id> [--no-open] [--json]
ornn access show <reservation-id> [--json]
ornn access activate <reservation-id> --ssh-key-id <id> [--username <name>] [--no-open] [--json]
ornn access push-keys <reservation-id> --ssh-key-id <id> [--json]
ornn resale browse [--json]
ornn resale list <reservation-id> --ask-price <usd> [--no-open] [--json]
ornn resale update <reservation-id> --ask-price <usd> [--no-open] [--json]
ornn resale delist <reservation-id> [--no-open] [--json]
ornn ssh-keys list [--json]
ornn ssh-keys add --public-key <key> [--label <label>] [--json]
ornn ssh-keys add --public-key-file <path> [--label <label>] [--json]
ornn ssh-keys delete <key-id> [--json]
ornn billing open [--no-open] [--json]
ornn api <get|post|patch|put|delete> <compute-path> [--data <json>] [--raw]
ornn logout
```

Commands print concise human-readable output by default. Use `--json` on read/show/list commands and transaction handoffs when you need structured stdout for scripts. Errors and login/browser progress go to stderr.

Run `ornn --help` or `<command> --help` for the full command list.

## Environment variables

* `ORNN_AUTH_BASE_URL`: web/auth origin used by `ornn login`. Defaults to `http://localhost:3000`.
* `ORNN_API_BASE_URL`: optional web API origin for CLI commands. Defaults to `ORNN_AUTH_BASE_URL`.
* `ORNN_CONFIG_HOME`: directory for CLI auth state. Defaults to `~/.config/ornn`.

## Troubleshooting

### Login opens the wrong host

Check the auth origin:

```bash theme={null}
echo "$ORNN_AUTH_BASE_URL"
```

Set it explicitly if needed:

```bash theme={null}
export ORNN_AUTH_BASE_URL=https://compute.ornn.com
ornn login
```

### Browser does not open

Use the manual URL fallback:

```bash theme={null}
ornn login --no-browser
```

Copy the printed URL into any browser, complete web login, then return to the terminal.

### Login expires

Run `ornn login` again. Device login requests are short-lived by design.

### You are logged in but commands say unauthorized

Confirm the account and tenant:

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

Use an approved tenant account. CLI commands route through `/api/cli/*`, so they reuse the same tenant and role checks as the web app.
