From bc64e59bd25f555bea79cc6dcec90887e391827f Mon Sep 17 00:00:00 2001 From: wangyue789 Date: Wed, 10 Jun 2026 17:57:15 +0800 Subject: [PATCH] feat(ignore): add ignore template shortcuts --- doc/changes/ignore-template-shortcuts.md | 21 +++++++++++++ skills/gitlink-ignore/SKILL.md | 40 ++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 doc/changes/ignore-template-shortcuts.md create mode 100644 skills/gitlink-ignore/SKILL.md diff --git a/doc/changes/ignore-template-shortcuts.md b/doc/changes/ignore-template-shortcuts.md new file mode 100644 index 0000000..522c867 --- /dev/null +++ b/doc/changes/ignore-template-shortcuts.md @@ -0,0 +1,21 @@ +# Ignore Template Shortcuts + +## Summary + +Added `gitlink-cli ignore +list` to expose GitLink's `.gitignore` template catalog from the CLI. This fills the OpenAPI wrapper gap for `GET /ignores` and helps repository bootstrap workflows pick a valid ignore template before creating a project. + +## Commands + +| Command | Method / Endpoint | Purpose | +| --- | --- | --- | +| `ignore +list` | `GET /ignores` | List all built-in `.gitignore` templates | +| `ignore +list --name Go` | `GET /ignores?name=Go` | Filter templates by name | + +## Validation + +```bash +GOPROXY=https://goproxy.cn,direct go test ./shortcuts/ignore ./shortcuts +go vet ./shortcuts/ignore ./shortcuts +go run . ignore --help +go run . ignore +list --help +``` diff --git a/skills/gitlink-ignore/SKILL.md b/skills/gitlink-ignore/SKILL.md new file mode 100644 index 0000000..9be7a24 --- /dev/null +++ b/skills/gitlink-ignore/SKILL.md @@ -0,0 +1,40 @@ +--- +name: gitlink-ignore +version: 1.0.0 +description: "GitLink .gitignore 模板查询:列出/筛选平台内置忽略文件模板,用于创建仓库或补齐工程化配置。" +metadata: + requires: + bins: ["gitlink-cli"] + cliHelp: "gitlink-cli ignore --help" +--- + +# gitlink-ignore + +**CRITICAL — 开始前必须先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md),其中包含认证、权限处理和 API 注意事项。** + +## Shortcuts + +| Shortcut | 说明 | 需要认证 | +| --- | --- | --- | +| `ignore +list` | 查看 GitLink 内置 `.gitignore` 模板列表 | 否 | + +## 使用示例 + +```bash +# 列出所有模板 +gitlink-cli ignore +list + +# 按名称筛选模板 +gitlink-cli ignore +list --name Go +gitlink-cli ignore +list --name Python +``` + +## Agent 使用建议 + +- 创建仓库前,可用 `ignore +list --name <语言>` 检查平台是否支持对应 `.gitignore` 模板。 +- 结合 `repo +create --ignore-id `(如果当前版本支持)或 raw API 创建仓库时填入模板 ID。 +- 该命令只读,不会修改任何仓库状态。 + +## OpenAPI + +- `GET /ignores?name=`