@ikyyofc/gemini-cli 3.0.3 → 3.0.4

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.
Files changed (3) hide show
  1. package/index.js +6 -3
  2. package/package.json +1 -1
  3. package/src/skills.js +40 -25
package/index.js CHANGED
@@ -279,12 +279,15 @@ async function handleCommand(input) {
279
279
  try {
280
280
  const { output } = await installSkill(source, { global: isGlobal, skill: skillName, all });
281
281
  sp.stop();
282
- // Print npx output
283
282
  if (output) output.split("\n").filter(Boolean).forEach(l => printInfo(l));
284
283
  printSuccess("skill installed — active on next message");
285
284
  } catch (e) {
286
- sp.fail(e.message.split("\n")[0]);
287
- printError(e.message.split("\n")[0]);
285
+ sp.stop();
286
+ // Print full npx output so user sees what actually went wrong
287
+ e.message.split("\n").filter(Boolean).forEach(l =>
288
+ process.stdout.write(chalk.hex("#7A7A9A")(" " + l + "\n"))
289
+ );
290
+ printError("install failed");
288
291
  }
289
292
  break;
290
293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikyyofc/gemini-cli",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "AI Agent CLI — native function calling · GEMINI.md context · extensions",
5
5
  "type": "module",
6
6
  "bin": { "gemini": "./index.js" },
package/src/skills.js CHANGED
@@ -28,37 +28,52 @@ export function ensureSkillsDirs() {
28
28
  // ─────────────────────────────────────────────────────────────────
29
29
  async function npxSkills(args, cwd = process.cwd(), timeout = 120_000) {
30
30
  const cmd = `npx --yes skills ${args}`;
31
- const { stdout, stderr } = await execAsync(cmd, {
32
- cwd,
33
- timeout,
34
- env: {
35
- ...process.env,
36
- // Disable telemetry analytics
37
- DISABLE_TELEMETRY: "1",
38
- // Force non-interactive / no color for parsing
39
- NO_COLOR: "1",
40
- CI: "1",
41
- },
42
- });
43
- return { stdout: stdout.trim(), stderr: stderr.trim() };
31
+ try {
32
+ const { stdout, stderr } = await execAsync(cmd, {
33
+ cwd,
34
+ timeout,
35
+ env: { ...process.env, NO_COLOR: "1", CI: "1" },
36
+ });
37
+ return { stdout: stdout.trim(), stderr: stderr.trim() };
38
+ } catch (err) {
39
+ // Expose actual npx output in the thrown error message
40
+ const detail = [err.stdout?.trim(), err.stderr?.trim()]
41
+ .filter(Boolean).join("\n") || err.message;
42
+ throw new Error(detail);
43
+ }
44
44
  }
45
45
 
46
46
  // ─────────────────────────────────────────────────────────────────
47
- // Install — npx skills add <source> -a gemini -y [--global]
47
+ // Parse source: handles "owner/repo@skill-name" shorthand
48
+ // e.g. "anthropics/skills@frontend-design"
49
+ // → source="anthropics/skills", skill="frontend-design"
48
50
  // ─────────────────────────────────────────────────────────────────
49
- export async function installSkill(source, opts = {}) {
50
- const {
51
- global = false,
52
- skill = null, // specific skill name (--skill flag)
53
- all = false, // install all skills from repo
54
- } = opts;
51
+ function parseSource(raw) {
52
+ const atIdx = raw.indexOf("@");
53
+ if (atIdx > 0 && !raw.startsWith("http") && !raw.startsWith("git@")) {
54
+ return {
55
+ source: raw.slice(0, atIdx),
56
+ skill: raw.slice(atIdx + 1),
57
+ };
58
+ }
59
+ return { source: raw, skill: null };
60
+ }
55
61
 
56
- let args = `add ${source} -a gemini -y --copy`;
57
- if (global) args += " -g";
58
- if (skill) args += ` --skill "${skill}"`;
59
- if (all) args += " --skill '*'";
62
+ // ─────────────────────────────────────────────────────────────────
63
+ // Install npx skills add <source> [-y] [--global] [--skill name]
64
+ // ─────────────────────────────────────────────────────────────────
65
+ export async function installSkill(rawSource, opts = {}) {
66
+ const { global = false, skill: explicitSkill = null, all = false } = opts;
67
+ const { source, skill: parsedSkill } = parseSource(rawSource);
68
+ const skillName = explicitSkill ?? parsedSkill;
60
69
 
61
- const { stdout, stderr } = await npxSkills(args);
70
+ // Build args let npx skills auto-detect agent (more reliable than -a gemini)
71
+ const parts = ["add", source, "-y"];
72
+ if (global) parts.push("-g");
73
+ if (skillName) parts.push(`--skill "${skillName}"`);
74
+ if (all) parts.push("--skill '*'");
75
+
76
+ const { stdout, stderr } = await npxSkills(parts.join(" "));
62
77
  return { output: stdout || stderr };
63
78
  }
64
79