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

# Collections

> Manage collections (data models)

Every command also takes the [global options](https://docs.nohead.io/cli/commands/global-options.md), such as `--json`.

## `nohead collections list`

List collections in the project.

```bash theme={null}
nohead collections list [options]
```

| Option | |
| - | - |
| `--deleted` | List deleted collections instead. |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every collection. |

## `nohead collections get`

Show a collection and its fields.

```bash theme={null}
nohead collections get [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

## `nohead collections create`

Create a collection.

```bash theme={null}
nohead collections create [options] <slug>
```

| Argument | |
| - | - |
| `<slug>` | Collection slug, e.g. posts. |

| Option | |
| - | - |
| `--name <name>` | Display name (default: from the slug) |
| `--description <text>` | description. |
| `--public-search` | Include its published records in public search (search tokens) |

## `nohead collections update`

Update a collection's name, slug, description or public search.

```bash theme={null}
nohead collections update [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

| Option | |
| - | - |
| `--name <name>` | New display name. |
| `--slug <slug>` | New slug (breaks clients that use the old one) |
| `--description <text>` | New description. |
| `--public-search` | Include its published records in public search (search tokens) |
| `--no-public-search` | Remove it from public search. |

## `nohead collections delete`

Delete a collection (recoverable with restore)

```bash theme={null}
nohead collections delete [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

| Option | |
| - | - |
| `--yes` | Confirm the deletion. |

## `nohead collections restore`

Restore a deleted collection.

```bash theme={null}
nohead collections restore [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

## `nohead collections history`

Show the collection's schema history, newest first.

```bash theme={null}
nohead collections history [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

| Option | |
| - | - |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every change. |

## `nohead collections search-index`

Show a collection's search index status, or rebuild it.

```bash theme={null}
nohead collections search-index [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

| Option | |
| - | - |
| `--rebuild` | Rebuild the index from the collection's records. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.