gitea-cli-skill 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets/SKILL.md CHANGED
@@ -83,8 +83,10 @@ Destructive ops: always `list`/`get` first, then `--force`. Deleted resources ca
83
83
 
84
84
  ## On-Demand Reference
85
85
 
86
- For full command flags and detailed workflow steps, read the reference file:
86
+ For full command flags and detailed workflow steps, read:
87
87
 
88
88
  ```
89
- ~/.claude/skills/gitea-cli/REFERENCE.md
89
+ references/command-reference.md
90
90
  ```
91
+
92
+ Located in the same skill directory as this file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitea-cli-skill",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Install gitea-cli as a Claude Code skill",
5
5
  "bin": {
6
6
  "gitea-cli-skill": "src/index.js"
package/src/index.js CHANGED
@@ -12,6 +12,7 @@ const GITEA_HOST = 'https://x.xgit.pro';
12
12
  const GITEA_OWNER = 'chenqi';
13
13
  const GITEA_REPO = 'git-cli';
14
14
  const SKILL_NAME = 'gitea-cli';
15
+ const PKG_VERSION = require(path.resolve(__dirname, '..', 'package.json')).version;
15
16
 
16
17
  // ── Platform definitions ────────────────────────────────────────────────────
17
18
 
@@ -158,6 +159,23 @@ function configureContext({ giteaCliBin, host, token, contextName, defaultOwner,
158
159
  execSync(cmdArgs.join(' '), { stdio: 'inherit', timeout: 10000 });
159
160
  }
160
161
 
162
+ // ── Version consistency check ────────────────────────────────────────────────
163
+
164
+ function checkVersionConsistency(binaryPath) {
165
+ if (!fs.existsSync(binaryPath)) return;
166
+ try {
167
+ const raw = execSync(`"${binaryPath}" --version`, { encoding: 'utf-8', timeout: 5000 }).trim();
168
+ // Parse version from output like "gitea-cli version 0.3.0" or just "0.3.0"
169
+ const match = raw.match(/(\d+\.\d+\.\d+)/);
170
+ if (!match) return;
171
+ const binVersion = match[1];
172
+ if (binVersion !== PKG_VERSION) {
173
+ console.warn(` ⚠ Version mismatch: npm=${PKG_VERSION}, binary=${binVersion}`);
174
+ console.warn(' Run `npx gitea-cli-skill@latest update` to sync.');
175
+ }
176
+ } catch { /* non-blocking */ }
177
+ }
178
+
161
179
  // ── Install command ─────────────────────────────────────────────────────────
162
180
 
163
181
  async function install(args) {
@@ -170,18 +188,26 @@ async function install(args) {
170
188
 
171
189
  console.log(`Installing gitea-cli skill (${osArch.os}-${osArch.arch}) to ${skillDir}...`);
172
190
 
173
- // 1. Copy SKILL.md and REFERENCE.md
191
+ // 1. Copy SKILL.md and references/
174
192
  fs.mkdirSync(skillDir, { recursive: true });
175
193
  const srcSkill = path.resolve(__dirname, '..', 'assets', 'SKILL.md');
176
194
  const destSkill = path.join(skillDir, 'SKILL.md');
177
195
  fs.copyFileSync(srcSkill, destSkill);
178
196
  console.log(` SKILL.md -> ${destSkill}`);
179
197
 
180
- const srcRef = path.resolve(__dirname, '..', 'assets', 'REFERENCE.md');
181
- const destRef = path.join(skillDir, 'REFERENCE.md');
198
+ const srcRef = path.resolve(__dirname, '..', 'assets', 'references', 'command-reference.md');
199
+ const destRef = path.join(skillDir, 'references', 'command-reference.md');
182
200
  if (fs.existsSync(srcRef)) {
201
+ fs.mkdirSync(path.dirname(destRef), { recursive: true });
183
202
  fs.copyFileSync(srcRef, destRef);
184
- console.log(` REFERENCE.md -> ${destRef}`);
203
+ console.log(` references/command-reference.md -> ${destRef}`);
204
+ }
205
+
206
+ // Cleanup: remove legacy REFERENCE.md from old location
207
+ const legacyRef = path.join(skillDir, 'REFERENCE.md');
208
+ if (fs.existsSync(legacyRef)) {
209
+ fs.unlinkSync(legacyRef);
210
+ console.log(' Removed legacy REFERENCE.md');
185
211
  }
186
212
 
187
213
  // 2. Check existing binary
@@ -214,6 +240,9 @@ async function install(args) {
214
240
  }
215
241
  }
216
242
 
243
+ // 4. Version consistency check
244
+ checkVersionConsistency(destBinary);
245
+
217
246
  console.log(`\nDone!`);
218
247
  }
219
248
 
@@ -342,7 +371,7 @@ async function update(args) {
342
371
 
343
372
  console.log(`Updating gitea-cli skill (${osArch.os}-${osArch.arch}) at ${skillDir}...`);
344
373
 
345
- // 1. Refresh SKILL.md and REFERENCE.md
374
+ // 1. Refresh SKILL.md and references/
346
375
  const srcSkill = path.resolve(__dirname, '..', 'assets', 'SKILL.md');
347
376
  const destSkill = path.join(skillDir, 'SKILL.md');
348
377
  if (fs.existsSync(srcSkill)) {
@@ -351,11 +380,19 @@ async function update(args) {
351
380
  console.log(` SKILL.md -> ${destSkill}`);
352
381
  }
353
382
 
354
- const srcRef = path.resolve(__dirname, '..', 'assets', 'REFERENCE.md');
355
- const destRef = path.join(skillDir, 'REFERENCE.md');
383
+ const srcRef = path.resolve(__dirname, '..', 'assets', 'references', 'command-reference.md');
384
+ const destRef = path.join(skillDir, 'references', 'command-reference.md');
356
385
  if (fs.existsSync(srcRef)) {
386
+ fs.mkdirSync(path.dirname(destRef), { recursive: true });
357
387
  fs.copyFileSync(srcRef, destRef);
358
- console.log(` REFERENCE.md -> ${destRef}`);
388
+ console.log(` references/command-reference.md -> ${destRef}`);
389
+ }
390
+
391
+ // Cleanup: remove legacy REFERENCE.md from old location
392
+ const legacyRef = path.join(skillDir, 'REFERENCE.md');
393
+ if (fs.existsSync(legacyRef)) {
394
+ fs.unlinkSync(legacyRef);
395
+ console.log(' Removed legacy REFERENCE.md');
359
396
  }
360
397
 
361
398
  // 2. Re-download / re-copy binary (always overwrite)
@@ -369,6 +406,9 @@ async function update(args) {
369
406
  await installFromRelease(giteaHost, token, scriptsDir, destBinary, osArch);
370
407
  }
371
408
 
409
+ // 3. Version consistency check
410
+ checkVersionConsistency(destBinary);
411
+
372
412
  console.log('\nDone! Configuration preserved.');
373
413
  }
374
414
 
@@ -409,7 +449,7 @@ Usage:
409
449
 
410
450
  Commands:
411
451
  init Install skill (binary + SKILL.md) and optionally configure context
412
- update Refresh binary and SKILL.md/REFERENCE.md (keeps config)
452
+ update Refresh binary and SKILL.md/references/ (keeps config)
413
453
  add context Add or update a Gitea API context (requires --token)
414
454
 
415
455
  Flags (init):