微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🧵

Fabric 知识库自动化管理

fabric-api · vv1.0.1
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 S+ 级 作者 tristanmanchester 公开目录收录
450 下载 140 安装 1.4k 收藏 8.4k 浏览

简介

基于 Fabric 官方 API 的自动化工具,通过 HTTP 接口管理笔记与文件夹,助力构建高效的知识库自动化工作流。

原始描述

Create, search, and manage Fabric resources via the Fabric HTTP API (notepads/notes, folders, bookmarks, files, tags).

通过你的 Agent 添加

安装目录:fabric-api/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/fabric-api/
Codex CLI~/.codex/skills/fabric-api/
DeepSeek Harness~/.agents/skills/fabric-api/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

fabric-api 是一个纯 Markdown 文档型技能,旨在帮助用户通过 HTTP API 与 Fabric.so 工作空间进行交互。它不提供可执行代码,而是提供详尽的 curl 命令模板和 API 使用指南,覆盖以下核心操作:

  • 创建笔记(Notepad):通过 POST /v2/notepads 端点,支持 markdown 内容、标签和父级文件夹指定
  • 创建文件夹:通过 POST /v2/folders 端点,支持嵌套结构
  • 创建书签:通过 POST /v2/bookmarks 端点,保存网页链接并附加标签
  • 浏览资源:通过 POST /v2/resources/filter 列出文件夹内容
  • 全文搜索:通过 POST /v2/search 进行模糊匹配查询

所有操作均使用 FABRIC_API_KEY 环境变量进行身份验证,默认指向官方 api.fabric.so 域名。

显著优点

  1. 零代码执行风险:纯文档型技能(T-MD 分类),无可执行脚本、无动态加载、无依赖风险
  2. 安全凭证管理:强制使用环境变量管理 API 密钥,无硬编码敏感信息
  3. 官方 API 集成:所有端点均指向 Fabric.so 官方服务,TLS 加密传输
  4. 详尽的文档:包含常见错误排查、标签安全模式、速率限制处理等实用指南
  5. 来源可信:来自 GitHub 组织 clawdbot,有明确的维护者和版本历史

潜在缺点与局限性

  1. 功能受限:仅为文档参考,不封装高级功能如批量操作、自动同步、离线缓存
  2. API 版本依赖:示例基于特定 API 版本,Fabric 官方更新后可能需要手动调整
  3. 无错误恢复机制:curl 模板需用户自行处理重试逻辑和错误解析
  4. 速率限制敏感:高频调用可能触发 429 限制,需手动实现退避策略

适合人群

  • 熟悉命令行和 curl 的开发者
  • 需要轻量级 Fabric.so 集成、不愿引入重型 SDK 的用户
  • 注重安全透明、希望完全控制 API 调用的技术用户
  • CI/CD 流水线需要自动化 Fabric 内容管理的场景

常规风险

  • API 密钥泄露风险:需妥善保管 FABRIC_API_KEY 环境变量
  • 误操作风险:直接调用生产 API,创建/删除操作不可逆
  • 网络依赖:完全依赖 Fabric.so 服务可用性和网络连接
  • 无本地缓存:所有操作实时联网,无离线能力

技能正文


name: fabric-api description: Create/search Fabric resources via HTTP API (notepads, folders, bookmarks, files). homepage: https://fabric.so metadata: {"clawdbot":{"emoji":"🧵","requires":{"env":["FABRIC_API_KEY"],"bins":["curl"]},"primaryEnv":"FABRIC_API_KEY"}}

Fabric API (HTTP via curl)

Use this skill to read/write content in a user's Fabric workspace using the Fabric HTTP API (https://api.fabric.so).

Critical gotchas (read first)

  • "Notes" are created via POST /v2/notepads (not /v2/notes).
  • Most create endpoints require parentId:
    • A UUID or one of: @alias::inbox, @alias::bin.
  • Notepad create requires:
    • parentId
    • AND either text (markdown string) or ydoc (advanced/structured).
  • tags must be an array of objects, each either:
    • { "name": "tag name" } or { "id": "<uuid>" }
    • Never nested arrays; never strings.

