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

# Collections

> Create and manage document collections from the CLI.

## Quick start

```bash theme={null}
# Create a collection with initial documents
okra collections create "Q4 Earnings" -d "Quarterly filings" --docs ocr-abc123,ocr-def456

# List all collections
okra collections list

# Show collection details
okra collections show "Q4 Earnings"

# Add more documents
okra collections add "Q4 Earnings" ocr-ghi789

# Chat with a collection
okra chat -c "Q4 Earnings" -m "What was total revenue?"
```

## Commands

```bash theme={null}
okra collections list                          # list all collections
okra collections create "Name"                 # create empty collection
okra collections create "Name" -d "desc"       # with description
okra collections create "Name" --docs id1,id2  # with initial documents
okra collections show <name-or-id>             # show collection + documents
okra collections add <name-or-id> id1 id2      # add documents
okra collections remove <name-or-id> id1 id2   # remove documents
okra collections delete <name-or-id>           # delete collection (keeps docs)
```

<Tip>
  The `collections` command has a short alias: `col`. Use `okra col ls` instead of `okra collections list`.
</Tip>

### `collections list` flags

| Flag                    | Description                              |
| ----------------------- | ---------------------------------------- |
| `-o, --output <format>` | Output format: `table` (default), `json` |

### `collections create` flags

| Flag                       | Description                                |
| -------------------------- | ------------------------------------------ |
| `-d, --description <text>` | Optional description for the collection    |
| `--docs <ids>`             | Comma-separated job IDs to add on creation |

### `collections show` flags

| Flag                    | Description                              |
| ----------------------- | ---------------------------------------- |
| `-o, --output <format>` | Output format: `table` (default), `json` |

## Chat with a collection

Use the `-c` flag on `okra chat` to scope a chat session to a collection:

```bash theme={null}
# By collection name
okra chat -c "Q4 Earnings" -m "Compare revenue across companies"

# By collection ID
okra chat -c col-abc123def456 -m "Summarize key findings"

# Inline collection (comma-separated job IDs)
okra chat -c "ocr-abc123,ocr-def456" -m "What tables are in these docs?"
```

<Info>
  **Phase 1:** Collection chat currently uses the first document in the collection. Multi-document chat is coming soon.
</Info>

## Lookup behavior

All commands accept either a **collection name** or **collection ID**. The CLI tries ID lookup first, then falls back to name.

```bash theme={null}
okra collections show "Q4 Earnings"      # by name
okra collections show col-abc123def456   # by ID
```
