The official GitLink 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.
Supported platforms: macOS, Linux, Windows (x64/arm64)
Go 1.26+ — only required for building from source
Quick Start (Human Users)
Note for AI assistants: If you are an AI Agent helping the user with installation, jump directly to Quick Start (AI Agent), which contains all the steps you need to complete.
Install
Choose one of the following methods:
Option 1 — From npm (recommended):
# Install CLI
npm install -g @gitlink-ai/cli
# Install CLI Skills (required, works on all platforms)
gitlink-cli-install-skills
# Or install Skills with npx
npx skills add ccfos/gitlink-cli/skills -y -g
Option 2 — From source:
Requires Go 1.26+.
git clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git
cd gitlink-cli
make install
# Install CLI Skills (required)
npx skills add ./skills -y -g
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
# 1. Configure (one-time, interactive guided setup)
gitlink-cli config init
# 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)
# 3. Start using
gitlink-cli repo +list
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
# Install CLI
npm install -g @gitlink-ai/cli
# Install CLI Skills (required, works on all platforms)
gitlink-cli-install-skills
Step 2 — Configure
gitlink-cli config init
Step 3 — Login
For interactive environments:
gitlink-cli auth login
For non-interactive environments (CI/CD, Trae sandbox, MCP, etc.):
export GITLINK_TOKEN="your-private-token"
To get a private token, go to GitLink web → Settings → Private Tokens.
Step 4 — Verify
gitlink-cli user +me
Usage Examples
Repository Operations
# 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
# 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
# Add a comment
gitlink-cli issue +comment --owner Gitlink --repo forgeplus -i 123 -b "Fixed"
For endpoints not covered by shortcuts, use the Raw API directly:
# 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:
When running inside a git repository, the CLI automatically resolves --owner and --repo from git remote origin:
cd ~/my-gitlink-project
gitlink-cli issue +list # Automatically uses the current repository
Q: What if my token expires?
Re-authenticate:
# 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:
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: 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).
gitlink-cli
The official GitLink 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.
中文文档
Install · AI Agent Skills · Auth · Commands · Contributing
Why gitlink-cli?
npmin one commandnpm installGITLINK_TOKENenv var, from install to first API call in just 3 stepsGITLINK_TOKENenv var for CI/CD & non-interactive environments, auto git remote context resolutionFeatures
Installation & Quick Start
Requirements
npm/npx) — for npm installationQuick Start (Human Users)
Install
Choose one of the following methods:
Option 1 — From npm (recommended):
Option 2 — From source:
Requires Go 1.26+.
Configure & Use
Quick Start (AI Agent)
Step 1 — Install
Step 2 — Configure
Step 3 — Login
For interactive environments:
For non-interactive environments (CI/CD, Trae sandbox, MCP, etc.):
Step 4 — Verify
Usage Examples
Repository Operations
Issue Management
Pull Requests
Release Management
Search
Raw API
For endpoints not covered by shortcuts, use the Raw API directly:
Global Parameters
--owner--owner Gitlink--repo--repo forgeplus--format--format json--debug--debugAutomatic context resolution: When running inside a git repository,
--ownerand--repoare automatically resolved fromgit remote origin.Branch Conventions
gitlink-cli supports bidirectional code sync between GitHub and GitLink:
mainmasterPush to GitLink from local:
AI Agent Skills
The
skills/directory contains 11 Claude Code Agent Skill files for AI-automated GitLink operations.See skills/README.md for details.
gitlink-sharedgitlink-repogitlink-issuegitlink-prgitlink-releasegitlink-orggitlink-cigitlink-searchgitlink-usergitlink-pmgitlink-workflowProject Structure
Documentation
FAQ
Q: How do I use gitlink-cli in scripts?
Use the
GITLINK_TOKENenvironment variable +--format jsonfor structured output:Q: How does automatic owner/repo resolution work?
When running inside a git repository, the CLI automatically resolves
--ownerand--repofromgit remote origin:Q: What if my token expires?
Re-authenticate:
Q: How do I use gitlink-cli in CI/CD or non-interactive environments (e.g. Trae sandbox)?
Set the
GITLINK_TOKENenvironment variable — noauth loginneeded:Priority:
GITLINK_TOKENenv var > keyring/file stored token. When the env var is not set, the original interactive login flow works as before.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.
License
MulanPSL-2.0