From 3b90f8d050c407ef2aefedf82f61471374c0f0a8 Mon Sep 17 00:00:00 2001 From: c-99-e <268417377+c-99-e@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:15:01 +0400 Subject: [PATCH 1/4] feat: add extension to resolve shopq from local .pi/npm bin - Add extensions/shopq-path.ts that uses a bash spawn hook to prepend .pi/npm/node_modules/.bin to PATH, so shopq resolves without a global install - Register extensions dir in pi manifest and files array - Remove global install instruction from SKILL.md - Add @mariozechner/pi-coding-agent as peer dependency - Bump version to 0.4.0 --- extensions/shopq-path.ts | 29 +++++++++++++++++++++++++++++ package.json | 7 ++++++- skills/shopq/SKILL.md | 6 +----- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 extensions/shopq-path.ts diff --git a/extensions/shopq-path.ts b/extensions/shopq-path.ts new file mode 100644 index 0000000..79d4d26 --- /dev/null +++ b/extensions/shopq-path.ts @@ -0,0 +1,29 @@ +/** + * Adds .pi/npm/node_modules/.bin to the bash tool's PATH so that + * `shopq` (and any other pi-installed CLI) resolves without a global install. + */ + +import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; +import { createBashTool } from "@mariozechner/pi-coding-agent"; + +export default function (pi: ExtensionAPI) { + const cwd = process.cwd(); + + const bashTool = createBashTool(cwd, { + spawnHook: ({ command, cwd: spawnCwd, env }) => ({ + command, + cwd: spawnCwd, + env: { + ...env, + PATH: `${cwd}/.pi/npm/node_modules/.bin:${env.PATH ?? ""}`, + }, + }), + }); + + pi.registerTool({ + ...bashTool, + execute: async (id, params, signal, onUpdate) => { + return bashTool.execute(id, params, signal, onUpdate); + }, + }); +} diff --git a/package.json b/package.json index 92fe59c..241244e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shopq", - "version": "0.3.9", + "version": "0.4.0", "description": "A zero-dependency Shopify Admin CLI built on Bun", "type": "module", "license": "MIT", @@ -9,6 +9,7 @@ }, "files": [ "dist", + "extensions", "skills" ], "scripts": { @@ -35,6 +36,9 @@ "pi-package" ], "pi": { + "extensions": [ + "./extensions" + ], "skills": [ "./skills" ] @@ -47,6 +51,7 @@ "@types/bun": "latest" }, "peerDependencies": { + "@mariozechner/pi-coding-agent": "*", "typescript": "^5.9.3" } } diff --git a/skills/shopq/SKILL.md b/skills/shopq/SKILL.md index 29a7cb6..84bf144 100644 --- a/skills/shopq/SKILL.md +++ b/skills/shopq/SKILL.md @@ -9,11 +9,7 @@ A zero-dependency Shopify Admin CLI. Structured JSON output, predictable exit co ## Setup -Install globally: - -```bash -bun install -g shopq -``` +shopq is available locally via pi — no global install needed. Configure credentials (one of): From 8bcecef3fc5964978a55238dc125a19f5cd562ff Mon Sep 17 00:00:00 2001 From: c-99-e <268417377+c-99-e@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:16:40 +0400 Subject: [PATCH 2/4] fix: mark pi-coding-agent peer dep as optional Prevents npm warning when installing shopq globally as a standalone CLI without pi present. --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index 241244e..32b7443 100644 --- a/package.json +++ b/package.json @@ -53,5 +53,10 @@ "peerDependencies": { "@mariozechner/pi-coding-agent": "*", "typescript": "^5.9.3" + }, + "peerDependenciesMeta": { + "@mariozechner/pi-coding-agent": { + "optional": true + } } } From eca3255825d819d73254e6326dc67c78bcaa5c88 Mon Sep 17 00:00:00 2001 From: c-99-e <268417377+c-99-e@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:20:52 +0400 Subject: [PATCH 3/4] fix: keep global install as fallback in SKILL.md, remove explicit extensions from pi manifest - SKILL.md now instructs the agent to suggest global install if shopq is not on PATH (supports non-pi CLIs) - Remove extensions from pi manifest since pi auto-discovers from the extensions/ convention directory --- package.json | 3 --- skills/shopq/SKILL.md | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 32b7443..ec3e38e 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,6 @@ "pi-package" ], "pi": { - "extensions": [ - "./extensions" - ], "skills": [ "./skills" ] diff --git a/skills/shopq/SKILL.md b/skills/shopq/SKILL.md index 84bf144..4e905d2 100644 --- a/skills/shopq/SKILL.md +++ b/skills/shopq/SKILL.md @@ -9,7 +9,11 @@ A zero-dependency Shopify Admin CLI. Structured JSON output, predictable exit co ## Setup -shopq is available locally via pi — no global install needed. +If `shopq` is not found on PATH, it may not be installed globally. Let the user know they can install it with: + +```bash +bun install -g shopq +``` Configure credentials (one of): From 9b4b6ede7840faa2d7b7a2ebb656cd03c750ba46 Mon Sep 17 00:00:00 2001 From: c-99-e <268417377+c-99-e@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:21:29 +0400 Subject: [PATCH 4/4] fix: restore explicit extensions key, use generic pm in SKILL.md --- package.json | 3 +++ skills/shopq/SKILL.md | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ec3e38e..32b7443 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,9 @@ "pi-package" ], "pi": { + "extensions": [ + "./extensions" + ], "skills": [ "./skills" ] diff --git a/skills/shopq/SKILL.md b/skills/shopq/SKILL.md index 4e905d2..1e72284 100644 --- a/skills/shopq/SKILL.md +++ b/skills/shopq/SKILL.md @@ -9,11 +9,7 @@ A zero-dependency Shopify Admin CLI. Structured JSON output, predictable exit co ## Setup -If `shopq` is not found on PATH, it may not be installed globally. Let the user know they can install it with: - -```bash -bun install -g shopq -``` +If `shopq` is not found on PATH, it may not be installed globally. Let the user know they can install it with their package manager (e.g. `npm install -g shopq`, `bun install -g shopq`, etc.). Configure credentials (one of):