@mvanhorn/printing-press-library 0.1.6

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 (44) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +21 -0
  3. package/README.md +83 -0
  4. package/bin/printing-press-library.mjs +8 -0
  5. package/dist/src/bundles.d.ts +2 -0
  6. package/dist/src/bundles.js +13 -0
  7. package/dist/src/bundles.js.map +1 -0
  8. package/dist/src/cli.d.ts +2 -0
  9. package/dist/src/cli.js +91 -0
  10. package/dist/src/cli.js.map +1 -0
  11. package/dist/src/commands/install.d.ts +18 -0
  12. package/dist/src/commands/install.js +272 -0
  13. package/dist/src/commands/install.js.map +1 -0
  14. package/dist/src/commands/list.d.ts +12 -0
  15. package/dist/src/commands/list.js +109 -0
  16. package/dist/src/commands/list.js.map +1 -0
  17. package/dist/src/commands/search.d.ts +10 -0
  18. package/dist/src/commands/search.js +85 -0
  19. package/dist/src/commands/search.js.map +1 -0
  20. package/dist/src/commands/uninstall.d.ts +13 -0
  21. package/dist/src/commands/uninstall.js +101 -0
  22. package/dist/src/commands/uninstall.js.map +1 -0
  23. package/dist/src/commands/update.d.ts +11 -0
  24. package/dist/src/commands/update.js +80 -0
  25. package/dist/src/commands/update.js.map +1 -0
  26. package/dist/src/constants.d.ts +1 -0
  27. package/dist/src/constants.js +2 -0
  28. package/dist/src/constants.js.map +1 -0
  29. package/dist/src/format.d.ts +9 -0
  30. package/dist/src/format.js +44 -0
  31. package/dist/src/format.js.map +1 -0
  32. package/dist/src/go.d.ts +26 -0
  33. package/dist/src/go.js +44 -0
  34. package/dist/src/go.js.map +1 -0
  35. package/dist/src/process.d.ts +11 -0
  36. package/dist/src/process.js +27 -0
  37. package/dist/src/process.js.map +1 -0
  38. package/dist/src/registry.d.ts +44 -0
  39. package/dist/src/registry.js +194 -0
  40. package/dist/src/registry.js.map +1 -0
  41. package/dist/src/skill.d.ts +10 -0
  42. package/dist/src/skill.js +28 -0
  43. package/dist/src/skill.js.map +1 -0
  44. package/package.json +57 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ ## 0.1.6
