{"id":49773165,"url":"https://github.com/ccfos/gitlink-cli","last_synced_at":"2026-05-11T14:04:35.855Z","repository":{"id":351925240,"uuid":"1213048940","full_name":"ccfos/gitlink-cli","owner":"ccfos","description":"CCF GitLink（确实开源） CLI tool — built for humans and AI Agents. Supports macOS, Linux, and Windows. Covers repo management, issue tracking, pull requests, CI/CD, and AI-powered workflows, with 40+ commands and 11 AI Agent Skills.","archived":false,"fork":false,"pushed_at":"2026-04-17T03:46:16.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T05:29:00.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccfos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-17T01:56:07.000Z","updated_at":"2026-04-17T03:52:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ccfos/gitlink-cli","commit_stats":null,"previous_names":["ccfos/gitlink-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ccfos/gitlink-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccfos%2Fgitlink-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccfos%2Fgitlink-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccfos%2Fgitlink-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccfos%2Fgitlink-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccfos","download_url":"https://codeload.github.com/ccfos/gitlink-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccfos%2Fgitlink-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32897947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-11T14:04:34.889Z","updated_at":"2026-05-11T14:04:35.843Z","avatar_url":"https://github.com/ccfos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitlink-cli\n\n[![GitLink](https://img.shields.io/badge/GitLink-Gitlink%2Fgitlink--cli-green)](https://www.gitlink.org.cn/Gitlink/gitlink-cli)\n[![License](https://img.shields.io/badge/License-MulanPSL--2.0-blue.svg)](https://license.coscl.org.cn/MulanPSL2)\n[![Go Version](https://img.shields.io/badge/Go-1.26%2B-blue.svg)](https://golang.org)\n[![npm version](https://img.shields.io/npm/v/@gitlink-ai/cli.svg)](https://www.npmjs.com/package/@gitlink-ai/cli)\n\nThe 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 11 AI Agent [Skills](./skills/).\n\n**[中文文档](./README.zh-CN.md)**\n\n[Install](#installation--quick-start) · [AI Agent Skills](#ai-agent-skills) · [Auth](#configure--use) · [Commands](#usage-examples) · [Contributing](#related-projects)\n\n## Why gitlink-cli?\n\n- **Agent-Native Design** — 11 structured [Skills](./skills/) out of the box, compatible with Claude Code — Agents can operate GitLink with zero extra setup\n- **Wide Coverage** — Repository, Issue, PR, Branch, Release, CI, Org, Search, User — all core domains covered\n- **AI-Friendly \u0026 Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output\n- **Cross-Platform** — Runs on macOS, Linux, and Windows (x64/arm64), install via `npm` in one command\n- **Open Source, Zero Barriers** — MulanPSL-2.0 license, ready to use, just `npm install`\n- **Up and Running in 3 Minutes** — Interactive login or `GITLINK_TOKEN` env var, from install to first API call in just 3 steps\n- **Secure \u0026 Controllable** — OS-native keychain credential storage, `GITLINK_TOKEN` env var for CI/CD \u0026 non-interactive environments, auto git remote context resolution\n- **Three-Layer Architecture** — Shortcuts (human \u0026 AI friendly) → Raw API (full coverage) → Config (configuration management)\n\n## Features\n\n| Category | Capabilities |\n|----------|-------------|\n| 📦 Repo | List, create, fork, delete repositories, view repo info |\n| 🐛 Issue | Create, update, close, comment on issues |\n| 🔀 PR | Create, merge, review pull requests, view changed files |\n| 🌿 Branch | Create, delete, protect branches |\n| 🏷️ Release | Create, view, delete releases |\n| 🏢 Org | Manage organizations, members, teams |\n| 🔧 CI | View builds, logs, CI/CD operations |\n| 🔍 Search | Search repositories, users |\n| 👤 User | View user profiles and info |\n| 📋 PM | Sprint management, kanban boards, weekly reports |\n| 🤖 Workflow | AI-powered issue triage, PR review, release notes |\n\n## Installation \u0026 Quick Start\n\n### Requirements\n\n- Node.js 14+ (`npm`/`npx`) — for npm installation\n- Supported platforms: macOS, Linux, Windows (x64/arm64)\n- Go 1.26+ — only required for building from source\n\n### Quick Start (Human Users)\n\n\u003e **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.\n\n#### Install\n\nChoose **one** of the following methods:\n\n**Option 1 — From npm (recommended):**\n\n```bash\n# Install CLI\nnpm install -g @gitlink-ai/cli\n\n# Install CLI Skills (required, works on all platforms)\ngitlink-cli-install-skills\n\n# Or install Skills with npx\nnpx skills add ccfos/gitlink-cli/skills -y -g\n```\n\n**Option 2 — From source:**\n\nRequires Go 1.26+.\n\n```bash\ngit clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git\ncd gitlink-cli\nmake install\n\n# Install CLI Skills (required)\nnpx skills add ./skills -y -g\n```\n\n\u003e **Windows users:** Run `npm install -g @gitlink-ai/cli` in PowerShell or CMD. For building from source, use `go install .` instead of `make install`.\n\n#### Configure \u0026 Use\n\n```bash\n# 1. Configure (one-time, interactive guided setup)\ngitlink-cli config init\n\n# 2. Log in (choose one)\ngitlink-cli auth login            # Username/password (recommended)\ngitlink-cli auth login --token    # Or paste a private token\nexport GITLINK_TOKEN=\"your-token\" # Or set env var (for CI/CD, non-interactive environments)\n\n# 3. Start using\ngitlink-cli repo +list\n```\n\n### Quick Start (AI Agent)\n\n\u003e The following steps are for AI Agents. Some steps require the user to complete actions in a browser.\n\n**Step 1 — Install**\n\n```bash\n# Install CLI\nnpm install -g @gitlink-ai/cli\n\n# Install CLI Skills (required, works on all platforms)\ngitlink-cli-install-skills\n```\n\n**Step 2 — Configure**\n\n```bash\ngitlink-cli config init\n```\n\n**Step 3 — Login**\n\nFor interactive environments:\n```bash\ngitlink-cli auth login\n```\n\nFor non-interactive environments (CI/CD, Trae sandbox, MCP, etc.):\n```bash\nexport GITLINK_TOKEN=\"your-private-token\"\n```\n\n\u003e To get a private token, go to GitLink web → Settings → Private Tokens.\n\n**Step 4 — Verify**\n\n```bash\ngitlink-cli user +me\n```\n\n## Usage Examples\n\n### Repository Operations\n\n```bash\n# List repositories\ngitlink-cli repo +list\n\n# View repository info\ngitlink-cli repo +info --owner Gitlink --repo forgeplus\n\n# Create a repository\ngitlink-cli repo +create -n my-project -d \"Project description\"\n\n# Fork a repository\ngitlink-cli repo +fork --owner Gitlink --repo forgeplus\n```\n\n### Issue Management\n\n```bash\n# List issues\ngitlink-cli issue +list --owner Gitlink --repo forgeplus\n\n# Create an issue\ngitlink-cli issue +create --owner Gitlink --repo forgeplus -t \"Bug: Login failed\" -b \"Steps to reproduce...\"\n\n# View an issue\ngitlink-cli issue +view --owner Gitlink --repo forgeplus -i 123\n\n# Close an issue\ngitlink-cli issue +close --owner Gitlink --repo forgeplus -i 123\n\n# Add a comment\ngitlink-cli issue +comment --owner Gitlink --repo forgeplus -i 123 -b \"Fixed\"\n```\n\n### Pull Requests\n\n```bash\n# List PRs\ngitlink-cli pr +list --owner Gitlink --repo forgeplus\n\n# Create a PR (same-repo branch)\ngitlink-cli pr +create --owner Gitlink --repo forgeplus -t \"feat: Search feature\" --head feature/search --base master\n\n# Create a PR (from a fork)\ngitlink-cli pr +create --owner Gitlink --repo forgeplus -t \"feat: New feature\" --head your_username/forgeplus:feature/my-feature --base master\n\n# View a PR\ngitlink-cli pr +view --owner Gitlink --repo forgeplus -i 42\n\n# Merge a PR\ngitlink-cli pr +merge --owner Gitlink --repo forgeplus -i 42\n\n# View changed files\ngitlink-cli pr +files --owner Gitlink --repo forgeplus -i 42\n```\n\n### Release Management\n\n```bash\n# List releases\ngitlink-cli release +list --owner Gitlink --repo forgeplus\n\n# Create a release\ngitlink-cli release +create --owner Gitlink --repo forgeplus -t v1.0.0 -n \"v1.0.0 Stable\" -b \"Changelog...\"\n\n# View a release\ngitlink-cli release +view --owner Gitlink --repo forgeplus -i \u003cversion_id\u003e\n```\n\n### Search\n\n```bash\n# Search repositories\ngitlink-cli search +repos -k \"machine learning\"\n\n# Search users\ngitlink-cli search +users -k \"zhangsan\"\n```\n\n### Raw API\n\nFor endpoints not covered by shortcuts, use the Raw API directly:\n\n```bash\n# GET request\ngitlink-cli api GET /users/me\n\n# POST request\ngitlink-cli api POST /Gitlink/forgeplus/issues --body '{\"subject\":\"test\",\"description\":\"...\"}'\n\n# With query parameters\ngitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1\u0026limit=5'\n```\n\n## Global Parameters\n\n| Parameter | Description | Example |\n|-----------|-------------|---------|\n| `--owner` | Repository owner | `--owner Gitlink` |\n| `--repo` | Repository name | `--repo forgeplus` |\n| `--format` | Output format (json/table/yaml) | `--format json` |\n| `--debug` | Enable debug output | `--debug` |\n\n**Automatic context resolution:** When running inside a git repository, `--owner` and `--repo` are automatically resolved from `git remote origin`.\n\n## Branch Conventions\n\ngitlink-cli supports bidirectional code sync between GitHub and GitLink:\n\n| Platform | Default Branch |\n|----------|---------------|\n| GitHub | `main` |\n| GitLink | `master` |\n\n**Push to GitLink from local:**\n\n```bash\n# Method 1: Use git command directly\ngit push gitlink main:master\n\n# Method 2: Configure git remote\ngit config remote.gitlink.push refs/heads/main:refs/heads/master\ngit push gitlink\n```\n\n## AI Agent Skills\n\nThe `skills/` directory contains 11 Claude Code Agent Skill files for AI-automated GitLink operations.\n\nSee [skills/README.md](skills/README.md) for details.\n\n| Skill | Description |\n|-------|-------------|\n| `gitlink-shared` | Authentication, global parameters, safety rules, API notes |\n| `gitlink-repo` | Repository operations (create, view, delete, fork, etc.) |\n| `gitlink-issue` | Issue operations (create, update, close, comment, etc.) |\n| `gitlink-pr` | Pull request operations (create, merge, review, etc.) |\n| `gitlink-release` | Release management (create, view, delete, etc.) |\n| `gitlink-org` | Organization management (members, teams, etc.) |\n| `gitlink-ci` | CI/CD operations (builds, logs, etc.) |\n| `gitlink-search` | Search (repositories, users, etc.) |\n| `gitlink-user` | User management (profile info, etc.) |\n| `gitlink-pm` | Project management (sprints, kanban, weekly reports, etc.) |\n| `gitlink-workflow` | AI-powered workflows (issue triage, PR review, release notes, etc.) |\n\n## Project Structure\n\n```\ngitlink-cli/\n├── cmd/                      # Cobra command definitions\n│   ├── root.go               # Root command + global flags\n│   ├── auth/                 # Authentication commands\n│   ├── api/                  # Raw API commands\n│   ├── config/               # Configuration commands\n│   └── cmdutil/              # Global utilities\n├── internal/                 # Internal packages\n│   ├── auth/                 # Login, token storage, transport\n│   ├── client/               # HTTP client + pagination\n│   ├── config/               # Config file management\n│   ├── context/              # Git remote resolution\n│   └── output/               # Envelope + formatter\n├── shortcuts/                # Shortcut implementations\n│   ├── common/               # Framework (types, runner)\n│   ├── repo/                 # Repository shortcuts\n│   ├── issue/                # Issue shortcuts\n│   ├── pr/                   # PR shortcuts\n│   ├── branch/               # Branch shortcuts\n│   ├── release/              # Release shortcuts\n│   ├── org/                  # Organization shortcuts\n│   ├── ci/                   # CI shortcuts\n│   ├── search/               # Search shortcuts\n│   ├── user/                 # User shortcuts\n│   └── register.go           # Registration entry point\n├── skills/                   # AI Agent Skills\n│   ├── README.md             # Skills guide\n│   ├── gitlink-shared/       # Shared rules\n│   ├── gitlink-repo/         # Repository skill\n│   ├── gitlink-issue/        # Issue skill\n│   ├── gitlink-pr/           # PR skill\n│   ├── gitlink-pm/           # Project management skill\n│   └── ...\n├── doc/                      # Design documents\n│   ├── Design.md\n│   ├── CODE_SYNC_STRATEGY_FINAL.md\n│   └── ...\n├── main.go\n├── Makefile\n├── go.mod\n└── README.md\n```\n\n## Documentation\n\n- [Skills Guide](skills/README.md) — AI Agent Skills detailed documentation\n- [Design Document](doc/design.md) — Architecture design and development plan\n\n## FAQ\n\n### Q: How do I use gitlink-cli in scripts?\n\nUse the `GITLINK_TOKEN` environment variable + `--format json` for structured output:\n\n```bash\nexport GITLINK_TOKEN=\"your-private-token\"\ngitlink-cli repo +list --format json | jq '.data.projects[] | .name'\n```\n\n### Q: How does automatic owner/repo resolution work?\n\nWhen running inside a git repository, the CLI automatically resolves `--owner` and `--repo` from `git remote origin`:\n\n```bash\ncd ~/my-gitlink-project\ngitlink-cli issue +list  # Automatically uses the current repository\n```\n\n### Q: What if my token expires?\n\nRe-authenticate:\n\n```bash\n# Username/password login\ngitlink-cli auth login\n\n# Or use a private token (generate at GitLink web → Settings → Private Tokens)\ngitlink-cli auth login --token\n```\n\n### Q: How do I use gitlink-cli in CI/CD or non-interactive environments (e.g. Trae sandbox)?\n\nSet the `GITLINK_TOKEN` environment variable — no `auth login` needed:\n\n```bash\nexport GITLINK_TOKEN=\"your-private-token\"\ngitlink-cli repo +list   # Ready to use\ngitlink-cli auth status   # Shows \"✓ Logged in via GITLINK_TOKEN environment variable\"\n```\n\nPriority: `GITLINK_TOKEN` env var \u003e keyring/file stored token. When the env var is not set, the original interactive login flow works as before.\n\n### Q: Where are credentials stored on Windows?\n\ngitlink-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`).\n\n### Q: Where can I find the full API reference?\n\nSee [skills/gitlink-shared/REFERENCE.md](skills/gitlink-shared/REFERENCE.md).\n\n## License\n\n[MulanPSL-2.0](https://license.coscl.org.cn/MulanPSL2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccfos%2Fgitlink-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccfos%2Fgitlink-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccfos%2Fgitlink-cli/lists"}