@mcpcloud/cli 0.21.2 → 0.22.0-next-20260906224824
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/README.md +1 -0
- package/dist/index.js +107 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -588,6 +588,7 @@ _Generated from the live command tree by `bun run docs:readme` — do not edit b
|
|
|
588
588
|
| `mcp skills test-scenarios rm <skill> <scenarioId>` | Archive a skill test scenario |
|
|
589
589
|
| `mcp skills test-scenarios update <skill> <scenarioId>` | Update a skill test scenario (only the flags you pass change) |
|
|
590
590
|
| `mcp skills token <skill>` | Reveal the skill’s runtime bearer token (--rotate issues a new one and invalidates the old) |
|
|
591
|
+
| `mcp skills transfer <skill>` | Move a skill into another organization you administer, keeping its id, versions, runtime deployments, test assets and registry listing. Shows the plan; add --yes to execute. |
|
|
591
592
|
| `mcp skills uninstall <skill>` | Mark the caller's installation of this skill as removed |
|
|
592
593
|
| `mcp skills update <skill>` | Update skill metadata (name, description, visibility) |
|
|
593
594
|
| `mcp skills version <skill> <versionId>` | Show details for one published skill version (workflow summary, triggers, deps) |
|
package/dist/index.js
CHANGED
|
@@ -12107,6 +12107,112 @@ function registerSkillPullCommand(skills) {
|
|
|
12107
12107
|
}));
|
|
12108
12108
|
}
|
|
12109
12109
|
|
|
12110
|
+
// src/commands/skills-transfer.ts
|
|
12111
|
+
var TRANSFER_PATH2 = "/api/v1/skill/transfer";
|
|
12112
|
+
var TRANSFER_TIMEOUT_MS2 = 180000;
|
|
12113
|
+
async function resolveTargetOrganizationId2(reference) {
|
|
12114
|
+
const ref = reference.trim();
|
|
12115
|
+
const data = await api.get("/api/v1/organizations");
|
|
12116
|
+
const rows = data.organizations;
|
|
12117
|
+
const match = rows.find((row) => row.id === ref) ?? rows.find((row) => row.slug === ref) ?? rows.find((row) => row.name.toLowerCase() === ref.toLowerCase());
|
|
12118
|
+
if (!match) {
|
|
12119
|
+
printError(`No organization you belong to matches ${c.bold(ref)} (by id, slug, or name).`);
|
|
12120
|
+
if (rows.length > 0) {
|
|
12121
|
+
printInfo(` ${c.dim("Yours:")} ${rows.map((row) => `${row.name} (${row.slug ?? row.id})`).join(", ")}`);
|
|
12122
|
+
}
|
|
12123
|
+
throw new CliExitError(1);
|
|
12124
|
+
}
|
|
12125
|
+
return match.id;
|
|
12126
|
+
}
|
|
12127
|
+
function printPlan2(result) {
|
|
12128
|
+
printKeyValue({
|
|
12129
|
+
skill: `${result.skill.name} (${result.skill.id})`,
|
|
12130
|
+
from: `${result.from.organizationName ?? result.from.organizationId} / ${result.from.projectName ?? result.from.projectId}`,
|
|
12131
|
+
to: `${result.to.organizationName} / ${result.to.projectName ?? result.to.projectId ?? "(new project)"}`
|
|
12132
|
+
});
|
|
12133
|
+
const moving = result.manifest.filter((entry) => entry.count > 0);
|
|
12134
|
+
if (moving.length > 0) {
|
|
12135
|
+
printInfo(c.dim(" Rows that move:"));
|
|
12136
|
+
for (const entry of moving) {
|
|
12137
|
+
printInfo(` ${entry.table.padEnd(34)} ${entry.count}${entry.more ? "+" : ""}`);
|
|
12138
|
+
}
|
|
12139
|
+
}
|
|
12140
|
+
for (const note of result.plan.notes)
|
|
12141
|
+
printWarn(` ! ${note}`);
|
|
12142
|
+
}
|
|
12143
|
+
function reportApiError7(err) {
|
|
12144
|
+
if (err instanceof McpCloudApiError) {
|
|
12145
|
+
printError(`Transfer failed (HTTP ${err.status}): ${err.error.message}`);
|
|
12146
|
+
const blockers = err.error.details?.blockers;
|
|
12147
|
+
if (Array.isArray(blockers)) {
|
|
12148
|
+
for (const blocker of blockers) {
|
|
12149
|
+
printInfo(` ${c.dim(blocker.code + ":")} ${blocker.message}`);
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
12152
|
+
} else {
|
|
12153
|
+
printError(`Transfer failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
12154
|
+
}
|
|
12155
|
+
throw new CliExitError(1);
|
|
12156
|
+
}
|
|
12157
|
+
function registerSkillTransferCommand(skills) {
|
|
12158
|
+
skills.command("transfer <skill>").description("Move a skill into another organization you administer, keeping its id, versions, runtime deployments, test assets and registry listing. Shows the plan; add --yes to execute.").requiredOption("--to-org <organization>", "Destination organization (id, slug, or name) — you must be owner or admin there").option("--to-project <project>", "Destination project (id or name, within the destination organization)").option("--create-project <name>", "Create this project in the destination organization and move the skill into it").option("--org <organizationId>", "Source organization ID").option("--yes", "Execute the transfer (without it, only the plan is shown)").addHelpText("after", [
|
|
12159
|
+
"",
|
|
12160
|
+
"What moves: the skill and its project placement, versions, runtime",
|
|
12161
|
+
"deployments (their URL and token do not change), the runtime token, test",
|
|
12162
|
+
"scenarios and runs, eval suites and runs, autopilot and authoring history,",
|
|
12163
|
+
"execution traces, and the registry listing (installers keep it).",
|
|
12164
|
+
"What stays: invocation history (the source org was billed for it).",
|
|
12165
|
+
"",
|
|
12166
|
+
"Refused while a dependency server lives outside the destination —",
|
|
12167
|
+
"transfer the servers first (`mcp servers transfer`), then the skill.",
|
|
12168
|
+
"Members of the source organization lose access to the skill."
|
|
12169
|
+
].join(`
|
|
12170
|
+
`)).action(runAction(async (skillRef, opts) => {
|
|
12171
|
+
const orgId = await resolveOrgId(opts.org);
|
|
12172
|
+
const skillId = await resolveSkillId(skillRef, orgId);
|
|
12173
|
+
const targetOrganizationId = await resolveTargetOrganizationId2(opts.toOrg);
|
|
12174
|
+
const targetProjectId = await resolveOptionalProjectId(opts.toProject, targetOrganizationId);
|
|
12175
|
+
if (opts.yes && !targetProjectId && !opts.createProject) {
|
|
12176
|
+
printError("Pass --to-project <project> or --create-project <name> for the destination.");
|
|
12177
|
+
throw new CliExitError(1);
|
|
12178
|
+
}
|
|
12179
|
+
const body = {
|
|
12180
|
+
organizationId: orgId,
|
|
12181
|
+
targetOrganizationId,
|
|
12182
|
+
skillId,
|
|
12183
|
+
...targetProjectId ? { targetProjectId } : {},
|
|
12184
|
+
...opts.createProject ? { createProjectName: opts.createProject } : {},
|
|
12185
|
+
dryRun: !opts.yes
|
|
12186
|
+
};
|
|
12187
|
+
let result;
|
|
12188
|
+
try {
|
|
12189
|
+
if (opts.yes && !isJsonMode()) {
|
|
12190
|
+
printStep(`Transferring ${c.bold(skillRef)} to ${c.bold(opts.toOrg)}…`);
|
|
12191
|
+
}
|
|
12192
|
+
result = await api.post(TRANSFER_PATH2, body, {
|
|
12193
|
+
timeoutMs: TRANSFER_TIMEOUT_MS2
|
|
12194
|
+
});
|
|
12195
|
+
} catch (err) {
|
|
12196
|
+
reportApiError7(err);
|
|
12197
|
+
}
|
|
12198
|
+
if (isJsonMode()) {
|
|
12199
|
+
printJson(result);
|
|
12200
|
+
return;
|
|
12201
|
+
}
|
|
12202
|
+
printPlan2(result);
|
|
12203
|
+
if (result.dryRun) {
|
|
12204
|
+
printInfo(c.dim(` → nothing moved. Re-run with --yes${targetProjectId || opts.createProject ? "" : " and --to-project <project> (or --create-project <name>)"} to transfer.`));
|
|
12205
|
+
return;
|
|
12206
|
+
}
|
|
12207
|
+
printSuccess(`${result.skill.name} now lives in ${result.to.organizationName} / ${result.to.projectName ?? result.to.projectId}${result.to.projectCreated ? " (project created)" : ""}. ${result.patchedRows} row(s) rehomed; id unchanged.`);
|
|
12208
|
+
if (result.runtime && result.runtime.failed.length > 0) {
|
|
12209
|
+
printWarn(` ! ${result.runtime.failed.length} runtime deployment(s) could not be re-published for ${result.to.organizationName}: ${result.runtime.failed.join("; ")}. Run: mcp skills deploy ${skillRef} --org ${result.to.organizationId}`);
|
|
12210
|
+
} else if (result.runtime) {
|
|
12211
|
+
printInfo(` ${result.runtime.republished} runtime deployment(s) re-published for ${result.to.organizationName}; URL and token unchanged.`);
|
|
12212
|
+
}
|
|
12213
|
+
}));
|
|
12214
|
+
}
|
|
12215
|
+
|
|
12110
12216
|
// src/commands/skills.ts
|
|
12111
12217
|
async function readStdin3() {
|
|
12112
12218
|
const chunks = [];
|
|
@@ -12141,6 +12247,7 @@ function registerSkillCommands(program) {
|
|
|
12141
12247
|
registerSkillTestCommands(skills);
|
|
12142
12248
|
registerSkillInvokeCommand(skills);
|
|
12143
12249
|
registerSkillPullCommand(skills);
|
|
12250
|
+
registerSkillTransferCommand(skills);
|
|
12144
12251
|
skills.command("list").description("List skills in an organization").option("--org <organizationId>", "Organization ID").option("--project <project>", "Filter by project (id or name)").option("--limit <n>", "Maximum results (default 25)", parsePositiveIntOption("limit"), "25").addHelpText("after", [
|
|
12145
12252
|
"",
|
|
12146
12253
|
"Examples:",
|
package/package.json
CHANGED