关于 outline
用于在 Outline Wiki 实例中搜索、读取、创建和管理文档的技能,适用于支持 Agent Skills Standard 的 AI 客户端。可通过配置 API URL 连接自托管实例。
主要功能
- 01搜索文档
- 02读取文档并导出为 Markdown
- 03列出集合和文档
- 04创建和更新文档
- 05输出机器可读的 JSON
适用场景
- 01按关键词查找 Wiki 指南
- 02读取或导出文档
- 03创建或修改 Wiki 内容
- 04查看集合及其中的文档
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ sanjay3290/ ai-skills --skill outline安装后在 Claude Code 中输入/outline确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
.env.example.gitignoreREADME.mdrequirements.txtscripts/outline.py详细介绍
Outline Wiki 技能
在任何 Outline wiki 实例中搜索、读取、创建和管理文档。适用于所有支持 Agent Skills Standard 的 AI 客户端。
要求
- Python 3.8+
- 依赖项:
pip install -r requirements.txt
设置
-
从你的 Outline wiki 获取 API 密钥:
- 前往 Settings > API Tokens
- 创建一个具有适当权限的新令牌
-
配置环境:
cp .env.example .env # Edit .env with your API key -
设置环境变量:
export OUTLINE_API_KEY=your-api-key-here # Optional: for self-hosted instances export OUTLINE_API_URL=https://your-wiki.example.com/api
用法
搜索文档
python3 scripts/outline.py search "deployment guide"
python3 scripts/outline.py search "API documentation" --limit 10
python3 scripts/outline.py search "onboarding" --collection-id <id>
读取文档
python3 scripts/outline.py read <document-id>
python3 scripts/outline.py read <document-id> --json
列出集合
python3 scripts/outline.py list-collections
python3 scripts/outline.py list-collections --limit 50
列出集合中的文档
python3 scripts/outline.py list-documents --collection-id <id>
获取集合详情
python3 scripts/outline.py get-collection <collection-id>
创建文档
python3 scripts/outline.py create --title "New Guide" --collection-id <id>
python3 scripts/outline.py create --title "Guide" --collection-id <id> --text "# Content here"
python3 scripts/outline.py create --title "Draft" --collection-id <id> --draft
更新文档
python3 scripts/outline.py update <document-id> --title "Updated Title"
python3 scripts/outline.py update <document-id> --text "New content"
python3 scripts/outline.py update <document-id> --publish
将文档导出为 Markdown
python3 scripts/outline.py export <document-id>
python3 scripts/outline.py export <document-id> --output doc.md
测试身份验证
python3 scripts/outline.py auth-info
JSON 输出
为任意命令添加 --json 标志即可获取机器可读的输出:
python3 scripts/outline.py search "query" --json
python3 scripts/outline.py read <id> --json
操作参考
| 命令 | 说明 | 必需参数 |
|---|---|---|
| search | 全文搜索 | query |
| read | 获取文档内容 | document_id |
| list-collections | 列出所有集合 | - |
| list-documents | 列出文档(可选指定集合) | - |
| get-collection | 获取集合详情 | collection_id |
| create | 创建新文档 | --title, --collection-id |
| update | 更新现有文档 | document_id |
| export | 导出为 Markdown | document_id |
| auth-info | 测试 API 连接 | - |
环境变量
| 变量 | 必需 | 默认值 | 说明 |
|---|---|---|---|
| OUTLINE_API_KEY | 是 | - | 你的 Outline API 令牌 |
| OUTLINE_API_URL | 否 | https://app.getoutline.com/api | API URL |
| OUTLINE_TIMEOUT | 否 | 30 | 请求超时(秒) |
| OUTLINE_VERIFY_SSL | 否 | true | 设置为 false 可跳过 SSL 验证(适用于使用自签名证书的可自托管实例) |
故障排除
| 错误 | 解决方案 |
|---|---|
| 未配置 API 密钥 | 设置 OUTLINE_API_KEY 环境变量 |
| 身份验证失败 | 确认 API 密钥有效且未过期 |
| 连接超时 | 检查 OUTLINE_API_URL 和网络连接 |
| SSL 证书错误 | 对自签名证书设置 OUTLINE_VERIFY_SSL=false |
| 未找到文档 | 确认文档 ID 正确 |
| 权限被拒绝 | 检查 API 令牌是否具有所需权限 |
退出代码
- 0:成功
- 1:错误(身份验证失败、未找到或请求无效)
工作流
- 运行
auth-info以验证连接 - 运行
list-collections查看可用集合 - 运行
search或list-documents查找内容 - 运行
read获取完整文档内容 - 使用
create/update修改 wiki 内容
评论
支持 Markdown