prpm 2.1.36 → 2.1.37
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/dist/index.js +105 -31
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -18963,25 +18963,37 @@ async function installFromLockfile(options) {
|
|
|
18963
18963
|
}
|
|
18964
18964
|
function createInstallCommand() {
|
|
18965
18965
|
const command = new import_commander12.Command("install");
|
|
18966
|
-
command.description("Install a package from the registry, or install all packages from prpm.lock if no package specified").argument("[package]", "Package to install (e.g., react-rules or react-rules@1.2.0). If omitted, installs all packages from prpm.lock").option("--version <version>", "Specific version to install").option("--as <format>", `Convert and install in specific format (${import_types.FORMATS.join(", ")})`).option("--format <format>", "Alias for --as").option("--location <path>", "Custom location for installed files (Agents.md or nested Cursor rules)").option("--subtype <subtype>", "Specify subtype when converting (skill, agent, rule, etc.)").option("--hook-mapping <strategy>", "Hook mapping strategy: auto (default), strict, skip", "auto").option("--frozen-lockfile", "Fail if lock file needs to be updated (for CI)").option("-y, --yes", "Auto-confirm prompts (overwrite files without asking)").option("--no-append", "Skip adding skill to manifest file (skill files only)").option("--manifest-file <filename>", "Custom manifest filename for progressive disclosure").option("--eager", "Force skill/agent to always activate (not on-demand)").option("--lazy", "Use default on-demand activation (overrides package eager setting)").option("--tools <tools>", "Override Claude/Codex tool list for this install (comma- or space-separated)").option("--global", "Install MCP servers to global config (e.g., ~/.claude/settings.json, ~/.codex/config.toml, ~/.cursor/mcp.json, ~/.kiro/settings/mcp.json)").option("--editor <editor>", "[Deprecated: use --as] Target editor for MCP server installation").action(async (packageSpec, options) => {
|
|
18966
|
+
command.description("Install a package from the registry, or install all packages from prpm.lock if no package specified").argument("[package]", "Package to install (e.g., react-rules or react-rules@1.2.0). If omitted, installs all packages from prpm.lock").option("--version <version>", "Specific version to install").option("--as <format>", `Convert and install in specific format. Accepts a comma-separated list to install to multiple formats in one command (${import_types.FORMATS.join(", ")})`).option("--format <format>", "Alias for --as").option("--location <path>", "Custom location for installed files (Agents.md or nested Cursor rules)").option("--subtype <subtype>", "Specify subtype when converting (skill, agent, rule, etc.)").option("--hook-mapping <strategy>", "Hook mapping strategy: auto (default), strict, skip", "auto").option("--frozen-lockfile", "Fail if lock file needs to be updated (for CI)").option("-y, --yes", "Auto-confirm prompts (overwrite files without asking)").option("--no-append", "Skip adding skill to manifest file (skill files only)").option("--manifest-file <filename>", "Custom manifest filename for progressive disclosure").option("--eager", "Force skill/agent to always activate (not on-demand)").option("--lazy", "Use default on-demand activation (overrides package eager setting)").option("--tools <tools>", "Override Claude/Codex tool list for this install (comma- or space-separated)").option("--global", "Install MCP servers to global config (e.g., ~/.claude/settings.json, ~/.codex/config.toml, ~/.cursor/mcp.json, ~/.kiro/settings/mcp.json)").option("--editor <editor>", "[Deprecated: use --as] Target editor for MCP server installation").action(async (packageSpec, options) => {
|
|
18967
18967
|
const rawAs = options.format || options.as;
|
|
18968
18968
|
const validFormats = import_types.FORMATS;
|
|
18969
|
-
const
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18969
|
+
const asTokens = rawAs ? Array.from(new Set(rawAs.split(",").map((s) => s.trim()).filter(Boolean))) : [];
|
|
18970
|
+
if (rawAs !== void 0 && asTokens.length === 0) {
|
|
18971
|
+
throw new CLIError(
|
|
18972
|
+
`\u274C --as requires at least one format. Got: "${rawAs}"
|
|
18973
|
+
|
|
18974
|
+
\u{1F4A1} Examples:
|
|
18975
|
+
prpm install my-package --as claude
|
|
18976
|
+
prpm install my-package --as claude,codex`,
|
|
18977
|
+
1
|
|
18978
|
+
);
|
|
18979
|
+
}
|
|
18980
|
+
for (const token of asTokens) {
|
|
18981
|
+
const isFormat = validFormats.includes(token);
|
|
18982
|
+
const isMCPEditor = MCP_EDITORS.includes(token);
|
|
18983
|
+
if (!isFormat && !isMCPEditor) {
|
|
18984
|
+
throw new CLIError(`\u274C Format must be one of: ${validFormats.join(", ")}
|
|
18973
18985
|
|
|
18974
18986
|
\u{1F4A1} Examples:
|
|
18975
|
-
prpm install my-package --as cursor
|
|
18976
|
-
prpm install my-package --
|
|
18977
|
-
prpm install my-package --format claude.md
|
|
18978
|
-
prpm install my-package --format kiro
|
|
18979
|
-
prpm install my-package --format agents.md
|
|
18980
|
-
prpm install my-package --format gemini.md
|
|
18981
|
-
prpm install my-mcp-server --as codex
|
|
18982
|
-
prpm install my-package
|
|
18983
|
-
|
|
18984
|
-
|
|
18987
|
+
prpm install my-package --as cursor # Convert to Cursor format
|
|
18988
|
+
prpm install my-package --as claude,codex # Install to both Claude and Codex
|
|
18989
|
+
prpm install my-package --format claude.md # Convert to Claude.md format
|
|
18990
|
+
prpm install my-package --format kiro # Convert to Kiro format
|
|
18991
|
+
prpm install my-package --format agents.md # Convert to Agents.md format
|
|
18992
|
+
prpm install my-package --format gemini.md # Convert to Gemini format
|
|
18993
|
+
prpm install my-mcp-server --as codex # Install MCP server to Codex
|
|
18994
|
+
prpm install my-package # Install in native format`, 1);
|
|
18995
|
+
}
|
|
18996
|
+
}
|
|
18985
18997
|
if (options.editor && !MCP_EDITORS.includes(options.editor)) {
|
|
18986
18998
|
throw new CLIError(
|
|
18987
18999
|
`Invalid MCP editor: ${options.editor}
|
|
@@ -19013,8 +19025,18 @@ Valid strategies: ${VALID_HOOK_MAPPING_STRATEGIES.join(", ")}`
|
|
|
19013
19025
|
if (options.tools) {
|
|
19014
19026
|
console.warn("\u26A0\uFE0F --tools is ignored when installing from prpm.lock (no package specified)");
|
|
19015
19027
|
}
|
|
19028
|
+
if (asTokens.length > 1) {
|
|
19029
|
+
throw new CLIError(
|
|
19030
|
+
`\u274C Multi-format --as is not supported when installing from prpm.lock.
|
|
19031
|
+
|
|
19032
|
+
The lockfile already records the target format for each package. Run prpm install <package> --as ${asTokens.join(",")} for specific packages instead.`,
|
|
19033
|
+
1
|
|
19034
|
+
);
|
|
19035
|
+
}
|
|
19036
|
+
const [singleAs] = asTokens;
|
|
19037
|
+
const isMCPEditorOnly = singleAs && !validFormats.includes(singleAs) && MCP_EDITORS.includes(singleAs);
|
|
19016
19038
|
await installFromLockfile({
|
|
19017
|
-
as:
|
|
19039
|
+
as: isMCPEditorOnly ? void 0 : singleAs,
|
|
19018
19040
|
subtype: options.subtype,
|
|
19019
19041
|
frozenLockfile: options.frozenLockfile,
|
|
19020
19042
|
location: options.location,
|
|
@@ -19023,21 +19045,73 @@ Valid strategies: ${VALID_HOOK_MAPPING_STRATEGIES.join(", ")}`
|
|
|
19023
19045
|
return;
|
|
19024
19046
|
}
|
|
19025
19047
|
const eager = options.eager ? true : options.lazy ? false : void 0;
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19048
|
+
if (asTokens.length <= 1) {
|
|
19049
|
+
const [singleAs] = asTokens;
|
|
19050
|
+
const isMCPEditorOnly = singleAs && !validFormats.includes(singleAs) && MCP_EDITORS.includes(singleAs);
|
|
19051
|
+
const convertTo = isMCPEditorOnly ? void 0 : singleAs;
|
|
19052
|
+
const mcpEditor = options.editor || singleAs;
|
|
19053
|
+
await handleInstall(packageSpec, {
|
|
19054
|
+
version: options.version,
|
|
19055
|
+
as: convertTo,
|
|
19056
|
+
subtype: options.subtype,
|
|
19057
|
+
frozenLockfile: options.frozenLockfile,
|
|
19058
|
+
force: options.yes,
|
|
19059
|
+
location: options.location,
|
|
19060
|
+
noAppend: options.noAppend,
|
|
19061
|
+
manifestFile: options.manifestFile,
|
|
19062
|
+
hookMapping: options.hookMapping,
|
|
19063
|
+
eager,
|
|
19064
|
+
tools: options.tools,
|
|
19065
|
+
global: options.global,
|
|
19066
|
+
editor: mcpEditor
|
|
19067
|
+
});
|
|
19068
|
+
return;
|
|
19069
|
+
}
|
|
19070
|
+
console.log(`\u{1F4E6} Installing ${packageSpec} to ${asTokens.length} targets: ${asTokens.join(", ")}
|
|
19071
|
+
`);
|
|
19072
|
+
let successCount = 0;
|
|
19073
|
+
const failures = [];
|
|
19074
|
+
const isCollectionSpec = packageSpec.startsWith("collections/");
|
|
19075
|
+
for (const token of asTokens) {
|
|
19076
|
+
const isMCPEditorOnly = !validFormats.includes(token) && MCP_EDITORS.includes(token);
|
|
19077
|
+
const convertTo = isMCPEditorOnly ? void 0 : token;
|
|
19078
|
+
const mcpEditor = token;
|
|
19079
|
+
console.log(source_default.cyan(`
|
|
19080
|
+
\u2501\u2501 [${token}] \u2501\u2501`));
|
|
19081
|
+
try {
|
|
19082
|
+
await handleInstall(packageSpec, {
|
|
19083
|
+
version: options.version,
|
|
19084
|
+
as: convertTo,
|
|
19085
|
+
subtype: options.subtype,
|
|
19086
|
+
frozenLockfile: options.frozenLockfile,
|
|
19087
|
+
force: options.yes,
|
|
19088
|
+
location: options.location,
|
|
19089
|
+
noAppend: options.noAppend,
|
|
19090
|
+
manifestFile: options.manifestFile,
|
|
19091
|
+
hookMapping: options.hookMapping,
|
|
19092
|
+
eager,
|
|
19093
|
+
tools: options.tools,
|
|
19094
|
+
global: options.global,
|
|
19095
|
+
editor: options.editor || mcpEditor
|
|
19096
|
+
});
|
|
19097
|
+
successCount++;
|
|
19098
|
+
} catch (err) {
|
|
19099
|
+
if (err instanceof CLIError && err.exitCode === 0) {
|
|
19100
|
+
successCount++;
|
|
19101
|
+
continue;
|
|
19102
|
+
}
|
|
19103
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
19104
|
+
failures.push({ target: token, error: message });
|
|
19105
|
+
console.error(source_default.red(`\u274C Failed to install ${packageSpec} as ${token}: ${message}`));
|
|
19106
|
+
}
|
|
19107
|
+
}
|
|
19108
|
+
console.log(`
|
|
19109
|
+
\u2705 Installed ${packageSpec} to ${successCount}/${asTokens.length} targets` + (isCollectionSpec ? " (collection)" : ""));
|
|
19110
|
+
if (failures.length > 0) {
|
|
19111
|
+
const detail = failures.map((f) => ` \u2022 ${f.target}: ${f.error}`).join("\n");
|
|
19112
|
+
throw new CLIError(`\u274C ${failures.length} target${failures.length === 1 ? "" : "s"} failed:
|
|
19113
|
+
${detail}`, 1);
|
|
19114
|
+
}
|
|
19041
19115
|
});
|
|
19042
19116
|
return command;
|
|
19043
19117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.37",
|
|
4
4
|
"description": "Prompt Package Manager CLI - Install and manage prompt-based files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@octokit/rest": "^22.0.0",
|
|
48
|
-
"@pr-pm/converters": "^2.1.
|
|
49
|
-
"@pr-pm/registry-client": "^2.3.
|
|
50
|
-
"@pr-pm/types": "^2.1.
|
|
48
|
+
"@pr-pm/converters": "^2.1.38",
|
|
49
|
+
"@pr-pm/registry-client": "^2.3.37",
|
|
50
|
+
"@pr-pm/types": "^2.1.38",
|
|
51
51
|
"ajv": "^8.17.1",
|
|
52
52
|
"ajv-formats": "^3.0.1",
|
|
53
53
|
"chalk": "^5.6.2",
|