Skip to content

Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.

Pin the skill installer and install the bundled skill

andrew18210df3e535
diff --git a/README.md b/README.md
index f6be6ad..4a563c8 100644
--- a/README.md
+++ b/README.md
@@ -48,15 +48,12 @@ It leaves research and implementation decisions to the calling agent. The curren
checks for `jg` and installs the CLI if it is missing; authentication still needs
your selected provider’s key. The skill installer itself does not configure credentials.
-`jg skill` delegates to the [skills CLI](https://github.com/vercel-labs/skills)
-and needs npm/npx plus network access. You can also run that installer directly,
-without the CLI installed:
-
-```sh
-npx skills add dzhng/jevgrep --skill jevgrep
-```
-
-In 0.1.0, `jg skill` only prints the bundled skill; use `npx skills` with that version.
+`jg skill` installs the skill bundled with this release using a pinned
+[skills CLI](https://github.com/vercel-labs/skills), with npm lifecycle scripts
+disabled. Skill installation needs Node 22.20+ and npm/npx plus network access
+for the installer; it does not fetch skill instructions from GitHub. Use `jg skill`
+so the installed instructions match your CLI release. Users of 0.1.0, whose
+`jg skill` only prints the skill, should upgrade the CLI first.
### Upgrade
@@ -67,7 +64,7 @@ npm install -g @dzhng/jevgrep@latest
jg --version
```
-Update the installed skill separately by rerunning `jg skill`. Updating the npm package does not
+After updating the CLI, refresh the installed skill by rerunning `jg skill`. Updating the npm package does not
overwrite skill files in your projects. See the [package guide](apps/cli/README.md)
for authentication details.
diff --git a/apps/cli/README.md b/apps/cli/README.md
index 3f626a2..5ed82a4 100644
--- a/apps/cli/README.md
+++ b/apps/cli/README.md
@@ -69,17 +69,11 @@ The installer detects your coding agents (Claude Code, Codex, OpenCode and
others) and asks where to install. `jg skill` also accepts `--agent NAME`
(repeatable), `--global`, and `--yes`; these options come from the
[skills CLI](https://github.com/vercel-labs/skills#install-a-skill), which it
-delegates to, so it requires npm/npx and network access. You can run that
-installer directly as well:
+delegates to. Use `jg skill` so the installed instructions match your CLI release;
+it requires Node 22.20+ and npm/npx with network access for the pinned installer.
-```sh
-npx skills add dzhng/jevgrep --skill jevgrep
-```
-
-Installing the skill does not install the `jg` executable or configure its key.
-The current repository skill installs a missing CLI when the agent first uses it;
-0.1.0's bundled skill predates that setup step, and its `jg skill` only prints
-text, so use `npx skills` directly with that version.
+Installing the skill does not configure the provider key. Users of 0.1.0, whose
+`jg skill` only prints the skill, should upgrade the CLI first.
Search does not install skills or edit agent configuration. Only an explicit
skill installation command invokes the installer. The skill directs the agent
@@ -92,3 +86,8 @@ the agent's copy too.
See the [repository](https://github.com/dzhng/jevgrep) for architecture, official
benchmark evidence and development. Jevgrep is MIT licensed.
+
+Skill installation uses a pinned installer and the skill bundled with the CLI,
+with npm lifecycle scripts disabled. It requires Node 22.20+ and network access
+for the installer. After updating the CLI, rerun `jg skill` to refresh the agent's
+copy. Installer transitive dependencies remain an external trust boundary.
diff --git a/apps/cli/src/args.ts b/apps/cli/src/args.ts
index 1934c0e..86914a3 100644
--- a/apps/cli/src/args.ts
+++ b/apps/cli/src/args.ts
@@ -141,8 +141,8 @@ Skill installation options:
--global Install for the current user instead of this project
--yes Skip installer confirmation prompts
-Skill installation requires npm/npx and network access. Without options,
-the skills installer prompts for agents and installation settings.
+Skill installation requires Node 22.20+ ([email protected]), npm/npx, and network access.
+Without options, the installer prompts for agents and installation settings.
Search options:
--max-source-bytes N Source allocation; 0 means unlimited (default: ${DEFAULT_MAX_SOURCE_BYTES})
diff --git a/apps/cli/src/skill.ts b/apps/cli/src/skill.ts
index d970ce0..c9f35f0 100644
--- a/apps/cli/src/skill.ts
+++ b/apps/cli/src/skill.ts
@@ -1,12 +1,24 @@
+import { fileURLToPath } from "node:url";
import { spawn } from "node:child_process";
import type { Command } from "./args";
import { CliError } from "./errors";
+declare const JEVGREP_BUNDLED: boolean;
+
export async function installSkill(
command: Extract<Command, { kind: "skill" }>,
signal: AbortSignal,
): Promise<number> {
- const args = ["--yes", "skills", "add", "dzhng/jevgrep", "--skill", "jevgrep"];
+ const [major, minor] = process.versions.node.split(".").map(Number);
+ if (major! < 22 || (major === 22 && minor! < 20))
+ throw new CliError("jg skill requires Node 22.20 or newer ([email protected]).");
+ const source = fileURLToPath(
+ new URL(
+ typeof JEVGREP_BUNDLED !== "undefined" ? "../skills/jevgrep" : "../../../skills/jevgrep",
+ import.meta.url,
+ ),
+ );
+ const args = ["--yes", "--ignore-scripts", "[email protected]", "add", source, "--skill", "jevgrep"];
for (const agent of command.agents) args.push("--agent", agent);
if (command.global) args.push("--global");
if (command.yes) args.push("--yes");
diff --git a/apps/cli/test/skill.test.ts b/apps/cli/test/skill.test.ts
new file mode 100644
index 0000000..e2469fa
--- /dev/null
+++ b/apps/cli/test/skill.test.ts
@@ -0,0 +1,26 @@
+import { expect, test } from "bun:test";
+import { installSkill } from "../src/skill";
+
+test("skill installation rejects unsupported Node versions before launching npx", async () => {
+ // This process-global override must remain in a non-concurrent test.
+ const descriptor = Object.getOwnPropertyDescriptor(process.versions, "node")!;
+ const controller = new AbortController();
+ const aborted = new Error("supported runtime reached installer boundary");
+ controller.abort(aborted);
+ try {
+ for (const version of ["20.20.0", "22.0.0", "22.19.9"]) {
+ Object.defineProperty(process.versions, "node", { ...descriptor, value: version });
+ await expect(
+ installSkill({ kind: "skill", agents: [], global: false, yes: false }, controller.signal),
+ ).rejects.toThrow("jg skill requires Node 22.20 or newer");
+ }
+ for (const version of ["22.20.0", "22.23.3", "23.0.0", "24.0.0"]) {
+ Object.defineProperty(process.versions, "node", { ...descriptor, value: version });
+ await expect(
+ installSkill({ kind: "skill", agents: [], global: false, yes: false }, controller.signal),
+ ).rejects.toBe(aborted);
+ }
+ } finally {
+ Object.defineProperty(process.versions, "node", descriptor);
+ }
+});
diff --git a/scripts/build-cli.ts b/scripts/build-cli.ts
index 4ced079..0021b50 100644
--- a/scripts/build-cli.ts
+++ b/scripts/build-cli.ts
@@ -13,6 +13,7 @@ const build = await Bun.build({
entrypoints: [join(root, "apps/cli/src/index.ts")],
outdir: join(out, "bin"),
target: "node",
+ define: { JEVGREP_BUNDLED: "true" },
format: "esm",
metafile: true,
external: ["pyodide", "typescript"],
diff --git a/test/installed.test.mjs b/test/installed.test.mjs
index e698778..55bc325 100644
--- a/test/installed.test.mjs
+++ b/test/installed.test.mjs
@@ -435,9 +435,10 @@ test("skill command delegates installation to npx without credentials", async (t
assert.match(result.stdout, /Installer completed/);
assert.deepEqual(JSON.parse(await readFile(join(fixture.tree, "installed-skill.json"), "utf8")), [
"--yes",
- "skills",
+ "--ignore-scripts",
"add",
- "dzhng/jevgrep",
+ join(packageDirectory, "dist/skills/jevgrep"),
"--skill",
"jevgrep",
"--agent",
@@ -455,9 +456,10 @@ test("skill command delegates installation to npx without credentials", async (t
assert.equal(failed.code, 7, failed.stdout);
assert.deepEqual(JSON.parse(await readFile(join(fixture.tree, "installed-skill.json"), "utf8")), [
"--yes",
- "skills",
+ "--ignore-scripts",
"add",
- "dzhng/jevgrep",
+ join(packageDirectory, "dist/skills/jevgrep"),
"--skill",
"jevgrep",
]);