fix: 收敛受控 CLI 调用与诊断

This commit is contained in:
Codex
2026-07-12 17:08:00 +02:00
parent 00c60a17cd
commit 2a80e08a40
13 changed files with 168 additions and 35 deletions
+5 -13
View File
@@ -769,21 +769,13 @@ async function main(): Promise<void> {
}
if (top === "trans" || top === "tran") {
const error = new Error(`${top} is a PATH wrapper, not a bun scripts/cli.ts subcommand`);
Object.assign(error, {
name: "TransEntrypointMigrationError",
const replacement = `trans ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`;
throw new CliInputError(`${top} is a PATH wrapper, not a bun scripts/cli.ts subcommand`, {
code: "trans-root-cli-entrypoint-moved",
level: "error",
entrypoint: top,
operation: "root-cli-dispatch",
replacementExamples: {
canonical: `trans ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
legacyUnified: `bun scripts/cli.ts ssh ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
},
migrationHint: "Use: trans <route> <operation> [args...]. The PATH wrapper delegates to the lightweight SSH CLI.",
note: "Ordinary root CLI commands continue to use bun scripts/cli.ts <command>.",
argument: top,
usage: replacement,
hint: "Use trans <route> <operation> [args...]; ordinary root CLI commands continue to use bun scripts/cli.ts <command>.",
});
throw error;
}
throw new CliInputError(`Unknown command: ${commandName}`, {