# @doist/comms-cli 中文文档

规范地址：https://npmcn.com/package/%40doist/comms-cli/

版本：4\.2\.0
npm 元数据更新时间：2026-11-11T15:09:40.933Z
中文译文更新时间：2026-11-12T15:17:33.041Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40doist/comms-cli
原文对照：https://npmcn.com/package/%40doist/comms-cli/?lang=original
项目主页：https://github.com/todoist/comms-cli#readme
源码仓库：https://github.com/todoist/comms-cli

弃用说明：Moved to @todoist/comms-cli\. Run: npm uninstall -g @doist/comms-cli && npm install -g @todoist/comms-cli

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1 MB，526 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24
- 运行依赖：9 个
- 首次发布：2026-05-25T09:42:03.110Z
- 最新版本发布：2026-11-11T14:45:52.781Z
- 近 30 天下载量：5334（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：56（近 12 个月 56 个）

## 中文简介

用于通信的脚本 CLI

## 安装

```sh
npm install @doist/comms-cli
```

也可以使用：`pnpm add @doist/comms-cli`、`yarn add @doist/comms-cli`、`bun add @doist/comms-cli`

## README

![Comms CLI](https://npmcn.com/package/%40doist/comms-cli/icons/comms-cli.png)

# 通讯 CLI

Comms的命令行接口.

## 安装

> ```bash
> npm install -g @doist/comms-cli
> ```

### 代理技能

为您的编码代理安装技能 :

```bash
tdc skill install claude-code
tdc skill install codex
tdc skill install cursor
tdc skill install gemini
tdc skill install pi
tdc skill install universal
```

技能安装到 `~/<agent-dir>/skills/comms-cli/SKILL.md` (例如:. `~/.claude/` 为克来德码, `~/.agents/` (为普世等). 在更新CLI时,所安装的技能会被自动更新. 这个 `universal` 代理与 Amp 、 OpenCode 和其他从 `~/.agents/`。 。 。 .

```bash
tdc skill list
tdc skill uninstall <agent>
```

## 卸载

首先,删除任何已安装的代理技能:

```bash
tdc skill uninstall <agent>
```

然后解开CLI:

```bash
npm uninstall -g @doist/comms-cli
```

## 本地设置

```bash
git clone https://github.com/todoist/comms-cli.git
cd comms-cli
npm install
npm run build
npm link
```

这使得 `tdc` 命令可在全球范围使用.

## 设置

```bash
tdc auth login
```

这打开了浏览器中的 Todoist OAuth 。 默认赠款可以读取Comms数据并创建/更新内容和消息. 它不包括删除、频道管理或用户/工作空间写入范围;使用 `--read-only` 只读访问或 `--full-access` 需要的时候.

所有小组管理—— `groups create`, (中文(简体) ), `rename`, (中文(简体) ), `delete`, (中文(简体) ), `add-user`, (中文(简体) ), `remove-user` - 需要帮助 `workspaces:write` 范围,因此需要 `tdc auth login --full-access`组读作(`groups`, (中文(简体) ), `groups view`)关于默认登录的工作.

设置或清除您的状态( E)`status set`, (中文(简体) ), `status clear`\* 需要: `user:write` 范围,因此还要求 `tdc auth login --full-access`。 。 。 . `tdc status` 在默认登录上工作.

`--pause-notifications` 现在只保留通讯通知:每个应用程序必须读取状态并保留自己的通知,而Todoist还没有. 被搁置的通知不会在以后发出.

默认情况下, CLI 在您的 OS 证书管理器中存储了 :

-   macOS: 键链
-   窗口: 证书管理器
-   Linux: 特务/libsecret

如果无法安全存储,则CLI会发出警告并返回到 `~/.config/comms-cli/config.json`启用 `--credential-store system` 以失败代替写出简单文字,或 `--credential-store plaintext` 以明确选择配置文件存储。 两者 `tdc auth login` 财务报告和审定财务报表 `tdc auth token` 支持此选项。 诸如当前工作空间等非秘密设置仍然保留在配置文件中 .

### 替代方法

**手动符号 :**

```bash
tdc auth token
```

CLI没有回音就催取了符文. 这样做 **没有** 将符号传递为位置参数——可见于 `ps` /外壳历史.

**环境变量:**

```bash
export COMMS_API_TOKEN="your-token"
```

`COMMS_API_TOKEN` 总是优先于存储的符号.

### 显示/ 替代主机

将CLI指向非生产通讯实例 `COMMS_BASE_URL`数字 :

```bash
export COMMS_BASE_URL=https://comms.staging.todoist.com
tdc auth login
tdc user
```

基础URL用于OAuth,SDK,并搜索. OAuth 登录支持 `comms.todoist.com`, (中文(简体) ), `comms.staging.todoist.com`,以及 `comms.local.todoist.com`; 中转用途 `https://staging.todoist.com` 作为托多派OAuth主机. 对于自定义通讯主机, 使用 `COMMS_API_TOKEN`。 。 。 .

### Auth 命令

```bash
tdc auth status   # check if authenticated
tdc auth logout   # remove saved token
tdc auth token view           # print the stored access token (refreshes an expiring OAuth token first)
tdc auth refresh-token view   # print the stored OAuth refresh token
```

## 使用量

```bash
tdc inbox                           # inbox threads
tdc inbox --unread                  # unread threads only
tdc inbox --mentions                # unread threads where you were mentioned
tdc mentions                        # content mentioning you
tdc mentions --since 2026-04-01 --all --json
tdc thread view <ref>               # view thread with comments
tdc thread view <ref> --comment id:CbM8n2Kp4Qx6Rz9Lm3Va # view a specific comment
tdc thread reply <ref>              # reply to a thread
tdc thread reply <ref> "Update" --notify NONE # reply without notifying anyone
tdc thread rename <ref> "New title" # rename a thread
tdc thread update <ref> "New body"  # edit a thread's body (first post)
tdc thread done <ref> --yes         # archive a thread (mark done)
tdc thread undone <ref> --yes       # move it back to your inbox
tdc thread mark-read <ref>          # mark a thread read
tdc thread mark-unread <ref>        # mark it unread again (--from <comment-ref> for part of it)
tdc conversation unread             # list unread conversations
tdc conversation list               # list conversations (--kind, --participant, --name, --state)
tdc conversation view <ref>         # view conversation messages
tdc conversation done <ref> --yes   # archive a conversation
tdc conversation undone <ref> --yes # unarchive it
tdc msg view <ref>                  # view a conversation message
tdc search "keyword"                # search across workspace
tdc search "keyword" --all          # fetch all result pages
tdc search "name" --type conversations  # find a titled group chat (whole words)
tdc conversation list --name "part" # match part of a title; use --participant for chats without a title
tdc react thread <ref> 👍          # add reaction
tdc status                          # show your status
tdc status set "Deep work" --emoji 🎯 --for 2h --pause-notifications  # set it (--until <iso> for a date)
tdc status clear                    # clear your status
tdc groups                          # list groups in a workspace
tdc groups view <ref>               # show a group with members
tdc groups create "Frontend"        # create a group
tdc groups create "FE" --users alice@doist.com,bob@doist.com
tdc groups rename <ref> "New name"  # rename a group
tdc groups delete <ref> --yes       # delete a group
tdc groups add-user <ref> alice@doist.com bob@doist.com
tdc groups remove-user <ref> id:123,id:456
```

参考文献 接受身份证`id:<id>`; 明确时赤裸的ID),通讯 URL,或模糊的名称(用于工作空间/用户/频道/组). 工作空间和用户ID是数字;线程,通道,评论,消息,对话,和组使用不透明的字符串ID.

运行 `tdc --help` 或者说 `tdc <command> --help` 更多选择.

## 贝壳补全

标签完成可以提供:

```bash
tdc completion install        # prompts for shell
tdc completion install bash   # or: zsh, fish
```

重新启动您的 shell 或源代码您的配置文件以激活 。 要删除 :

```bash
tdc completion uninstall
```

## 机器可读输出

列表和视图命令支持 `--json` 财务报告和审定财务报表 `--ndjson` 用于脚本。 包含一个清晰实体ID的列表命令也支持 `--ids-only`;检查命令帮助准确的表面.

```bash
tdc inbox --json                    # JSON array
tdc inbox --ndjson                  # newline-delimited JSON
tdc inbox --ids-only                # one thread ID per line
tdc inbox --json --full             # include all fields
```

## 发展

```bash
npm install
npm run build       # compile
npm run dev         # watch mode
npm run type-check  # type check
npm run format      # format code
npm test            # run tests
```

## 常见问题

### @doist/comms-cli 是什么？

用于通信的脚本 CLI注意：该包已被作者标记为弃用——Moved to @todoist/comms-cli\. Run: npm uninstall -g @doist/comms-cli && npm install -g @todoist/comms-cli

### 如何安装 @doist/comms-cli？

在项目目录运行 npm install @doist/comms-cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 tdc，可以用 npx tdc 直接运行。

### @doist/comms-cli 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @doist/comms-cli 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @doist/comms-cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=24。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @doist/comms-cli 可以商用吗？

@doist/comms-cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @doist/comms-cli 的下载量有多少？

根据 npm 官方下载统计，@doist/comms-cli 在 2026/10/13 – 2026/11/11 这 30 天内被下载 5,334 次，日均约 178 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @doist/comms-cli 还在维护吗？

最新版本 4\.2\.0 发布于 2026/11/11（2 天前）；至今共发布 56 个版本，其中过去 12 个月发布了 56 个；首次发布于 2026/05/25。作者已将其标记为弃用，新项目建议寻找替代方案。

