From 3c2e8f0580aa776f408f434eca93497ef0f12ffa Mon Sep 17 00:00:00 2001 From: Your GitHub Username Date: Thu, 2 Apr 2026 23:06:06 +0800 Subject: [PATCH] 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 --- .gitignore | 1 + README.md | 11 +++++++++++ npm/package.json | 3 ++- scripts/build-npm.sh | 4 +++- scripts/pack-local.sh | 4 ++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1d0eabe..8a66a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ vendor/ npm/bin/gitlink-cli npm/*.tgz npm/README.md +npm/skills/ dist/ diff --git a/README.md b/README.md index 6c428f9..dc09978 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/npm/package.json b/npm/package.json index c588572..8e153df 100644 --- a/npm/package.json +++ b/npm/package.json @@ -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": { diff --git a/scripts/build-npm.sh b/scripts/build-npm.sh index e7a7266..a516b78 100755 --- a/scripts/build-npm.sh +++ b/scripts/build-npm.sh @@ -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" diff --git a/scripts/pack-local.sh b/scripts/pack-local.sh index 80febff..58c34c0 100755 --- a/scripts/pack-local.sh +++ b/scripts/pack-local.sh @@ -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 ""