大纲 CLI
用于 大纲 维基/知识基础 API.
安装
需要节点24+.
npm install -g @doist/outline-cli
代理技能
为您的编码代理安装技能 :
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/。 。 。 .
ol skill list
ol skill uninstall <agent>
卸载
首先,删除任何已安装的代理技能:
ol skill uninstall <agent>
然后解开CLI:
npm uninstall -g @doist/outline-cli
本地设置
git clone https://github.com/todoist/outline-cli.git
cd outline-cli
npm install
npm run build
npm link
设置
OAuth 登录( 建议)
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
设置 :
- 在大纲中创建一个公开的 OAuth 应用程序( 设置 )
- 设置重定向 URI 到
http://localhost:54969/callback - 运行
ol auth login时输入 OAuth 客户端标识 (或直接通过它与--client-id <your-client-id>(中文(简体) ) - 如果需要,请通过
--base-url <your-outline-url>或设置OUTLINE_URL(对于自办实例或非默认 URL) - 如果需要,请通过
--callback-port <port>或设置OUTLINE_OAUTH_CALLBACK_PORT和登记http://localhost:<port>/callback在您的 OAuth 应用程序中
客户端ID被保存用于未来的登录. 您也可以设置 OUTLINE_OAUTH_CLIENT_ID
您的本地环境.
手动令牌登录
如果您喜欢直接使用 API 令牌 :
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 (你还可以以互动方式提供).
图标
# 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 对象(用于管道)
发展
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/