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

# Categories

> List the categories that organize your knowledge base.

A category groups articles in your knowledge base and can nest inside another category. For fields and response details, see the [API reference](/api-reference/categories/list).

Samples on this page show the `--json` envelope, which stays stable across terminals; the default pretty output picks columns to fit your terminal width. See [Output formats](/cli/output-formats).

## List categories

This command lists the category tree with article counts. Use this when you want a category ID to filter articles by, or to check where a new article should go before creating it.

```bash theme={"system"}
neetokb categories list
neetokb categories list --page-size 100
```

| Flag          | Type  | Required | Default | Description              |
| ------------- | ----- | -------- | ------- | ------------------------ |
| `--page`      | `int` |          | `0`     | Page number              |
| `--page-size` | `int` |          | `0`     | Items per page (max 100) |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "b7e91c2a-8f43-4d0e-9a15-6c2d8e7f1b3a",
      "name": "Getting Started",
      "slug": "getting-started",
      "description": null,
      "parent_id": null,
      "depth": 0,
      "articles_count": 12,
      "categories_count": 2,
      "total_articles_count": 18,
      "url": "/categories/getting-started",
      "subcategories": [],
      "ancestors": []
    }
  ],
  "breadcrumbs": [
    {
      "label": "List articles in category",
      "command": "neetokb articles list --category-id <id>"
    }
  ],
  "pagination": {
    "total_records": 1,
    "total_pages": 1,
    "current_page_number": 1,
    "page_size": 30
  }
}
```

`subcategories` nests the full child categories, and `ancestors` lists the parents up to the root. `articles_count` covers the category itself; `total_articles_count` includes its subcategories.

<Tip>
  Pass an `id` from this list to [`neetokb articles list --category-id`](/cli-reference/articles#list-articles). To place a new article, [`neetokb articles create --category`](/cli-reference/articles#create-an-article) takes category *names*, not these IDs.
</Tip>