4
+
5
+ - Rename the npm package and command to `@mvanhorn/printing-press-library` / `printing-press-library` so the public catalog installer is unambiguous and does not collide with the Printing Press generator concept.
6
+ - Make `printing-press-library list` a public catalog discovery command by default, showing every available CLI with its category, binary name, and description. The previous installed-only view remains available as `printing-press-library list --installed`.
7
+ - Add `printing-press-library list --category <category>` for quick category browsing.
8
+
9
+ ## 0.1.5
10
+
11
+ - Survive malformed upstream registry entries instead of aborting the whole parse. `parseRegistry` now skips entries that fail per-entry validation, writes a one-line warning to stderr naming the offending slug + field, and returns the rest of the catalog intact. Registry-level shape failures (wrong `schema_version`, non-array `entries`) still throw. This is the defense-in-depth pair for the library-side `--validate` gate (see `tools/generate-registry --validate` and `verify-library-conventions.yml`) so a single broken upstream entry — lawhub-shape — can never wedge every `install` / `search` / `list` / `update` call again.
12
+ - Detect and warn when an older binary earlier in `PATH` shadows the one `go install` just wrote. Previously `install` reported the first PATH hit as success, so a stale `/opt/homebrew/bin/<cli>` (for example) would mask a newer `~/go/bin/<cli>`. The installer now reads `go env GOBIN GOPATH`, compares the actual install path to what `which`/`where` returns, and emits a clear shadow warning when they differ. JSON output adds `installedPath` and `shadowedBy` fields. Fixes #470.
13
+
14
+ ## 0.1.4
15
+
16
+ - Drop the `GOPRIVATE='github.com/mvanhorn/*' GOFLAGS=-mod=mod … @main` fallback from the `install` command. The library is fully public, so `go install …@latest` resolves through the public Go module proxy without any private-module configuration. The `@main` retry was only useful when paired with `GOPRIVATE` to bypass the proxy entirely; without it, `@main` issues an identical query subject to the same proxy cache and adds no value.
17
+
18
+ ## 0.1.3
19
+
20
+ - Drop the `auth env vars: …` line from `install` output. The data was a bare list of env var names without the surrounding context (where to get the token, how to set it, what command verifies it) — that context lives in each CLI's `--help`, `doctor` command, and authenticated-error messages, which is the natural moment to discover auth requirements. JSON output no longer carries `authEnvVars` either; consumers that genuinely need a structured env-var list can read `mcp.env_vars` directly from `registry.json`.
21
+
22
+ ## 0.1.2
23
+
24
+ - CI fix: pin the npm version used for Trusted Publishing to `npm@11.5.1`. The previous `npm install -g npm@latest` step is flaky on Actions runners — npm overwrites itself mid-install and the global install ends up with a missing `promise-retry` module. v0.1.1 was tagged but never reached npmjs.com because of this; this is the first published release on the OIDC pipeline.
25
+
26
+ ## 0.1.1
27
+
28
+ - Rename binary from `pp` to `printing-press`. The previous two-letter name overlapped with our `pp-*` skill namespace, our `*-pp-cli` binary convention, and Perl's `pp` (PAR::Packer).
29
+ - Add bundles: `printing-press install starter-pack` installs `espn`, `flight-goat`, `movie-goat`, and `recipe-goat` together.
30
+ - Multi-name install: pass several names in one command, e.g. `printing-press install espn linear dub`. Bundle names and CLI names can mix freely.
31
+ - Add `--cli-only` and `--skill-only` flags so you can install just the Go binary (e.g. on a CI machine with no agent) or just the focused skill (relying on lazy binary install via the skill's prose). Mutually exclusive; both work with bundles.
32
+ - Switch the publish workflow to npm Trusted Publishing (OIDC). No long-lived `NPM_TOKEN` in repo secrets; releases mint short-lived tokens per workflow run and emit verifiable provenance attestations.
33
+ - Declare MIT license, repository, homepage, bugs URL, author/contributors, keywords, and `publishConfig` for npm discoverability.
34
+
35
+ ## 0.1.0
36
+
37
+ - Initial scaffold for `@mvanhorn/printing-press`.
38
+ - Add `pp install`, `pp update`, `pp list`, `pp search`, and `pp uninstall`.
39
+ - Install per-CLI skills from `cli-skills/pp-<name>` via `skills@latest`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Van Horn, Trevin Chow
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # @mvanhorn/printing-press-library
2
+
3
+ Installer and catalog CLI for [Printing Press](https://printingpress.dev)-generated CLIs. Each install pulls down a Go binary plus its focused agent skill — the skill lands in every supported agent on your machine (Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, and other agents the upstream [`skills`](https://github.com/vercel-labs/skills) CLI detects).
4
+
5
+ This package replaces the older `@mvanhorn/printing-press` npm package. Use the unambiguous `printing-press-library` command for catalog discovery and installs.
6
+
7
+ ## Quick start
8
+
9
+ The fastest way in is the starter pack — four hand-picked CLIs and skills installed in one command:
10
+
11
+ ```bash
12
+ npx -y @mvanhorn/printing-press-library install starter-pack
13
+ ```
14
+
15
+ The starter pack installs `espn` (live sports), `flight-goat` (flight search), `movie-goat` (movie discovery), and `recipe-goat` (recipe ranking).
16
+
17
+ ## Installing CLIs and skills
18
+
19
+ Every install pulls down the Go binary **and** the focused skill in one shot. Use `--cli-only` or `--skill-only` (see [Options](#options)) if you want just one half.
20
+
21
+ One tool:
22
+
23
+ ```bash
24
+ npx -y @mvanhorn/printing-press-library install espn
25
+ ```
26
+
27
+ Several at once (bundles and CLI names mix freely):
28
+
29
+ ```bash
30
+ npx -y @mvanhorn/printing-press-library install espn sentry dub
31
+ npx -y @mvanhorn/printing-press-library install starter-pack cal-com
32
+ ```
33
+
34
+ Under the hood: the installer reads the live catalog at [`registry.json`](https://github.com/mvanhorn/printing-press-library/blob/main/registry.json), resolves the CLI's Go module path, runs `go install`, and installs the matching focused skill from `cli-skills/pp-<name>` via `npx skills@latest`.
35
+
36
+ ## Other commands
37
+
38
+ ```bash
39
+ npx -y @mvanhorn/printing-press-library list
40
+ npx -y @mvanhorn/printing-press-library search sports
41
+ npx -y @mvanhorn/printing-press-library list --category travel
42
+ npx -y @mvanhorn/printing-press-library list --installed
43
+ npx -y @mvanhorn/printing-press-library update espn
44
+ npx -y @mvanhorn/printing-press-library uninstall espn --yes
45
+ ```
46
+
47
+ ## Options
48
+
49
+ ```bash
50
+ # Install only the Go binary, skip the focused skill
51
+ npx -y @mvanhorn/printing-press-library install espn --cli-only
52
+
53
+ # Install only the focused skill, skip the Go binary
54
+ # (binary will lazy-install on first agent invocation via the skill's instructions)
55
+ npx -y @mvanhorn/printing-press-library install espn --skill-only
56
+
57
+ # Constrain skill installation to a specific agent (repeatable)
58
+ npx -y @mvanhorn/printing-press-library install espn --agent claude-code
59
+
60
+ # Machine-readable output
61
+ npx -y @mvanhorn/printing-press-library install espn --json
62
+
63
+ # Pin to an alternate catalog (mainly for testing)
64
+ npx -y @mvanhorn/printing-press-library search sports --registry-url https://example.com/registry.json
65
+ ```
66
+
67
+ `--cli-only` and `--skill-only` are mutually exclusive. They both work with bundles — `… install starter-pack --cli-only` installs four binaries with no skills, useful for CI machines that don't run Claude Code.
68
+
69
+ ## Bundles
70
+
71
+ | Name | Members |
72
+ |---|---|
73
+ | `starter-pack` | `espn`, `flight-goat`, `movie-goat`, `recipe-goat` |
74
+
75
+ More bundles will be added over time. To suggest one, open an issue at the [printing-press-library repo](https://github.com/mvanhorn/printing-press-library/issues).
76
+
77
+ ## Requirements
78
+
79
+ - Node.js 20+
80
+ - Go 1.26.3 or newer (for `go install`)
81
+ - `$(go env GOPATH)/bin` on `$PATH` (usually `$HOME/go/bin`) so installed CLIs are runnable
82
+
83
+ While the catalog repository is private, also set `GITHUB_TOKEN` or `GH_TOKEN` for catalog and skill fetches, and ensure Go can read private `github.com/mvanhorn/*` modules.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from "../dist/src/cli.js";
4
+
5
+ main(process.argv.slice(2)).catch((error) => {
6
+ console.error(error instanceof Error ? error.message : String(error));
7
+ process.exitCode = 1;
8
+ });
@@ -0,0 +1,2 @@
1
+ export declare const BUNDLES: Record<string, readonly string[]>;
2
+ export declare function isBundle(name: string): boolean;
@@ -0,0 +1,13 @@
1
+ // Curated multi-CLI bundles. Each value is the list of catalog `name`s the
2
+ // bundle expands to. `printing-press-library install <bundle>` resolves the bundle and
3
+ // installs each entry's binary + focused skill, in order.
4
+ //
5
+ // Bundle names must not collide with catalog `name`s. When adding a CLI to the
6
+ // catalog whose name matches a bundle key here, rename the bundle.
7
+ export const BUNDLES = {
8
+ "starter-pack": ["espn", "flight-goat", "movie-goat", "recipe-goat"],
9
+ };
10
+ export function isBundle(name) {
11
+ return Object.prototype.hasOwnProperty.call(BUNDLES, name);
12
+ }
13
+ //# sourceMappingURL=bundles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundles.js","sourceRoot":"","sources":["../../src/bundles.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,uFAAuF;AACvF,0DAA0D;AAC1D,EAAE;AACF,+EAA+E;AAC/E,mEAAmE;AAEnE,MAAM,CAAC,MAAM,OAAO,GAAsC;IACxD,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,CAAC;CACrE,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function main(args?: string[]): Promise<void>;
2
+ export declare function run(args: string[]): Promise<number>;
@@ -0,0 +1,91 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { installCommand } from "./commands/install.js";
5
+ import { listCommand } from "./commands/list.js";
6
+ import { searchCommand } from "./commands/search.js";
7
+ import { uninstallCommand } from "./commands/uninstall.js";
8
+ import { updateCommand } from "./commands/update.js";
9
+ const COMMANDS = {
10
+ install: installCommand,
11
+ update: updateCommand,
12
+ list: listCommand,
13
+ search: searchCommand,
14
+ uninstall: uninstallCommand,
15
+ };
16
+ export async function main(args = process.argv.slice(2)) {
17
+ const code = await run(args);
18
+ if (code !== 0) {
19
+ process.exitCode = code;
20
+ }
21
+ }
22
+ export async function run(args) {
23
+ const [command, ...rest] = args;
24
+ if (!command || command === "-h" || command === "--help") {
25
+ printHelp();
26
+ return 0;
27
+ }
28
+ if (command === "-v" || command === "--version") {
29
+ console.log(await packageVersion());
30
+ return 0;
31
+ }
32
+ const handler = COMMANDS[command];
33
+ if (!handler) {
34
+ console.error(`Unknown command: ${command}`);
35
+ printHelp();
36
+ return 1;
37
+ }
38
+ return handler(rest);
39
+ }
40
+ function printHelp() {
41
+ console.log(`Printing Press Library CLI installer
42
+
43
+ Usage:
44
+ printing-press-library <command> [options]
45
+
46
+ Commands:
47
+ install <name|bundle>... Install one or more Printing Press CLIs (and skills)
48
+ update [name] Refresh one installed CLI, or all installed CLIs
49
+ list List available Printing Press CLIs
50
+ search <query> Search the Printing Press catalog
51
+ uninstall <name> Remove a Printing Press CLI and skill
52
+
53
+ Bundles:
54
+ starter-pack espn, flight-goat, movie-goat, recipe-goat
55
+
56
+ Examples:
57
+ printing-press-library install starter-pack
58
+ printing-press-library install espn linear dub
59
+ printing-press-library install espn --cli-only
60
+ printing-press-library list
61
+ printing-press-library search sports
62
+ printing-press-library list --installed
63
+
64
+ Install options:
65
+ --cli-only Install only the Go binary (skip the focused skill)
66
+ --skill-only Install only the focused skill (skip the Go binary)
67
+ --agent <agent> Constrain skill install to a specific agent (repeatable)
68
+ --json Emit machine-readable output
69
+
70
+ Top-level options:
71
+ -h, --help Show help
72
+ -v, --version Show version`);
73
+ }
74
+ async function packageVersion() {
75
+ let dir = dirname(fileURLToPath(import.meta.url));
76
+ for (let i = 0; i < 5; i++) {
77
+ try {
78
+ const data = await readFile(join(dir, "package.json"), "utf8");
79
+ const parsed = JSON.parse(data);
80
+ if (parsed.version) {
81
+ return parsed.version;
82
+ }
83
+ }
84
+ catch {
85
+ // Walk up until we find the package root.
86
+ }
87
+ dir = dirname(dir);
88
+ }
89
+ return "0.0.0";
90
+ }
91
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,QAAQ,GAAmC;IAC/C,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,gBAAgB;CAC5B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC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AM,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;YAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAyB,CAAC;YACxD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO,MAAM,CAAC,OAAO,CAAC;YACxB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type GoDetection, type GoInstallDir } from "../go.js";
2
+ import { type RunResult } from "../process.js";
3
+ import { type Registry } from "../registry.js";
4
+ interface InstallDeps {
5
+ fetchRegistry: (url: string) => Promise<Registry>;
6
+ resolveModulePath: (entryPath: string, registryUrl: string) => Promise<string | null>;
7
+ detectGo: () => Promise<GoDetection>;
8
+ goInstall: (modulePath: string, ref: string, env?: NodeJS.ProcessEnv) => Promise<RunResult>;
9
+ goInstallDir: () => Promise<GoInstallDir>;
10
+ commandOnPath: (binary: string) => Promise<string | null>;
11
+ installSkill: (skillName: string, agents: string[]) => Promise<RunResult>;
12
+ stdout: (message: string) => void;
13
+ stderr: (message: string) => void;
14
+ platform: NodeJS.Platform;
15
+ }
16
+ export declare function createInstallCommand(overrides?: Partial<InstallDeps>): (args: string[]) => Promise<number>;
17
+ export declare const installCommand: (args: string[]) => Promise<number>;
18
+ export {};
@@ -0,0 +1,272 @@
1
+ import { BUNDLES, isBundle } from "../bundles.js";
2
+ import { detectGo, goInstall, goInstallDir } from "../go.js";
3
+ import { commandOnPath } from "../process.js";
4
+ import { cliBinaryName, cliSkillName, DEFAULT_REGISTRY_URL, fetchGoModulePath, fetchRegistry, lookupByName, } from "../registry.js";
5
+ import { installSkill } from "../skill.js";
6
+ export function createInstallCommand(overrides = {}) {
7
+ const deps = {
8
+ fetchRegistry: (url) => fetchRegistry(url),
9
+ resolveModulePath: (entryPath, registryUrl) => fetchGoModulePath(entryPath, registryUrl),
10
+ detectGo: () => detectGo(),
11
+ goInstall: (modulePath, ref, env) => goInstall(modulePath, { ref, env }),
12
+ goInstallDir: () => goInstallDir(),
13
+ commandOnPath: (binary) => commandOnPath(binary),
14
+ installSkill: (skillName, agents) => installSkill(skillName, { agents }),
15
+ stdout: (message) => console.log(message),
16
+ stderr: (message) => console.error(message),
17
+ platform: process.platform,
18
+ ...overrides,
19
+ };
20
+ return async function installCommandWithDeps(args) {
21
+ const parsed = parseInstallArgs(args);
22
+ if ("error" in parsed) {
23
+ deps.stderr(parsed.error);
24
+ deps.stderr("Usage: printing-press-library install <name|bundle>... [--agent <agent>...] [--json]");
25
+ return 1;
26
+ }
27
+ const expanded = expandBundles(parsed.names, parsed.options, deps);
28
+ let registry;
29
+ try {
30
+ registry = await deps.fetchRegistry(parsed.options.registryUrl);
31
+ }
32
+ catch (error) {
33
+ deps.stderr(error instanceof Error ? error.message : String(error));
34
+ return 1;
35
+ }
36
+ // `go env GOBIN GOPATH` doesn't change between CLIs in a single invocation,
37
+ // so a bundle install ("install starter-pack") only needs to shell out once.
38
+ const perInvocationDeps = { ...deps, goInstallDir: memoize(deps.goInstallDir) };
39
+ const outcomes = [];
40
+ for (const name of expanded) {
41
+ const outcome = await installOne(name, registry, parsed.options, perInvocationDeps);
42
+ outcomes.push(outcome);
43
+ if (outcome.error === "go missing") {
44
+ // Go is a global precondition; no point retrying it for the rest.
45
+ break;
46
+ }
47
+ }
48
+ return reportResults(outcomes, parsed.options, deps);
49
+ };
50
+ }
51
+ async function installOne(name, registry, options, deps) {
52
+ const entry = lookupByName(registry, name);
53
+ if (!entry) {
54
+ deps.stderr(`No Printing Press CLI found for "${name}". Try \`printing-press-library search ${name}\`.`);
55
+ return { ok: false, name, error: "not in catalog" };
56
+ }
57
+ const summary = {
58
+ name: entry.name,
59
+ };
60
+ if (!options.skillOnly) {
61
+ const go = await deps.detectGo();
62
+ if (!go.installed) {
63
+ deps.stderr(goMissingMessage(deps.platform));
64
+ return { ok: false, name: entry.name, error: "go missing" };
65
+ }
66
+ const binary = cliBinaryName(entry);
67
+ const moduleRoot = (await deps.resolveModulePath(entry.path, options.registryUrl)) ??
68
+ `github.com/mvanhorn/printing-press-library/${entry.path}`;
69
+ const modulePath = `${moduleRoot}/cmd/${binary}`;
70
+ const install = await deps.goInstall(modulePath, "latest");
71
+ if (install.code !== 0) {
72
+ deps.stderr(`go install failed for ${modulePath}`);
73
+ if (install.stderr.trim()) {
74
+ deps.stderr(install.stderr.trim());
75
+ }
76
+ return { ok: false, name: entry.name, error: "go install failed" };
77
+ }
78
+ const installedPath = await resolveInstalledPath(binary, deps);
79
+ const pathBinaryPath = await deps.commandOnPath(binary);
80
+ if (!pathBinaryPath) {
81
+ // `go install` succeeded, but `which`/`where` cannot find the binary —
82
+ // PATH does not include the directory go install wrote to. Tell the user
83
+ // exactly which directory to add when we know it.
84
+ deps.stderr(installedPath ? installedNotOnPathMessage(binary, installedPath) : pathMessage(binary));
85
+ return { ok: false, name: entry.name, error: "binary not on PATH" };
86
+ }
87
+ summary.binary = binary;
88
+ summary.modulePath = modulePath;
89
+ if (installedPath) {
90
+ summary.installedPath = installedPath;
91
+ }
92
+ summary.binaryPath = pathBinaryPath;
93
+ if (installedPath && !samePath(installedPath, pathBinaryPath, deps.platform)) {
94
+ // `which`/`where` resolved to a different binary than `go install` wrote.
95
+ // The older binary earlier in PATH will shadow the freshly built one.
96
+ summary.shadowedBy = pathBinaryPath;
97
+ summary.binaryPath = installedPath;
98
+ deps.stderr(shadowMessage(binary, installedPath, pathBinaryPath));
99
+ }
100
+ }
101
+ if (!options.cliOnly) {
102
+ const skillName = cliSkillName(entry);
103
+ const skill = await deps.installSkill(skillName, options.agents);
104
+ if (skill.code !== 0) {
105
+ const binaryNote = summary.binaryPath
106
+ ? ` The binary remains installed at ${summary.binaryPath}.`
107
+ : "";
108
+ deps.stderr(`Skill install failed for ${skillName}.${binaryNote}`);
109
+ if (skill.stderr.trim()) {
110
+ deps.stderr(skill.stderr.trim());
111
+ }
112
+ return { ok: false, name: entry.name, error: "skill install failed" };
113
+ }
114
+ summary.skill = skillName;
115
+ }
116
+ if (!options.json) {
117
+ deps.stdout(`Installed ${entry.name}`);
118
+ if (summary.binaryPath) {
119
+ deps.stdout(` binary: ${summary.binaryPath}`);
120
+ }
121
+ if (summary.shadowedBy) {
122
+ deps.stdout(` shadowed by: ${summary.shadowedBy} (earlier in PATH)`);
123
+ }
124
+ if (summary.skill) {
125
+ deps.stdout(` skill: ${summary.skill}`);
126
+ }
127
+ }
128
+ return { ok: true, name: entry.name, data: summary };
129
+ }
130
+ function expandBundles(names, options, deps) {
131
+ const expanded = [];
132
+ for (const name of names) {
133
+ if (isBundle(name)) {
134
+ const members = BUNDLES[name];
135
+ if (!options.json) {
136
+ deps.stdout(`Bundle "${name}" → ${members.join(", ")}`);
137
+ }
138
+ expanded.push(...members);
139
+ }
140
+ else {
141
+ expanded.push(name);
142
+ }
143
+ }
144
+ return expanded;
145
+ }
146
+ function reportResults(outcomes, options, deps) {
147
+ const failures = outcomes.filter((o) => !o.ok);
148
+ if (options.json) {
149
+ // Backward-compatible flat shape for the single-success case.
150
+ if (outcomes.length === 1 && outcomes[0].ok) {
151
+ deps.stdout(JSON.stringify({ ok: true, ...outcomes[0].data }, null, 2));
152
+ return 0;
153
+ }
154
+ deps.stdout(JSON.stringify({
155
+ ok: failures.length === 0,
156
+ results: outcomes.map((o) => ({
157
+ ok: o.ok,
158
+ name: o.name,
159
+ ...(o.data ?? {}),
160
+ ...(o.error ? { error: o.error } : {}),
161
+ })),
162
+ }, null, 2));
163
+ return failures.length === 0 ? 0 : 1;
164
+ }
165
+ if (outcomes.length > 1) {
166
+ deps.stdout("");
167
+ if (failures.length === 0) {
168
+ deps.stdout(`Installed ${outcomes.length} CLI(s).`);
169
+ }
170
+ else {
171
+ const ok = outcomes.length - failures.length;
172
+ const failedNames = failures.map((f) => f.name).join(", ");
173
+ deps.stdout(`Installed ${ok} of ${outcomes.length}; failed: ${failedNames}.`);
174
+ }
175
+ }
176
+ return failures.length === 0 ? 0 : 1;
177
+ }
178
+ export const installCommand = createInstallCommand();
179
+ function parseInstallArgs(args) {
180
+ const options = {
181
+ agents: [],
182
+ json: false,
183
+ registryUrl: DEFAULT_REGISTRY_URL,
184
+ cliOnly: false,
185
+ skillOnly: false,
186
+ };
187
+ const names = [];
188
+ for (let i = 0; i < args.length; i++) {
189
+ const arg = args[i];
190
+ if (arg === "--json") {
191
+ options.json = true;
192
+ }
193
+ else if (arg === "--cli-only") {
194
+ options.cliOnly = true;
195
+ }
196
+ else if (arg === "--skill-only") {
197
+ options.skillOnly = true;
198
+ }
199
+ else if (arg === "--agent" || arg === "-a") {
200
+ const agent = args[++i];
201
+ if (!agent) {
202
+ return { error: "Missing value for --agent" };
203
+ }
204
+ options.agents.push(agent);
205
+ }
206
+ else if (arg === "--registry-url") {
207
+ const registryUrl = args[++i];
208
+ if (!registryUrl) {
209
+ return { error: "Missing value for --registry-url" };
210
+ }
211
+ options.registryUrl = registryUrl;
212
+ }
213
+ else if (arg.startsWith("-")) {
214
+ return { error: `Unknown install option: ${arg}` };
215
+ }
216
+ else {
217
+ names.push(arg);
218
+ }
219
+ }
220
+ if (options.cliOnly && options.skillOnly) {
221
+ return { error: "--cli-only and --skill-only are mutually exclusive" };
222
+ }
223
+ if (names.length === 0) {
224
+ return { error: "Missing CLI name or bundle" };
225
+ }
226
+ return { names, options };
227
+ }
228
+ function goMissingMessage(platform) {
229
+ const installHint = platform === "darwin"
230
+ ? "Install Go with: brew install go"
231
+ : platform === "win32"
232
+ ? "Install Go with: winget install GoLang.Go"
233
+ : "Install Go from your package manager or https://go.dev/dl/";
234
+ return `Go is required to install Printing Press CLIs. ${installHint}`;
235
+ }
236
+ function pathMessage(binary) {
237
+ return `${binary} was installed, but it is not on PATH. Add $(go env GOPATH)/bin, usually $HOME/go/bin, to PATH and retry.`;
238
+ }
239
+ async function resolveInstalledPath(binary, deps) {
240
+ const info = await deps.goInstallDir();
241
+ if (!info.binDir) {
242
+ return null;
243
+ }
244
+ const sep = deps.platform === "win32" ? "\\" : "/";
245
+ const suffix = deps.platform === "win32" ? ".exe" : "";
246
+ return `${info.binDir}${sep}${binary}${suffix}`;
247
+ }
248
+ function memoize(fn) {
249
+ let cached;
250
+ return () => {
251
+ if (!cached) {
252
+ cached = fn();
253
+ }
254
+ return cached;
255
+ };
256
+ }
257
+ function samePath(a, b, platform) {
258
+ const norm = (p) => {
259
+ const stripped = p.replace(/[\\/]+$/, "");
260
+ return platform === "win32" ? stripped.toLowerCase() : stripped;
261
+ };
262
+ return norm(a) === norm(b);
263
+ }
264
+ function shadowMessage(binary, installedPath, shadowedBy) {
265
+ return (`WARNING: installed ${binary} at ${installedPath}, but ${shadowedBy} appears earlier in PATH and will shadow it. ` +
266
+ `Move or remove the old binary, or reorder PATH so the Go install directory comes first.`);
267
+ }
268
+ function installedNotOnPathMessage(binary, installedPath) {
269
+ return (`WARNING: installed ${binary} at ${installedPath}, but its directory is not on PATH. ` +
270
+ `Add it to PATH (e.g. $(go env GOPATH)/bin, usually $HOME/go/bin) and retry, or invoke the binary by absolute path.`);
271
+ }
272
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAuC,MAAM,UAAU,CAAC;AAClG,OAAO,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,YAAY,GAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,a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3
+ interface ListDeps {
4
+ fetchRegistry: (url: string) => Promise<Registry>;
5
+ commandOnPath: (binary: string) => Promise<string | null>;
6
+ runner: Runner;
7
+ stdout: (message: string) => void;
8
+ stderr: (message: string) => void;
9
+ }
10
+ export declare function createListCommand(overrides?: Partial<ListDeps>): (args?: string[]) => Promise<number>;
11
+ export declare const listCommand: (args?: string[]) => Promise<number>;
12
+ export {};