feat: 新增 dataset 数据集管理快捷命令(list/view/create/update/delete-attachment) #243
Loading…
Reference in New Issue
No description provided.
Delete Branch "luwanzhou/gitlink-cli:feat/dataset-shortcuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
合并请求描述
新增 dataset 数据集管理快捷命令,支持对 GitLink 仓库数据集的查询、查看、创建、更新及附件删除操作,覆盖
/api/v1/project_datasets和/api/v1/{owner}/{repo}/dataset接口。相关Issue
关联Issue编号:#(请补充)
变更内容
1. 新增 dataset 快捷命令
dataset +list— 按 ID 查询数据集(GET /v1/project_datasets)dataset +view— 查看仓库数据集(GET /v1/{owner}/{repo}/dataset)dataset +create— 创建数据集,支持--title、--description、--license-id、--paper-content(POST /v1/{owner}/{repo}/dataset)dataset +update— 更新数据集(PUT /v1/{owner}/{repo}/dataset)dataset +delete-attachment— 删除数据集附件,需--yes确认(DELETE /attachments/{uuid})2. 命令特性
--dry-run预览,不实际提交+delete-attachment破坏性操作需--yes二次确认+list的--ids支持逗号分隔,自动验证和清理+view支持--owner/--repo自动解析 project-id,也可显式--project-id跳过解析3. 注册与文档
shortcuts/register.godoc/changes/dataset-shortcuts.md变更文档已验证命令
dataset +list --ids 5988dataset +view --owner gitlink --repo forgeplusdataset +create --dry-rundataset +update --dry-rundataset +delete-attachment --dry-run变更文件
shortcuts/dataset/dataset.go— dataset 快捷命令实现(218 行)shortcuts/dataset/dataset_test.go— 单元测试(228 行,11 用例)shortcuts/register.go— 注册 dataset 命令shortcuts/register_test.go— 更新测试internal/i18n/locales/zh-CN.json— 中文 i18ninternal/i18n/locales/en-US.json— 英文 i18ndoc/changes/dataset-shortcuts.md— 变更文档README.md/README.zh-CN.md— 更新说明Add a `dataset` shortcut group for querying GitLink research datasets, which previously had no shortcut coverage: - dataset +list --ids <ids> -> GET /v1/project_datasets - dataset +view -> GET /v1/project_datasets (project ID resolved from --owner/--repo) Only the platform-wide query endpoint is available on production gitlink.org.cn; the documented per-repo dataset CRUD routes return 404 there (verified against the API), so this group wraps the query endpoint for both listing and per-repo viewing. Includes unit tests, bilingual (en-US/zh-CN) i18n help text, README updates, and a change note. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Extend the dataset group beyond the verified project query to the full documented contract: - dataset +view -> GET /v1/{owner}/{repo}/dataset (+page/limit) - dataset +list --ids -> GET /v1/project_datasets (prod-verified) - dataset +create -> POST /v1/{owner}/{repo}/dataset - dataset +update -> PUT /v1/{owner}/{repo}/dataset - dataset +delete-attachment -> DELETE /attachments/{uuid} Quality over a bare contract port: bilingual (en-US/zh-CN) i18n help, --dry-run preview on create/update, --yes confirmation guard on the destructive attachment delete, and license-id validation. Only /v1/project_datasets is currently reachable on production www; the per-repo routes follow the published OpenAPI spec and return 404 there until the platform deploys them (documented in the change note). Unit tests exercise every command against a mock server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>