forked from Gitlink/gitlink-cli
docs: 比赛提交材料结构 + 完整中文 README
- 新建 提交材料/ 目录(4 个子赛题子文件夹,集中放变更说明+演示) - 子赛题二演示录屏/截图归位到 提交材料/子赛题二-Skills/demos/ - 重写 README.md:项目简介、四大子赛题成果、快速开始、架构说明、目录导航 - 各子文件夹加占位 README(子一/三/四 待队友补充材料)
This commit is contained in:
parent
7af9177798
commit
08e3ccc063
512
README.md
512
README.md
|
|
@ -1,433 +1,183 @@
|
|||
# gitlink-cli
|
||||
# GitLink CLI · 智能化能力提升
|
||||
|
||||
[](https://www.gitlink.org.cn/Gitlink/gitlink-cli)
|
||||
[](https://license.coscl.org.cn/MulanPSL2)
|
||||
[](https://golang.org)
|
||||
[](https://www.npmjs.com/package/@gitlink-ai/cli)
|
||||
> 让 AI 智能体和开发者都能在终端高效操控 GitLink 平台,把仓库管理、Issue/PR 协作、CI/CD 变成可自动化、可复现的流程。
|
||||
|
||||
The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans and AI Agents. Supports **macOS, Linux, and Windows**. Covers repository management, issue tracking, pull requests, CI/CD, and AI-powered workflows, with 40+ commands and 12 AI Agent [Skills](./skills/).
|
||||
**第八届 CCF 开源创新大赛 · track1 GitLink-CLI 贡献赛**参赛作品。
|
||||
|
||||
**[中文文档](./README.zh-CN.md)**
|
||||
---
|
||||
|
||||
[Install](#installation--quick-start) · [AI Agent Skills](#ai-agent-skills) · [Auth](#configure--use) · [Commands](#usage-examples) · [Contributing](#related-projects)
|
||||
## 项目简介
|
||||
|
||||
## Why gitlink-cli?
|
||||
随着 Claude Code、Cursor 等 AI 编程智能体兴起,开发者正从"手动操作平台"转向"Agent 驱动开发"。但 GitLink 平台的能力长期锁在网页 GUI 里——AI 看不到、调不动,开发者也得在终端和浏览器间反复切换。
|
||||
|
||||
- **Agent-Native Design** — 12 structured [Skills](./skills/) out of the box, compatible with Claude Code, OpenClaw, and other AI platforms — Agents can operate GitLink with zero extra setup
|
||||
- **Wide Coverage** — Repository, Issue, PR, Branch, Release, CI, Org, Search, User — all core domains covered
|
||||
- **AI-Friendly & Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output
|
||||
- **Cross-Platform** — Runs on macOS, Linux, and Windows (x64/arm64), install via `npm install -g @gitlink-ai/cli` in one command, binary auto-downloaded
|
||||
- **Open Source, Zero Barriers** — MulanPSL-2.0 license, ready to use, just `npm install`
|
||||
- **Up and Running in 3 Minutes** — Interactive login or `GITLINK_TOKEN` env var, from install to first API call in just 3 steps
|
||||
- **Secure & Controllable** — OS-native keychain credential storage, `GITLINK_TOKEN` env var for CI/CD & non-interactive environments, auto git remote context resolution
|
||||
- **Scriptable Output** — Designed for repeatable terminal workflows and automation pipelines
|
||||
- **Three-Layer Architecture** — Shortcuts (human & AI friendly) → Raw API (full coverage) → Config (configuration management)
|
||||
本项目围绕 [gitlink-cli](https://gitlink.org.cn/gitlink/gitlink-cli) 做了四件事:
|
||||
|
||||
## Features
|
||||
1. **把平台能力命令化**——新增 19 个命令模块、110 条命令,让每类操作都能在终端一行命令完成
|
||||
2. **给 AI 写使用说明书**——23 个 Skill,让 Claude Code 等智能体直接会操控 GitLink
|
||||
3. **串成端到端工作流**——自研工作流引擎,一行命令把多个 Skill 串成自动化流水线
|
||||
4. **延伸到科研场景**——科研项目洞悉、FAIR 合规检查、贡献者画像
|
||||
|
||||
| Category | Capabilities |
|
||||
|----------|-------------|
|
||||
| 📦 Repo | List, create, fork, delete repositories, view repo info |
|
||||
| 🐛 Issue | Create, update, close, batch close, comment on issues |
|
||||
| 🔀 PR | Create, merge, review pull requests, view changed files |
|
||||
| 🌿 Branch | Create, delete, list, protect, unprotect branches |
|
||||
| 🏷️ Release | Create, view, delete releases |
|
||||
| 🏢 Org | Manage organizations, members, teams |
|
||||
| 🔧 CI | View builds, logs, CI/CD operations |
|
||||
| 🔍 Search | Search repositories, users |
|
||||
| 👤 User | View user profiles and info |
|
||||
| 📋 PM | Sprint management, kanban boards, weekly reports |
|
||||
| 🤖 Workflow | AI-powered issue triage, PR review, release notes |
|
||||
| 指标 | 数值 |
|
||||
|------|------|
|
||||
| 命令模块 | 19 个(110 条命令) |
|
||||
| 批量操作 | 11 条(全部支持 `--dry-run` 预演) |
|
||||
| AI Agent Skill | 23 个 |
|
||||
| 预置工作流 | 5 个 |
|
||||
| 单元测试 | 187 个 |
|
||||
| 交叉编译平台 | 8 个(Win/Linux/macOS/FreeBSD × amd64/arm64) |
|
||||
|
||||
## Installation & Quick Start
|
||||
---
|
||||
|
||||
### Requirements
|
||||
## 四大子赛题成果
|
||||
|
||||
- Node.js 14+ (`npm`/`npx`) — for npm installation
|
||||
- Supported platforms: macOS, Linux, Windows (x64/arm64)
|
||||
- Go 1.26+ — only required for building from source
|
||||
### 子赛题一 · 增加 CLI 能力
|
||||
新增 19 个 Shortcut 模块(仓库/Issue/PR/Release/CI/Webhook/标签/里程碑/Wiki/工作流…),11 条批量操作,修复跨平台兼容性(Windows/Linux/macOS/FreeBSD)。已向主仓库提交 PR。
|
||||
- 代码:[`shortcuts/`](shortcuts/)、[`internal/`](internal/)、[`cmd/`](cmd/)
|
||||
- 提交材料:[`提交材料/子赛题一-CLI能力/`](提交材料/子赛题一-CLI能力/)
|
||||
|
||||
### Quick Start (Human Users)
|
||||
### 子赛题二 · 编写 Skills
|
||||
23 个 Skill(命令操作类 + 智能分析型),覆盖健康度报告、Release Notes 生成、Issue 智能分拣、智能代码审查、许可证合规、科研辅助等。一键 `setup-skills.sh` 装进 Claude Code 即可用 `/gitlink-xxx` 调用。
|
||||
- 代码:[`skills/`](skills/)
|
||||
- 演示录屏:[`提交材料/子赛题二-Skills/demos/`](提交材料/子赛题二-Skills/demos/)
|
||||
|
||||
> **Note for AI assistants:** If you are an AI Agent helping the user with installation, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent), which contains all the steps you need to complete.
|
||||
### 子赛题三 · 端到端工作流
|
||||
自研工作流引擎(`shortcuts/workflow/`),AI/规则双模式,5 个预置工作流(代码质量看门人/社区运营自动化/贡献者成长/多仓库协同/项目一键初始化),支持手动/轮询/定时触发,systemd 7×24 自动运行。
|
||||
- 代码:[`shortcuts/workflow/`](shortcuts/workflow/)
|
||||
- 提交材料:[`提交材料/子赛题三-工作流/`](提交材料/子赛题三-工作流/)
|
||||
|
||||
#### Install
|
||||
### 子赛题四 · 辅助科研
|
||||
gitlink-spark(科研软件 X 光)、gitlink-research-fair(FAIR 合规检查)、gitlink-contributor-ranking(贡献者画像),面向科研项目洞悉、合规校验、协作匹配。
|
||||
- 代码:[`skills/gitlink-spark`](skills/gitlink-spark)、[`skills/gitlink-research-fair`](skills/gitlink-research-fair)
|
||||
- 提交材料:[`提交材料/子赛题四-科研/`](提交材料/子赛题四-科研/)
|
||||
|
||||
**From npm (recommended):**
|
||||
> 📁 所有变更说明、演示录屏/截图集中在 [`提交材料/`](提交材料/) 目录。
|
||||
|
||||
---
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 安装
|
||||
|
||||
```bash
|
||||
# One command: installs CLI binary + all 12 AI Agent Skills
|
||||
# 方式一:go install(需 Go 1.26+)
|
||||
go install github.com/gitlink-org/gitlink-cli@latest
|
||||
|
||||
# 方式二:npm
|
||||
npm install -g @gitlink-ai/cli
|
||||
|
||||
# 方式三:下载预编译包(8 平台)
|
||||
# 见 Release 页面
|
||||
```
|
||||
|
||||
The binary is auto-downloaded for your platform during `postinstall`. No extra steps needed.
|
||||
|
||||
**From source:**
|
||||
|
||||
Requires Go 1.26+.
|
||||
### 认证
|
||||
|
||||
```bash
|
||||
git clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git
|
||||
cd gitlink-cli
|
||||
make install
|
||||
gitlink-cli auth login # 浏览器登录,cookie 自动保存
|
||||
gitlink-cli auth status # 查看登录状态
|
||||
```
|
||||
|
||||
> **Windows users:** Run `npm install -g @gitlink-ai/cli` in PowerShell or CMD. For building from source, use `go install .` instead of `make install`.
|
||||
|
||||
#### Configure & Use
|
||||
### 使用示例
|
||||
|
||||
```bash
|
||||
# 1. Configure (one-time, interactive guided setup)
|
||||
gitlink-cli config init
|
||||
# 列出仓库的 Issue
|
||||
gitlink-cli issue +list --owner gitlink --repo gitlink-cli
|
||||
|
||||
# 2. Log in (choose one)
|
||||
gitlink-cli auth login # Username/password (recommended)
|
||||
gitlink-cli auth login --token # Or paste a private token
|
||||
export GITLINK_TOKEN="your-token" # Or set env var (for CI/CD, non-interactive environments)
|
||||
# 批量关闭(先预演)
|
||||
gitlink-cli issue +batch-close --numbers 1,2,3 --dry-run
|
||||
|
||||
# 3. Start using
|
||||
gitlink-cli repo +list
|
||||
# 在 Claude Code 里一句话调用 Skill
|
||||
/gitlink-triage 帮我分拣所有未分类的 Issue
|
||||
```
|
||||
|
||||
### Quick Start (AI Agent)
|
||||
|
||||
> The following steps are for AI Agents. Some steps require the user to complete actions in a browser.
|
||||
|
||||
**Step 1 — Install**
|
||||
### 一键启用 Skills(Claude Code)
|
||||
|
||||
```bash
|
||||
# One command: CLI binary + all Skills auto-installed
|
||||
npm install -g @gitlink-ai/cli
|
||||
bash scripts/setup-skills.sh # 把 skills/ 链接到 ~/.claude/skills/
|
||||
# 之后在 Claude Code 里就能 /gitlink-xxx 调用
|
||||
```
|
||||
|
||||
**Step 2 — Configure**
|
||||
### 在线演示
|
||||
|
||||
```bash
|
||||
gitlink-cli config init
|
||||
Showcase Dashboard:<http://118.31.4.168:9090> —— 浏览器里点卡片就能跑命令,无需安装。
|
||||
|
||||
---
|
||||
|
||||
## 架构说明
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────┐
|
||||
│ 入口层 cmd/ main.go → root.go (cobra root) │
|
||||
│ 4 个基础命令: auth / api / config / version │
|
||||
│ 全局 flag: --owner/--repo/--format/--debug │
|
||||
└───────────────┬──────────────────────────────────────────┘
|
||||
│ shortcuts.RegisterAll(rootCmd)
|
||||
┌───────────────▼──────────────────────────────────────────┐
|
||||
│ 业务层 shortcuts/ 19 组 × 100+ 命令 + 工作流引擎 │
|
||||
│ register.go 命令注册中枢 │
|
||||
│ common/ RuntimeContext 业务统一上下文 │
|
||||
│ workflow/ 工作流引擎(AI/规则双模式 + 5 预置流) │
|
||||
└───────────────┬──────────────────────────────────────────┘
|
||||
│ RuntimeContext.CallAPI / Output
|
||||
┌───────────────▼──────────────────────────────────────────┐
|
||||
│ 基础层 internal/ Go 内部包,不对外暴露 │
|
||||
│ client/ HTTP 客户端 + .json 后缀 + 错误检测 │
|
||||
│ auth/ Transport 自动注入 Cookie/access_token │
|
||||
│ config/ YAML 配置 + 跨平台路径 │
|
||||
│ output/ Envelope(ok/data/meta) + json/yaml/table │
|
||||
└──────────────────────────────────────────────────────────┘
|
||||
|
||||
独立的 AI 层 skills/ 23 个 SKILL.md,面向 AI Agent 的自然语言说明书
|
||||
(非编译期依赖,指导 Agent 调用编译好的二进制)
|
||||
```
|
||||
|
||||
**Step 3 — Login**
|
||||
**核心设计**:业务命令只依赖 `RuntimeContext`,绝不直接接触 cobra/HTTP 细节——新增模块只挂一个 `shortcuts/` 子包,不动入口与基础层。这是 19 模块 100+ 命令仍保持可测试性的根本。
|
||||
|
||||
For interactive environments:
|
||||
```bash
|
||||
gitlink-cli auth login
|
||||
```
|
||||
---
|
||||
|
||||
For non-interactive environments (CI/CD, Trae sandbox, MCP, etc.):
|
||||
```bash
|
||||
export GITLINK_TOKEN="your-private-token"
|
||||
```
|
||||
|
||||
> To get a private token, go to GitLink web → Settings → Private Tokens.
|
||||
|
||||
**Step 4 — Verify**
|
||||
|
||||
```bash
|
||||
gitlink-cli user +me
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Repository Operations
|
||||
|
||||
```bash
|
||||
# List repositories
|
||||
gitlink-cli repo +list
|
||||
|
||||
# View repository info
|
||||
gitlink-cli repo +info --owner Gitlink --repo forgeplus
|
||||
|
||||
# Create a repository
|
||||
gitlink-cli repo +create -n my-project -d "Project description"
|
||||
|
||||
# Fork a repository
|
||||
gitlink-cli repo +fork --owner Gitlink --repo forgeplus
|
||||
```
|
||||
|
||||
### Issue Management
|
||||
|
||||
```bash
|
||||
# List issues
|
||||
gitlink-cli issue +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# Create an issue
|
||||
gitlink-cli issue +create --owner Gitlink --repo forgeplus -t "Bug: Login failed" -b "Steps to reproduce..."
|
||||
|
||||
# View an issue
|
||||
gitlink-cli issue +view --owner Gitlink --repo forgeplus -i 123
|
||||
|
||||
# Close an issue
|
||||
gitlink-cli issue +close --owner Gitlink --repo forgeplus -i 123
|
||||
|
||||
# Preview batch close without changing data
|
||||
gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --numbers 123,124 --dry-run
|
||||
|
||||
# Batch close issues from a CSV file
|
||||
gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --from issues.csv
|
||||
|
||||
# Add a comment
|
||||
gitlink-cli issue +comment --owner Gitlink --repo forgeplus -i 123 -b "Fixed"
|
||||
```
|
||||
|
||||
### Pull Requests
|
||||
|
||||
```bash
|
||||
# List PRs
|
||||
gitlink-cli pr +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# Create a PR (same-repo branch)
|
||||
gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: Search feature" --head feature/search --base master
|
||||
|
||||
# Create a PR (from a fork)
|
||||
gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: New feature" --head your_username/forgeplus:feature/my-feature --base master
|
||||
|
||||
# View a PR
|
||||
gitlink-cli pr +view --owner Gitlink --repo forgeplus -i 42
|
||||
|
||||
# Merge a PR
|
||||
gitlink-cli pr +merge --owner Gitlink --repo forgeplus -i 42
|
||||
|
||||
# View changed files
|
||||
gitlink-cli pr +files --owner Gitlink --repo forgeplus -i 42
|
||||
```
|
||||
|
||||
### Branch Management
|
||||
|
||||
```bash
|
||||
# List branches
|
||||
gitlink-cli branch +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# Create a branch
|
||||
gitlink-cli branch +create --name feature/new-feature
|
||||
|
||||
# Delete a branch
|
||||
gitlink-cli branch +delete --name feature/old-feature
|
||||
|
||||
# Protect a branch
|
||||
gitlink-cli branch +protect --name main
|
||||
|
||||
# Remove branch protection
|
||||
gitlink-cli branch +unprotect --name main
|
||||
```
|
||||
|
||||
### Release Management
|
||||
|
||||
```bash
|
||||
# List releases
|
||||
gitlink-cli release +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# Create a release
|
||||
gitlink-cli release +create --owner Gitlink --repo forgeplus -t v1.0.0 -n "v1.0.0 Stable" -b "Changelog..."
|
||||
|
||||
# View a release
|
||||
gitlink-cli release +view --owner Gitlink --repo forgeplus -i <version_id>
|
||||
```
|
||||
|
||||
### CI/CD Operations
|
||||
|
||||
```bash
|
||||
# List builds
|
||||
gitlink-cli ci +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# View build log
|
||||
gitlink-cli ci +log --owner Gitlink --repo forgeplus -i <build_id>
|
||||
|
||||
# Restart a build
|
||||
gitlink-cli ci +restart --owner Gitlink --repo forgeplus -i <build_id>
|
||||
```
|
||||
|
||||
### Search
|
||||
|
||||
```bash
|
||||
# Search repositories
|
||||
gitlink-cli search +repos -k "machine learning"
|
||||
|
||||
# Search users
|
||||
gitlink-cli search +users -k "zhangsan"
|
||||
```
|
||||
|
||||
### Raw API
|
||||
|
||||
For endpoints not covered by shortcuts, use the Raw API directly:
|
||||
|
||||
```bash
|
||||
# GET request
|
||||
gitlink-cli api GET /users/me
|
||||
|
||||
# POST request
|
||||
gitlink-cli api POST /Gitlink/forgeplus/issues --body '{"subject":"test","description":"..."}'
|
||||
|
||||
# With query parameters
|
||||
gitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1&limit=5'
|
||||
```
|
||||
|
||||
## Global Parameters
|
||||
|
||||
| Parameter | Description | Example |
|
||||
|-----------|-------------|---------|
|
||||
| `--owner` | Repository owner | `--owner Gitlink` |
|
||||
| `--repo` | Repository name | `--repo forgeplus` |
|
||||
| `--format` | Output format (json/table/yaml) | `--format json` |
|
||||
| `--debug` | Enable debug output | `--debug` |
|
||||
|
||||
**Automatic context resolution:** When running inside a git repository, `--owner` and `--repo` are automatically resolved from `git remote origin`.
|
||||
|
||||
## Branch Conventions
|
||||
|
||||
gitlink-cli supports bidirectional code sync between GitHub and GitLink:
|
||||
|
||||
| Platform | Default Branch |
|
||||
|----------|---------------|
|
||||
| GitHub | `main` |
|
||||
| GitLink | `master` |
|
||||
|
||||
**Push to GitLink from local:**
|
||||
|
||||
```bash
|
||||
# Method 1: Use git command directly
|
||||
git push gitlink main:master
|
||||
|
||||
# Method 2: Configure git remote
|
||||
git config remote.gitlink.push refs/heads/main:refs/heads/master
|
||||
git push gitlink
|
||||
```
|
||||
|
||||
## AI Agent Skills
|
||||
|
||||
The `skills/` directory contains 12 Agent Skill files for AI-automated GitLink operations.
|
||||
|
||||
See [skills/README.md](skills/README.md) for details.
|
||||
|
||||
| Skill | Description |
|
||||
|-------|-------------|
|
||||
| `gitlink-shared` | Authentication, global parameters, safety rules, API notes |
|
||||
| `gitlink-repo` | Repository operations (create, view, delete, fork, etc.) |
|
||||
| `gitlink-issue` | Issue operations (create, update, close, comment, etc.) |
|
||||
| `gitlink-pr` | Pull request operations (create, merge, review, etc.) |
|
||||
| `gitlink-branch` | Branch management (create, delete, list, protect, unprotect) |
|
||||
| `gitlink-release` | Release management (create, view, delete, etc.) |
|
||||
| `gitlink-ci` | CI/CD operations (builds, logs, etc.) |
|
||||
| `gitlink-search` | Search (repositories, users, etc.) |
|
||||
| `gitlink-org` | Organization management (members, teams, etc.) |
|
||||
| `gitlink-user` | User management (profile info, etc.) |
|
||||
| `gitlink-pm` | Project management (sprints, kanban, weekly reports, etc.) |
|
||||
| `gitlink-workflow` | AI-powered workflows (issue triage, PR review, release notes, etc.) |
|
||||
|
||||
## Project Structure
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
gitlink-cli/
|
||||
├── cmd/ # Cobra command definitions
|
||||
│ ├── root.go # Root command + global flags
|
||||
│ ├── auth/ # Authentication commands
|
||||
│ ├── api/ # Raw API commands
|
||||
│ ├── config/ # Configuration commands
|
||||
│ └── cmdutil/ # Global utilities
|
||||
├── internal/ # Internal packages
|
||||
│ ├── auth/ # Login, token storage, transport
|
||||
│ ├── client/ # HTTP client + pagination
|
||||
│ ├── config/ # Config file management
|
||||
│ ├── context/ # Git remote resolution
|
||||
│ └── output/ # Envelope + formatter
|
||||
├── shortcuts/ # Shortcut implementations
|
||||
│ ├── common/ # Framework (types, runner)
|
||||
│ ├── repo/ # Repository shortcuts
|
||||
│ ├── issue/ # Issue shortcuts
|
||||
│ ├── pr/ # PR shortcuts
|
||||
│ ├── branch/ # Branch shortcuts
|
||||
│ ├── release/ # Release shortcuts
|
||||
│ ├── org/ # Organization shortcuts
|
||||
│ ├── ci/ # CI shortcuts
|
||||
│ ├── search/ # Search shortcuts
|
||||
│ ├── user/ # User shortcuts
|
||||
│ └── register.go # Registration entry point
|
||||
├── skills/ # AI Agent Skills
|
||||
│ ├── README.md # Skills guide
|
||||
│ ├── gitlink-shared/ # Shared rules
|
||||
│ ├── gitlink-repo/ # Repository skill
|
||||
│ ├── gitlink-issue/ # Issue skill
|
||||
│ ├── gitlink-pr/ # PR skill
|
||||
│ ├── gitlink-pm/ # Project management skill
|
||||
│ └── ...
|
||||
├── doc/ # Design documents
|
||||
│ ├── Design.md
|
||||
│ ├── CODE_SYNC_STRATEGY_FINAL.md
|
||||
│ └── ...
|
||||
├── main.go
|
||||
├── Makefile
|
||||
├── go.mod
|
||||
└── README.md
|
||||
├── README.md # 本文件
|
||||
├── cmd/ # 入口层(auth/api/config/version)
|
||||
├── shortcuts/ # 业务层(19 命令模块 + workflow 工作流引擎)
|
||||
├── internal/ # 基础层(client/auth/config/output/context/errors)
|
||||
├── skills/ # 23 个 AI Agent Skill
|
||||
├── showcase/ # 在线演示 Dashboard(Go 单二进制)
|
||||
├── scripts/ # 脚本(setup-skills.sh 等)
|
||||
├── docs/ # 设计文档、API 参考
|
||||
└── 提交材料/ # ★ 比赛提交材料(变更说明 + 演示录屏/截图)
|
||||
├── 子赛题一-CLI能力/
|
||||
├── 子赛题二-Skills/
|
||||
├── 子赛题三-工作流/
|
||||
└── 子赛题四-科研/
|
||||
```
|
||||
|
||||
## Documentation
|
||||
---
|
||||
|
||||
- [Skills Guide](skills/README.md) — AI Agent Skills detailed documentation
|
||||
- [Design Document](doc/design.md) — Architecture design and development plan
|
||||
## 技术栈
|
||||
|
||||
## FAQ
|
||||
- **语言**:Go 1.26(子赛题一);Markdown/Shell(子赛题二三四)
|
||||
- **CLI 框架**:spf13/cobra
|
||||
- **密钥存储**:zalando/go-keyring(OS keychain + 文件 fallback)
|
||||
- **配置**:gopkg.in/yaml.v3
|
||||
- **CI/CD**:GitLink DevOps(建木引擎)自动部署 + GitHub Actions 8 平台发版
|
||||
|
||||
### Q: How do I use gitlink-cli in scripts?
|
||||
---
|
||||
|
||||
Use the `GITLINK_TOKEN` environment variable + `--format json` for structured output:
|
||||
## 团队
|
||||
|
||||
```bash
|
||||
export GITLINK_TOKEN="your-private-token"
|
||||
gitlink-cli repo +list --format json | jq '.data.projects[] | .name'
|
||||
```
|
||||
| 成员 | 负责 |
|
||||
|------|------|
|
||||
| chroe | CLI 核心模块、Showcase、CI/CD、health/changelog/triage Skill、工作流引擎 |
|
||||
| yetja | 批量操作、单元测试、license/repo/org Skill、工作流规则引擎 |
|
||||
| caoweiqiong | file/member/watch/star 模块、review Skill、FreeBSD 支持 |
|
||||
|
||||
### Q: How does automatic owner/repo resolution work?
|
||||
---
|
||||
|
||||
When running inside a git repository, the CLI automatically resolves `--owner` and `--repo` from `git remote origin`:
|
||||
## 相关链接
|
||||
|
||||
```bash
|
||||
cd ~/my-gitlink-project
|
||||
gitlink-cli issue +list # Automatically uses the current repository
|
||||
```
|
||||
|
||||
### Q: What if my token expires?
|
||||
|
||||
Re-authenticate:
|
||||
|
||||
```bash
|
||||
# Username/password login
|
||||
gitlink-cli auth login
|
||||
|
||||
# Or use a private token (generate at GitLink web → Settings → Private Tokens)
|
||||
gitlink-cli auth login --token
|
||||
```
|
||||
|
||||
### Q: How do I use gitlink-cli in CI/CD or non-interactive environments (e.g. Trae sandbox)?
|
||||
|
||||
Set the `GITLINK_TOKEN` environment variable — no `auth login` needed:
|
||||
|
||||
```bash
|
||||
export GITLINK_TOKEN="your-private-token"
|
||||
gitlink-cli repo +list # Ready to use
|
||||
gitlink-cli auth status # Shows "✓ Logged in via GITLINK_TOKEN environment variable"
|
||||
```
|
||||
|
||||
Priority: `GITLINK_TOKEN` env var > keyring/file stored token. When the env var is not set, the original interactive login flow works as before.
|
||||
|
||||
### Q: What if npm installs successfully but `gitlink-cli` reports a missing binary?
|
||||
|
||||
Reinstall first:
|
||||
|
||||
```bash
|
||||
npm install -g @gitlink-ai/cli
|
||||
```
|
||||
|
||||
If the error persists, check whether the release page contains the asset for your platform, for example `gitlink-cli_<version>_windows_amd64.zip` on Windows x64. You can also download the binary manually from the release page or build from source with `go install .`.
|
||||
|
||||
### Q: Where are credentials stored on Windows?
|
||||
|
||||
gitlink-cli uses Windows Credential Manager for secure token storage. If Credential Manager is unavailable, it automatically falls back to file storage (`~/.config/gitlink-cli/credentials`).
|
||||
|
||||
### Q: Where can I find the full API reference?
|
||||
|
||||
See [skills/gitlink-shared/REFERENCE.md](skills/gitlink-shared/REFERENCE.md).
|
||||
|
||||
## License
|
||||
|
||||
[MulanPSL-2.0](https://license.coscl.org.cn/MulanPSL2)
|
||||
|
||||
> This line is for PR workflow testing, can be reverted after merge.
|
||||
- 上游仓库:<https://gitlink.org.cn/gitlink/gitlink-cli>
|
||||
- 本项目(Fork):<https://gitlink.org.cn/chroe/gitlink-cli>
|
||||
- 在线 Showcase:<http://118.31.4.168:9090>
|
||||
- Skills 开发指南:[`skills/README.md`](skills/README.md)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# 提交材料
|
||||
|
||||
本目录按赛题要求集中存放各子赛题的**变更说明**与**演示录屏/截图**。
|
||||
|
||||
| 子赛题 | 目录 | 内容 |
|
||||
|--------|------|------|
|
||||
| 子赛题一 · CLI 能力增强 | [子赛题一-CLI能力/](子赛题一-CLI能力/) | 变更说明.md + 功能演示 |
|
||||
| 子赛题二 · 编写 Skills | [子赛题二-Skills/](子赛题二-Skills/) | 变更说明.md + 演示录屏/截图(**已就绪**)|
|
||||
| 子赛题三 · 工作流 | [子赛题三-工作流/](子赛题三-工作流/) | 工作流说明 + 架构图 + 演示 |
|
||||
| 子赛题四 · 辅助科研 | [子赛题四-科研/](子赛题四-科研/) | 科研应用报告 + 场景成果 + 演示 |
|
||||
|
||||
> 各子赛题的演示材料放在对应目录的 `demos/` 子文件夹下。
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# 子赛题一 · CLI 能力增强
|
||||
|
||||
本目录存放子赛题一的变更说明与功能演示。
|
||||
|
||||
- `变更说明.md` — 新增/修改的命令清单、批量操作、跨平台支持等(待补充)
|
||||
- `demos/` — CLI 功能演示录屏/截图
|
||||
|
||||
成果概览:19 个命令模块、110 条命令、11 条批量操作、8 平台交叉编译。
|
||||
代码在仓库 `shortcuts/`、`internal/`、`cmd/` 目录。
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# 子赛题三 · 端到端自动化工作流
|
||||
|
||||
本目录存放工作流的说明文档、架构图与演示。
|
||||
|
||||
- `工作流说明.md` — 5 个预置工作流的场景、步骤、触发方式
|
||||
- `架构图.png` — 工作流引擎架构(Step/引擎/触发器三层)
|
||||
- `demos/` — 工作流运行演示录屏/截图
|
||||
|
||||
代码在仓库 `shortcuts/workflow/`,5 个预置工作流:code-quality / community-ops / contributor-growth / multi-repo / project-init。
|
||||
|
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
|
|
@ -0,0 +1,8 @@
|
|||
# 子赛题四 · 应用 GitLink 辅助科研
|
||||
|
||||
本目录存放科研场景的应用报告、成果与演示。
|
||||
|
||||
- `科研应用报告.md` — 方案技术实现、科研赋能价值、落地效果
|
||||
- `demos/` — 科研 Skill 运行演示录屏/截图 + 场景输出成果(报告/图谱等)
|
||||
|
||||
科研 Skill 在仓库 `skills/gitlink-spark`、`skills/gitlink-research-fair`、`skills/gitlink-contributor-ranking`。
|
||||
Loading…
Reference in New Issue