# @doist/outline-cli 中文文档

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

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

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

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

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

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

- 包体积（解压后）：284 kB，111 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=24
- 运行依赖：8 个
- 首次发布：2026-03-25T12:35:29.624Z
- 最新版本发布：2026-11-11T14:44:48.388Z
- 近 30 天下载量：4301（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：57（近 12 个月 57 个）

## 中文简介

维基语录/知识基础 API

## 安装

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

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

## README

# 大纲 CLI

用于 [大纲](https://www.getoutline.com/) 维基/知识基础 API.

## 安装

需要节点24+.

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

### 代理技能

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

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

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

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

## 卸载

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

```bash
ol skill uninstall <agent>
```

然后解开CLI:

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

## 本地设置

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

## 设置

### OAuth 登录( 建议)

```bash
ol auth login
ol auth login --base-url <your-outline-url>
ol auth login --client-id <your-client-id>
ol auth login --callback-port 54969
ol auth status
ol auth logout
```

**设置 :**

1.  在大纲中创建一个公开的 OAuth 应用程序( 设置 )
2.  设置重定向 URI 到 `http://localhost:54969/callback`
3.  运行 `ol auth login` 时输入 OAuth 客户端标识 (或直接通过它与 `--client-id <your-client-id>`(中文(简体) )
4.  如果需要,请通过 `--base-url <your-outline-url>` 或设置 `OUTLINE_URL` (对于自办实例或非默认 URL)
5.  如果需要,请通过 `--callback-port <port>` 或设置 `OUTLINE_OAUTH_CALLBACK_PORT` 和登记 `http://localhost:<port>/callback` 在您的 OAuth 应用程序中

客户端ID被保存用于未来的登录. 您也可以设置 `OUTLINE_OAUTH_CLIENT_ID` 您的本地环境.

### 手动令牌登录

如果您喜欢直接使用 API 令牌 :

```bash
ol auth token <your-api-token>   # save a token (verifies it against your instance)
ol auth token                    # prompt for the token interactively
ol auth token view               # print the stored token to stdout (refreshes an expiring OAuth token first)
```

在设置下 API Tokens 生成一个符号 。 过 `--base-url <your-outline-url>` 如果该标志属于自主办实例.

您也可以完全通过设置跳过存储一个符号 `OUTLINE_API_TOKEN` 内 你的环境.

### 配置

调试分辨率 : `OUTLINE_API_TOKEN` (原始内容存档于2018-10-21) (中文(简体) ). env var `~/.config/outline-cli/config.json`。 。 。 .

基础 URL 分辨率 : `OUTLINE_URL` var – 配置文件 – `https://app.getoutline.com`。 。 。 .

OAuth 登录的回调端口分辨率 : `--callback-port` → `OUTLINE_OAUTH_CALLBACK_PORT` → `54969`。 。 。 .

自办个案:通过 `--base-url` 或设置 `OUTLINE_URL` (你还可以以互动方式提供).

## 图标

```bash
# Search
ol search "query" --limit 10 --offset 10 --collection <id> --status published

# Documents (alias: ol doc)
ol document list --collection <id> --sort updatedAt --direction DESC
ol document get <urlId>              # renders markdown for terminal
ol document get <urlId> --raw        # outputs raw markdown
ol document open <urlId>             # opens in browser
ol document create --title "Title" --collection <id> --file doc.md --publish
ol document update <urlId> --file updated.md
cat notes.md | ol document update <urlId> --stdin # reads markdown from stdin
ol document update <urlId> --publish # publishes a draft
ol document update <urlId> --publish --collection <id> # publishes a draft that has no collection
ol document update <urlId> --file updated.md --if-updated-at <updatedAt> # fails if saved since then
ol document delete <urlId> --confirm
ol document restore <urlId>          # restores from trash
ol document move <urlId> --collection <target-id>
ol document archive <urlId>
ol document unarchive <urlId>

# Collections (alias: ol col)
ol collection list
ol collection get <id>
ol collection create --name "Engineering" --color "#4CAF50"
ol collection update <id> --name "New Name"
ol collection delete <id> --confirm
```

## 输出模式

所有命令支持 :

-   默认: 彩色可读输出
-   `--json`: 印得很漂亮的 JSON( 必要领域)
-   `--json --full`: 所有字段
-   `--ndjson`: 每行有一个 JSON 对象(用于管道)

## 发展

```bash
npm install
npm run dev          # watch mode
npm run type-check   # typecheck without emitting
npm run test         # run tests
npm run build        # compile to dist/
```

## 常见问题

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

维基语录/知识基础 API注意：该包已被作者标记为弃用——Moved to @todoist/outline-cli\. Run: npm uninstall -g @doist/outline-cli && npm install -g @todoist/outline-cli

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

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

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

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/doist\_\_outline-cli 是否存在。

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

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

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

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

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

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

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

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

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

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

