feat: include skills in npm package, update README with AI Agent quick start

- Bundle skills/ directory into npm package for local installation
- Add npx skills add instructions for both human users and AI agents
- Update README installation section to match larksuite/cli style
- Bump npm version to 0.1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Your GitHub Username 2026-04-02 23:06:06 +08:00
parent 381a32a49f
commit 3c2e8f0580
5 changed files with 21 additions and 2 deletions

1
.gitignore vendored
View File

@ -18,4 +18,5 @@ vendor/
npm/bin/gitlink-cli
npm/*.tgz
npm/README.md
npm/skills/
dist/

View File

@ -54,7 +54,11 @@ Choose **one** of the following methods:
**Option 1 — From npm (recommended):**
```bash
# Install CLI
npm install -g @gitlink-ai/cli
# Install CLI SKILL (required)
npx skills add "$(npm root -g)/@gitlink-ai/cli/skills" -y -g
```
**Option 2 — From source:**
@ -65,6 +69,9 @@ Requires Go 1.21+.
git clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git
cd gitlink-cli
make install
# Install CLI SKILL (required)
npx skills add ./skills -y -g
```
#### Configure & Use
@ -87,7 +94,11 @@ gitlink-cli repo +list
**Step 1 — Install**
```bash
# Install CLI
npm install -g @gitlink-ai/cli
# Install CLI SKILL (required)
npx skills add "$(npm root -g)/@gitlink-ai/cli/skills" -y -g
```
**Step 2 — Configure**

View File

@ -1,6 +1,6 @@
{
"name": "@gitlink-ai/cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "GitLink 平台官方命令行工具 — 代码托管、协作开发和自动化",
"bin": {
"gitlink-cli": "bin/cli.js"
@ -33,6 +33,7 @@
"files": [
"bin/",
"scripts/",
"skills/",
"README.md"
],
"engines": {

View File

@ -58,8 +58,10 @@ ls -lh "$DIST_DIR"/*.tar.gz
echo ""
echo "=== Packaging npm ==="
# Copy README to npm dir
# Copy README and skills to npm dir
cp "$PROJECT_DIR/README.md" "$NPM_DIR/README.md"
rm -rf "$NPM_DIR/skills"
cp -r "$PROJECT_DIR/skills" "$NPM_DIR/skills"
# Ensure bin dir exists and wrapper is executable
chmod +x "$NPM_DIR/bin/gitlink-cli"

View File

@ -22,6 +22,10 @@ CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$NPM_DIR/bin/${BINARY}" .
chmod +x "$NPM_DIR/bin/${BINARY}"
cp "$PROJECT_DIR/README.md" "$NPM_DIR/README.md"
# Copy skills directory
rm -rf "$NPM_DIR/skills"
cp -r "$PROJECT_DIR/skills" "$NPM_DIR/skills"
echo "Binary size: $(du -h "$NPM_DIR/bin/${BINARY}" | cut -f1)"
echo ""