When the user doesn't specify a destination folder: default to parentId: "@alias::inbox".

Setup (Clawdbot)

This skill expects the API key in:

  • FABRIC_API_KEY

Recommended config (use apiKey; Clawdbot will inject FABRIC_API_KEY because primaryEnv is set):

{
  skills: {
    entries: {
      "fabric-api": {
        enabled: true,
        apiKey: "YOUR_FABRIC_API_KEY"
      }
    }
  }
}

HTTP basics

  • Base: https://api.fabric.so
  • Auth: X-Api-Key: $FABRIC_API_KEY
  • JSON: Content-Type: application/json

For debugging: prefer --fail-with-body so 4xx bodies are shown.

Canonical curl templates (use heredocs to avoid quoting bugs)

GET

curl -sS --fail-with-body "https://api.fabric.so/v2/user/me" \
  -H "X-Api-Key: $FABRIC_API_KEY"

POST (JSON)

curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/ENDPOINT" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{ "replace": "me" }
JSON

Core workflows

1) Create a notepad (note)

Endpoint: POST /v2/notepads

  • Map user-provided "title" → name in the API payload.
  • Always include parentId.
  • Use text for markdown content.
curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/notepads" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "name": "Calendar Test Note",
  "text": "Created via Clawdbot",
  "parentId": "@alias::inbox",
  "tags": [{"name":"calendar"},{"name":"draft"}]
}
JSON

If tags cause validation trouble, omit them and create/assign later via /v2/tags.

2) Create a folder

Endpoint: POST /v2/folders

curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/folders" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "name": "My new folder",
  "parentId": "@alias::inbox",
  "description": null
}
JSON

3) Create a bookmark

Endpoint: POST /v2/bookmarks

curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/bookmarks" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "url": "https://example.com",
  "parentId": "@alias::inbox",
  "name": "Example",
  "tags": [{"name":"reading"}]
}
JSON

4) Browse resources (list children of a folder)

Endpoint: POST /v2/resources/filter

Use this to list what's inside a folder (use a folder UUID as parentId).

curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/resources/filter" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "parentId": "PARENT_UUID_HERE",
  "limit": 50,
  "order": { "property": "modifiedAt", "direction": "DESC" }
}
JSON

5) Search

Endpoint: POST /v2/search

Use search when the user gives a fuzzy description (“the note about…”).

curl -sS --fail-with-body -X POST "https://api.fabric.so/v2/search" \
  -H "X-Api-Key: $FABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "queries": [
    {
      "mode": "text",
      "text": "meeting notes",
      "filters": { "kinds": ["notepad"] }
    }
  ],
  "pagination": { "page": 1, "pageSize": 20 },
  "sort": { "field": "modifiedAt", "order": "desc" }
}
JSON

Tags (safe patterns)

List tags

GET /v2/tags?limit=100

Create tag

POST /v2/tags with { "name": "tag name", "description": null, "resourceId": null }

Assign tags on create

Use tags: [{"name":"x"}] or tags: [{"id":"<uuid>"}] only.

Rate limiting + retries

If you get 429 Too Many Requests:

  • Back off (sleep + jitter) and retry.
  • Avoid tight loops; do pagination slowly.

Do not blindly retry create requests without idempotency (you may create duplicates).

Troubleshooting quick map

  • 404 Not Found: almost always wrong endpoint, wrong resourceId/parentId, or permissions.
  • 400 Bad Request: schema validation; check required fields and tag shape.
  • 403 Forbidden: subscription/permission limits.
  • 429 Too Many Requests: back off + retry.

API reference

The OpenAPI schema lives here:

  • {baseDir}/fabric-api.yaml

When in doubt, consult it before guessing endpoint names or payload shapes.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

apiproductivitydocsautomationcontent-media

同类 Skill