---
title: "comment.threads: List comment threads — Note kit command — Kition"
description: "Lists the comment threads with their comments, resolved state, and the text each is anchored to with where it is now (or that it is gone). Use it to get the thread ids the other comment commands take."
canonical: "https://developer.kition.ai/docs/kits/note/commands/comment.threads"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/note/commands/comment.threads](https://developer.kition.ai/docs/kits/note/commands/comment.threads)

# comment.threads

**List comment threads.** Lists the comment threads with their comments, resolved state, and the text each is anchored to with where it is now (or that it is gone). Use it to get the thread ids the other comment commands take.

- Kit: Note 0.3.0 (Markdown (.md)); reference: [Note kit commands](https://developer.kition.ai/docs/kits/note.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `unit` | `"scalar" \| "utf16"` | no | How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "comment.threads" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `unit`. note_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `threads` | `object[]` | yes | The note's comment threads; one without quote is on the whole note. |

```json
{
  "additionalProperties": false,
  "properties": {
    "threads": {
      "description": "The note's comment threads; one without quote is on the whole note.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "comments": {
            "description": "Its comments in order; the first opened it.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "author": {
                  "description": "The author's principal id.",
                  "type": "string"
                },
                "body": {
                  "description": "The comment's text.",
                  "type": "string"
                },
                "created": {
                  "description": "When, ISO 8601 UTC.",
                  "type": "string"
                },
                "id": {
                  "description": "The comment's id.",
                  "type": "string"
                },
                "name": {
                  "description": "The author's display name, or null.",
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "author",
                "body",
                "created",
                "id",
                "name"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "from": {
            "description": "Where that text is now (Unicode characters, or the request's unit).",
            "type": "integer"
          },
          "gone": {
            "description": "True when the text it was anchored to is no longer in the note.",
            "type": "boolean"
          },
          "id": {
            "description": "The thread's id: what comment.reply and comment.resolve take.",
            "type": "string"
          },
          "line": {
            "description": "Its line, from 1.",
            "type": "integer"
          },
          "quote": {
            "description": "The text it is anchored to.",
            "type": "string"
          },
          "resolved": {
            "description": "Resolved.",
            "type": "boolean"
          },
          "to": {
            "description": "Where it ends (exclusive).",
            "type": "integer"
          }
        },
        "required": [
          "comments",
          "id",
          "resolved"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "threads"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "unit": {
      "default": "scalar",
      "description": "How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them.",
      "enum": [
        "scalar",
        "utf16"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9).
