---
title: CLI Workflows
description: Use the Orchestor CLI to sign in, generate images and video, check
  usage, and set up an agent.
canonical_url: https://orchestor.io/docs/en/agent-resources/cli-workflows
markdown_url: https://orchestor.io/docs/en/agent-resources/cli-workflows.md
related:
  - https://orchestor.io/docs/en/cli/auth
  - https://orchestor.io/docs/en/cli/image
  - https://orchestor.io/docs/en/cli/video
  - https://orchestor.io/docs/en/cli/billing
  - https://orchestor.io/docs/en/cli/setup
contentType: guide
---

# CLI Workflows

Combine Orchestor CLI commands to complete tasks such as selecting a workspace or retrieving a generated video. Each workflow shows what to pass to the next command, what to check in the output, and where to resume if a step fails.

| Workflow | Description | Entry point |
| --- | --- | --- |
| [Sign in and select a workspace](#sign-in-and-select-a-workspace) | Authorize the CLI in your browser and confirm the selected workspace. | [Authentication](https://orchestor.io/docs/en/cli/auth.md) |
| [Generate an image and retrieve the result](#generate-an-image-and-retrieve-the-result) | Inspect a model and wait for an image job to finish. | [Image](https://orchestor.io/docs/en/cli/image.md) |
| [Generate a video from an image](#generate-a-video-from-an-image) | Supply an image as the start frame and wait for the video job to finish. | [Video](https://orchestor.io/docs/en/cli/video.md) |
| [Check credit balances and usage](#check-credit-balances-and-usage) | Check credit balances, prepaid USD balance, and usage within a time range. | [Billing](https://orchestor.io/docs/en/cli/billing.md) |
| [Set up skills and MCP for Codex](#set-up-skills-and-mcp-for-codex) | Install project skills and connect Codex to Orchestor MCP. | [Setup](https://orchestor.io/docs/en/cli/setup.md) |

## Sign in and select a workspace

Authorize the CLI in your browser, then select a workspace for future commands. Use `whoami` to confirm the account and workspace the CLI uses.

### Quick reference

```bash title="terminal"
# 1. Sign in with an existing account. For a new account, use orc signup
orc auth login --web
# 2. List the workspaces you can access
orc workspace list --json
# 3. Replace WORKSPACE_ID with the ID you selected from the list
orc workspace use WORKSPACE_ID
# 4. Verify the account and workspace
orc whoami --json
```

### 1. Authorize the CLI in your browser

```bash title="terminal"
orc auth login --web
```

If you need to create an account, run this command instead.

```bash title="terminal"
orc signup
```

For a new account, verify your email in the browser. Check that the confirmation codes in the browser and terminal match before authorizing the CLI. If the CLI saves your credentials and reports that initial setup is required, complete the displayed steps before listing workspaces. If the command exits with code `2` and shows `Authentication expired.` or `Authorization denied by user.`, run it again to restart authorization. [Authentication](https://orchestor.io/docs/en/cli/auth.md) · [Sign up](https://orchestor.io/docs/en/cli/signup.md)

### 2. Find the workspace ID

```bash title="terminal"
orc workspace list --json
```

When `success` is `true`, select the workspace `id` from the list in `data`. If `error.category` is `auth`, check which account you authorized and whether it has workspace access. [Workspace](https://orchestor.io/docs/en/cli/workspace.md) · [Authentication](https://orchestor.io/docs/en/cli/auth.md)

### 3. Save the default workspace

```bash title="terminal"
orc workspace use WORKSPACE_ID
```

Replace `WORKSPACE_ID` with the ID from the previous step. The command displays it as `defaultWorkspace`. If you see `Missing Workspace id.`, supply the ID and run the command again. [Workspace](https://orchestor.io/docs/en/cli/workspace.md)

### 4. Verify the selection

```bash title="terminal"
orc whoami --json
```

```json title="Output (IDs replaced, some fields omitted)"
{
  "success": true,
  "data": {
    "authenticated": true,
    "auth": {
      "valid": true,
      "auth_method": "api_key",
      "workspace_id": "wks_AUTHENTICATED",
      "role": "machine",
      "rate_limit": { "limit": 200, "remaining": null, "reset": null }
    },
    "workspace": {
      "id": "CONFIGURED_WORKSPACE_ID",
      "source": "global",
      "configured_id": "CONFIGURED_WORKSPACE_ID",
      "authenticated_id": "wks_AUTHENTICATED",
      "name": null,
      "matches": false
    }
  },
  "metadata": { "namespace": "whoami", "command": "", "duration": 1102 }
}
```

In this example the CLI is authenticated with an API key and the saved default workspace differs from the authenticated one, so `matches` is `false`.

Check `data.user` and `data.workspace.id`. If the ID differs from the one you selected, inspect `data.workspace.source`. The `ORCHESTOR_WORKSPACE_ID` environment variable and `.orchestor/workspace.json` in the current directory take precedence over the saved default. Use `--workspace` to select a workspace for one command.

If `data.workspace.matches` is `false`, the CLI selection differs from the workspace in your credentials. Check the account and selection settings before proceeding. If you see `Authentication is invalid.`, check the active credentials. [Account and workspace](https://orchestor.io/docs/en/cli/whoami.md) · [Global options](https://orchestor.io/docs/en/cli/global-flags.md)

## Generate an image and retrieve the result

Inspect the inputs supported by an image model in the selected workspace. Submit a prompt and wait for the job to return the image URL.

### Quick reference

```bash title="terminal"
# 1. Inspect the image model
orc image models get gpt-image-2 --json
# 2. Generate the image and wait for the result
orc image generate --model gpt-image-2 --prompt "A red cube on a white background" --wait --timeout 5m --json
# 3. If the wait times out, check the job ID from the error
orc jobs status JOB_ID --json
# 4. If step 3 shows completion, retrieve the result for the same job ID
orc jobs result JOB_ID --json
```

### 1. Inspect the image model

```bash title="terminal"
orc image models get gpt-image-2 --json
```

Confirm that `data.model.id` is `gpt-image-2`. Check the supported inputs in `capabilities` and `constraints`. If you get HTTP `404`, check the model ID and the selected workspace. [Image](https://orchestor.io/docs/en/cli/image.md)

### 2. Generate the image and wait for completion

```bash title="terminal"
orc image generate --model gpt-image-2 --prompt "A red cube on a white background" --wait --timeout 5m --json
```

`--wait` checks job status and retrieves the result when the job completes. Check for exit code `0` and an image `url` in `data.result.artifacts`. If the command reports `Timed out waiting for creative job JOB_ID.`, it exits with code `1`. Save `error.context.id` and check the status of that job. [Image](https://orchestor.io/docs/en/cli/image.md) · [Jobs](https://orchestor.io/docs/en/cli/jobs.md) · [Global options](https://orchestor.io/docs/en/cli/global-flags.md)

### 3. Check the job after a timeout

```bash title="terminal"
orc jobs status JOB_ID --json
```

Replace `JOB_ID` with the saved ID and use the same workspace as the generation request. If `data.status` is `COMPLETED`, retrieve the result. If it is `IN_QUEUE` or `IN_PROGRESS`, check the same job again. Stop waiting if it reaches `FAILED` or `CANCELED`. If you get HTTP `404`, check the job ID and workspace. [Jobs](https://orchestor.io/docs/en/cli/jobs.md)

### 4. Retrieve the completed job result

```bash title="terminal"
orc jobs result JOB_ID --json
```

Use the `url` in `data.result.artifacts` to view the image. If the result request returns HTTP `409`, check the status of the same job ID. [Jobs](https://orchestor.io/docs/en/cli/jobs.md)

## Generate a video from an image

Use an image at a public HTTPS URL as the start frame. Check that the video model supports image input, then generate the video and retrieve its URL.

### Quick reference

```bash title="terminal"
# 1. Check that the model accepts a start frame
orc video models get seedance-2.5 --json
# 2. Replace the image URL, generate the video, and wait for the result
orc video generate --model seedance-2.5 --prompt "Slow push-in" --image-url https://example.com/start.png --wait --timeout 10m --json
# 3. If the wait times out, check the job ID from the error
orc jobs status JOB_ID --json
# 4. If step 3 shows completion, retrieve the result for the same job ID
orc jobs result JOB_ID --json
```

### 1. Check that the model accepts a start frame

```bash title="terminal"
orc video models get seedance-2.5 --json
```

Check `capabilities` and `constraints` in `data.model` to confirm that you can supply a start image. If you get HTTP `404`, check the model ID and the selected workspace. [Video](https://orchestor.io/docs/en/cli/video.md)

### 2. Pass the start image and generate the video

```bash title="terminal"
orc video generate --model seedance-2.5 --prompt "Slow push-in" --image-url https://example.com/start.png --wait --timeout 10m --json
```

Replace the example URL with the public HTTPS URL of your start image. Check for exit code `0` and a video `url` in `data.result.artifacts`. If the command exits with code `1` and `error.category` is `timeout`, save `error.context.id` and check the same job. [Video](https://orchestor.io/docs/en/cli/video.md) · [Jobs](https://orchestor.io/docs/en/cli/jobs.md)

### 3. Check the job after a timeout

```bash title="terminal"
orc jobs status JOB_ID --json
```

Replace `JOB_ID` with the saved ID and use the same workspace as the generation request. If `data.status` is `COMPLETED`, retrieve the result. If it is `IN_QUEUE` or `IN_PROGRESS`, check the same job again. Stop waiting if it reaches `FAILED` or `CANCELED`. If you get HTTP `404`, check the job ID and workspace. [Jobs](https://orchestor.io/docs/en/cli/jobs.md)

### 4. Retrieve the completed job result

```bash title="terminal"
orc jobs result JOB_ID --json
```

Use the `url` in `data.result.artifacts` to view the video. If the result request returns HTTP `409`, check the status of the same job ID. [Jobs](https://orchestor.io/docs/en/cli/jobs.md)

## Check credit balances and usage

Check the credits available under the workspace's contract, the prepaid USD balance, and usage for a fixed time range. The output examples are abbreviated and use placeholder values.

### Quick reference

```bash title="terminal"
# 1. Replace WORKSPACE_ID with the target ID and check the contract and credits
orc billing current --workspace WORKSPACE_ID --json
# 2. Read the prepaid USD balance for the same workspace
orc billing balance get --workspace WORKSPACE_ID --json
# 3. Read usage for the same workspace over a fixed time range
orc usage get --workspace WORKSPACE_ID --start-time 2026-09-01T00:00:00Z --end-time 2026-10-01T00:00:00Z --json
```

### 1. Check the credits available under the contract

```bash title="terminal"
orc billing current --workspace WORKSPACE_ID --json
```

Replace `WORKSPACE_ID` with the ID of the workspace you want to inspect. When `success` is `true`, `data.creditBalance` shows remaining API credits and `data.creativeCreditBalance` shows remaining creative credits. If the request returns HTTP `403` and the command exits with code `1`, check the workspace and credential permissions. [Billing](https://orchestor.io/docs/en/cli/billing.md)

```json
{"success":true,"data":{"creditBalance":0,"creativeCreditBalance":0}}
```

### 2. Check the prepaid USD balance

```bash title="terminal"
orc billing balance get --workspace WORKSPACE_ID --json
```

When `success` is `true`, read `data.balance` for the display amount in USD and `data.balance_micros` for the exact balance in microdollars. If `error.category` is `auth`, check that the active credentials can read the balance for that workspace. [Billing](https://orchestor.io/docs/en/cli/billing.md)

```json
{"success":true,"data":{"balance":0,"balance_micros":0,"currency":"USD"}}
```

### 3. Check usage for the time range

```bash title="terminal"
orc usage get --workspace WORKSPACE_ID --start-time 2026-09-01T00:00:00Z --end-time 2026-10-01T00:00:00Z --json
```

Set the start and end timestamps for the range you want to inspect. The start is inclusive and the end is exclusive. When `success` is `true`, check `request_count` and `credits_used` in each bucket's `results`. If the command exits with code `2` and `error.category` is `validation`, check the RFC 3339 timestamps and confirm the end is after the start. [Usage](https://orchestor.io/docs/en/cli/usage.md)

```json
{"success":true,"data":[{"results":[{"request_count":0,"credits_used":0}]}]}
```

## Set up skills and MCP for Codex

Install the bundled Codex skills in your project directory. Connect Codex to the hosted Orchestor MCP server, then verify the connection by listing image models.

### Quick reference

```bash title="terminal"
# 1. Install the project skills
orc setup skills --agent codex
# 2. Verify installation
orc setup skills --agent codex --status
# 3. Register MCP in Codex and authorize it in your browser
codex mcp add orchestor --url https://mcp.orchestor.io/mcp
codex mcp login orchestor
codex mcp list
```

### 1. Install project skills

```bash title="terminal"
orc setup skills --agent codex
```

Run the command from your project directory. Check the installation summary for `0 failed`. If the command exits with code `1` and reports `failed to copy embedded skill`, inspect the path and error details it prints. [Setup](https://orchestor.io/docs/en/cli/setup.md) · [Agent skills](https://orchestor.io/docs/en/agent-resources/skills.md)

### 2. Verify the skills installation

```bash title="terminal"
orc setup skills --agent codex --status
```

Check for `canonical=installed` on the rows for the skills you need. Codex reads them from the project's `.agents/skills` directory. The command exits with code `1` if it finds `broken` or `version-drift`. If you see either state, `missing`, or `conflict`, inspect the installation paths in the output. [Setup](https://orchestor.io/docs/en/cli/setup.md)

### 3. Connect Codex to Orchestor MCP

```bash title="terminal"
codex mcp add orchestor --url https://mcp.orchestor.io/mcp
codex mcp login orchestor
codex mcp list
```

If you already registered the server, start with `codex mcp login orchestor`. Select the workspace in your browser, verify the registration with `codex mcp list`, and reopen Codex. Ask Codex to use `image_models_list`. A list of model IDs confirms the connection. If the tool fails, check the server URL and the browser authorization. [Connect Codex](https://orchestor.io/docs/en/agent-setup/codex.md) · [List image models tool](https://orchestor.io/docs/en/mcp/tools/image_models_list.md)

## How these workflows help AI agents

- Choose the command for the task. Read model details to check supported inputs and job status to inspect an existing generation. [Image](https://orchestor.io/docs/en/cli/image.md) · [Video](https://orchestor.io/docs/en/cli/video.md) · [Jobs](https://orchestor.io/docs/en/cli/jobs.md)
- Begin troubleshooting with the exit code and the JSON `error.category`. After a timeout, check the job identified by `error.context.id`. [Global options](https://orchestor.io/docs/en/cli/global-flags.md) · [Jobs](https://orchestor.io/docs/en/cli/jobs.md)
- Pass the workspace ID or job ID returned by one command to the next step that needs it. [Workspace](https://orchestor.io/docs/en/cli/workspace.md) · [Jobs](https://orchestor.io/docs/en/cli/jobs.md)
- Follow the same steps for a different model or workspace and check each result before moving on. [CLI quickstart](https://orchestor.io/docs/en/cli/quickstart.md)

## Find CLI references from your terminal

Use the CLI index to find command descriptions and links to Markdown pages. [Markdown and agent indexes](https://orchestor.io/docs/en/agent-resources/markdown-access.md)

```bash title="terminal"
curl https://www.orchestor.io/docs/en/cli/llms.txt
```

[CLI reference](https://orchestor.io/docs/en/cli.md) · [CLI quickstart](https://orchestor.io/docs/en/cli/quickstart.md) · [Global options](https://orchestor.io/docs/en/cli/global-flags.md)

---

- [Documentation index](https://orchestor.io/docs/llms.txt)
- [Documentation sitemap](https://orchestor.io/docs/sitemap.md)
