Octri

docs endpoints

列出端点草稿:即在下次发布之前添加的端点或标记为删除的端点,与在 API Studio 中使用 Add endpoint 创建的草稿相同。在运行 publish 之前,这里的任何内容都不会更改你的规范;该命令会将所有草稿作为新版本写入规范。在此之前,读者、SDK 和 MCP 工具都看不到任何变化。请参阅端点。

bash
octri docs endpoints [list | add | edit | remove | discard | publish]

octri docs endpoints add <METHOD> <path> --summary <text>

起草一个新端点。

参数

<METHOD>string必填

GET、POST 等,大小写不限。

<path>string必填

OpenAPI 路径,例如 /customers/{id}。

标志

--summary <text>string必填

端点的一行摘要。

--description <text>string

更详细的描述。

octri docs endpoints edit <draftId>

更改草稿的摘要或描述。

参数

<draftId>string必填

列表中的草稿。

标志

--summary <text>string

新的摘要。

--description <text>string

新的描述。

octri docs endpoints remove <METHOD> <path>

将规范文件中已有的端点标记为在下次发布时移除。

参数

<METHOD>string必填

端点的方法。

<path>string必填

它的路径。

octri docs endpoints discard <draftId>

丢弃草稿,不发布。

参数

<draftId>string必填

草稿。

octri docs endpoints publish

将每个草稿写入规范文件,作为一个新版本,然后继续执行该版本触发的流水线。如果规范文件已经与草稿一致,则不会发布任何内容。

标志

--commit-to-githubboolean默认值:the project's docs setting

将新的规范文件提交回关联的代码库。--no-commit-to-github 不会这样做。

示例

起草端点

bash
octri docs endpoints add GET /customers/{id}/notes --summary "List a customer's notes"
Output
✔ Drafting GET /customers/{id}/notes
✔ Drafted GET /customers/{id}/notes 6aedf5d4f8a05765fb1944e7
  octri docs endpoints publish: write the drafts into the spec

列出草稿

bash
octri docs endpoints
Output
✔ Loading draft endpoints

Draft endpoints (1)
  CHANGE  ENDPOINT                   SUMMARY                  UPDATED  ID
  ──────  ─────────────────────────  ───────────────────────  ───────  ────────────────────────
  add     GET /customers/{id}/notes  List a customer's notes  0s ago   6aedf5d4f8a05765fb1944e7
  octri docs endpoints publish: write the drafts into the spec