claude-yes 1.25.0 → 1.26.0
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/claude-yes.js +74 -65
- package/dist/cli.js +74 -65
- package/dist/cli.js.map +5 -4
- package/dist/codex-yes.js +74 -65
- package/dist/copilot-yes.js +74 -65
- package/dist/cursor-yes.js +74 -65
- package/dist/gemini-yes.js +74 -65
- package/dist/grok-yes.js +74 -65
- package/dist/qwen-yes.js +74 -65
- package/package.json +2 -1
- package/ts/cli.ts +11 -113
- package/ts/parseCliArgs.spec.ts +220 -0
- package/ts/parseCliArgs.ts +111 -0
- package/ts/cli.spec.ts +0 -18
package/dist/claude-yes.js
CHANGED
|
@@ -12021,73 +12021,82 @@ function isYargsInstance(y) {
|
|
|
12021
12021
|
var Yargs = YargsFactory(esm_default);
|
|
12022
12022
|
var yargs_default = Yargs;
|
|
12023
12023
|
|
|
12024
|
+
// ts/parseCliArgs.ts
|
|
12025
|
+
function parseCliArgs(argv) {
|
|
12026
|
+
const cliName = ((e) => {
|
|
12027
|
+
if (e === "cli" || e === "cli.ts")
|
|
12028
|
+
return;
|
|
12029
|
+
return e;
|
|
12030
|
+
})(argv[1]?.split("/").pop()?.split("-")[0]);
|
|
12031
|
+
const parsedArgv = yargs_default(hideBin(argv)).usage("Usage: $0 [cli] [cli-yes args] [agent-cli args] [--] [prompts...]").example("$0 claude --idle=30s -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout, and the prompt is everything after `--`").option("robust", {
|
|
12032
|
+
type: "boolean",
|
|
12033
|
+
default: true,
|
|
12034
|
+
description: "re-spawn Claude with --continue if it crashes, only works for claude yet",
|
|
12035
|
+
alias: "r"
|
|
12036
|
+
}).option("logFile", {
|
|
12037
|
+
type: "string",
|
|
12038
|
+
description: "Rendered log file to write to."
|
|
12039
|
+
}).option("prompt", {
|
|
12040
|
+
type: "string",
|
|
12041
|
+
description: "Prompt to send to Claude (also can be passed after --)",
|
|
12042
|
+
alias: "p"
|
|
12043
|
+
}).option("verbose", {
|
|
12044
|
+
type: "boolean",
|
|
12045
|
+
description: "Enable verbose logging, will emit ./agent-yes.log",
|
|
12046
|
+
default: false
|
|
12047
|
+
}).option("exit-on-idle", {
|
|
12048
|
+
type: "string",
|
|
12049
|
+
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12050
|
+
deprecated: "use --idle instead",
|
|
12051
|
+
default: "60s",
|
|
12052
|
+
alias: "e"
|
|
12053
|
+
}).option("idle", {
|
|
12054
|
+
type: "string",
|
|
12055
|
+
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12056
|
+
alias: "i"
|
|
12057
|
+
}).option("queue", {
|
|
12058
|
+
type: "boolean",
|
|
12059
|
+
description: "Queue Agent when spawning multiple agents in the same directory/repo, can be disabled with --no-queue",
|
|
12060
|
+
default: true
|
|
12061
|
+
}).positional("cli", {
|
|
12062
|
+
describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
|
|
12063
|
+
type: "string",
|
|
12064
|
+
choices: SUPPORTED_CLIS,
|
|
12065
|
+
demandOption: false,
|
|
12066
|
+
default: cliName
|
|
12067
|
+
}).help().version().parserConfiguration({
|
|
12068
|
+
"unknown-options-as-args": true,
|
|
12069
|
+
"halt-at-non-option": true
|
|
12070
|
+
}).parseSync();
|
|
12071
|
+
const optionalIndex = (e) => 0 <= e ? e : undefined;
|
|
12072
|
+
const rawArgs = argv.slice(2);
|
|
12073
|
+
const cliArgIndex = optionalIndex(rawArgs.indexOf(String(parsedArgv._[0])));
|
|
12074
|
+
const dashIndex = optionalIndex(rawArgs.indexOf("--"));
|
|
12075
|
+
const cliArgsForSpawn = parsedArgv._[0] ? rawArgs.slice(cliArgIndex ?? 0, dashIndex ?? undefined) : [];
|
|
12076
|
+
const dashPrompt = dashIndex ? rawArgs.slice(dashIndex + 1).join(" ") : undefined;
|
|
12077
|
+
return {
|
|
12078
|
+
cli: cliName || parsedArgv.cli || parsedArgv._[0]?.toString()?.replace?.(/-yes$/, ""),
|
|
12079
|
+
cliArgs: cliArgsForSpawn,
|
|
12080
|
+
prompt: [parsedArgv.prompt, dashPrompt].join(" ").trim() || undefined,
|
|
12081
|
+
exitOnIdle: Number((parsedArgv.idle || parsedArgv.exitOnIdle)?.replace(/.*/, (e) => String(index_default(e))) || 0),
|
|
12082
|
+
queue: parsedArgv.queue,
|
|
12083
|
+
robust: parsedArgv.robust,
|
|
12084
|
+
logFile: parsedArgv.logFile,
|
|
12085
|
+
verbose: parsedArgv.verbose
|
|
12086
|
+
};
|
|
12087
|
+
}
|
|
12088
|
+
|
|
12024
12089
|
// ts/cli.ts
|
|
12025
|
-
var
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
var argv = yargs_default(hideBin(process.argv)).usage("Usage: $0 [cli] [cli-yes args] [agent-cli args] [--] [prompts...]").example("$0 claude --idle=30s -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout, and the prompt is everything after `--`").option("robust", {
|
|
12031
|
-
type: "boolean",
|
|
12032
|
-
default: true,
|
|
12033
|
-
description: "re-spawn Claude with --continue if it crashes, only works for claude yet",
|
|
12034
|
-
alias: "r"
|
|
12035
|
-
}).option("logFile", {
|
|
12036
|
-
type: "string",
|
|
12037
|
-
description: "Rendered log file to write to."
|
|
12038
|
-
}).option("prompt", {
|
|
12039
|
-
type: "string",
|
|
12040
|
-
description: "Prompt to send to Claude (also can be passed after --)",
|
|
12041
|
-
alias: "p"
|
|
12042
|
-
}).option("verbose", {
|
|
12043
|
-
type: "boolean",
|
|
12044
|
-
description: "Enable verbose logging, will emit ./agent-yes.log",
|
|
12045
|
-
default: false
|
|
12046
|
-
}).option("exit-on-idle", {
|
|
12047
|
-
type: "string",
|
|
12048
|
-
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12049
|
-
deprecated: "use --idle instead",
|
|
12050
|
-
default: "60s",
|
|
12051
|
-
alias: "e"
|
|
12052
|
-
}).option("idle", {
|
|
12053
|
-
type: "string",
|
|
12054
|
-
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12055
|
-
alias: "i"
|
|
12056
|
-
}).option("queue", {
|
|
12057
|
-
type: "boolean",
|
|
12058
|
-
description: "Queue Agent when spawning multiple agents in the same directory/repo, can be disabled with --no-queue",
|
|
12059
|
-
default: true
|
|
12060
|
-
}).positional("cli", {
|
|
12061
|
-
describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
|
|
12062
|
-
type: "string",
|
|
12063
|
-
choices: SUPPORTED_CLIS,
|
|
12064
|
-
demandOption: false,
|
|
12065
|
-
default: cliName
|
|
12066
|
-
}).help().version().parserConfiguration({
|
|
12067
|
-
"unknown-options-as-args": true,
|
|
12068
|
-
"halt-at-non-option": true
|
|
12069
|
-
}).parseSync();
|
|
12070
|
-
var optionalIndex = (e) => 0 <= e ? e : undefined;
|
|
12071
|
-
var rawArgs = process.argv.slice(2);
|
|
12072
|
-
var cliArgIndex = optionalIndex(rawArgs.indexOf(String(argv._[0])));
|
|
12073
|
-
var dashIndex = optionalIndex(rawArgs.indexOf("--"));
|
|
12074
|
-
var cliArgsForSpawn = argv._[0] ? rawArgs.slice(cliArgIndex ?? 0, dashIndex ?? undefined) : [];
|
|
12075
|
-
var dashPrompt = dashIndex ? rawArgs.slice(dashIndex + 1).join(" ") : undefined;
|
|
12076
|
-
if (argv.verbose) {
|
|
12090
|
+
var config2 = parseCliArgs(process.argv);
|
|
12091
|
+
if (!config2.cli) {
|
|
12092
|
+
phpdie_default2("missing cli def");
|
|
12093
|
+
}
|
|
12094
|
+
if (config2.verbose) {
|
|
12077
12095
|
process.env.VERBOSE = "true";
|
|
12078
|
-
console.log(
|
|
12079
|
-
}
|
|
12080
|
-
var { exitCode } = await cliYes(
|
|
12081
|
-
cli: cliName || argv.cli || argv._[0]?.toString()?.replace?.(/-yes$/, "") || phpdie_default2("missing cli def"),
|
|
12082
|
-
cliArgs: cliArgsForSpawn,
|
|
12083
|
-
prompt: [argv.prompt, dashPrompt].join(" ").trim() || undefined,
|
|
12084
|
-
exitOnIdle: Number((argv.exitOnIdle || argv.idle)?.replace(/.*/, (e) => String(index_default(e))) || 0),
|
|
12085
|
-
queue: argv.queue,
|
|
12086
|
-
robust: argv.robust,
|
|
12087
|
-
logFile: argv.logFile,
|
|
12088
|
-
verbose: argv.verbose
|
|
12089
|
-
});
|
|
12096
|
+
console.log(config2);
|
|
12097
|
+
}
|
|
12098
|
+
var { exitCode } = await cliYes(config2);
|
|
12090
12099
|
process.exit(exitCode ?? 1);
|
|
12091
12100
|
|
|
12092
|
-
//# debugId=
|
|
12101
|
+
//# debugId=E45F0C460719CB9D64756E2164756E21
|
|
12093
12102
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js
CHANGED
|
@@ -12021,73 +12021,82 @@ function isYargsInstance(y) {
|
|
|
12021
12021
|
var Yargs = YargsFactory(esm_default);
|
|
12022
12022
|
var yargs_default = Yargs;
|
|
12023
12023
|
|
|
12024
|
+
// ts/parseCliArgs.ts
|
|
12025
|
+
function parseCliArgs(argv) {
|
|
12026
|
+
const cliName = ((e) => {
|
|
12027
|
+
if (e === "cli" || e === "cli.ts")
|
|
12028
|
+
return;
|
|
12029
|
+
return e;
|
|
12030
|
+
})(argv[1]?.split("/").pop()?.split("-")[0]);
|
|
12031
|
+
const parsedArgv = yargs_default(hideBin(argv)).usage("Usage: $0 [cli] [cli-yes args] [agent-cli args] [--] [prompts...]").example("$0 claude --idle=30s -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout, and the prompt is everything after `--`").option("robust", {
|
|
12032
|
+
type: "boolean",
|
|
12033
|
+
default: true,
|
|
12034
|
+
description: "re-spawn Claude with --continue if it crashes, only works for claude yet",
|
|
12035
|
+
alias: "r"
|
|
12036
|
+
}).option("logFile", {
|
|
12037
|
+
type: "string",
|
|
12038
|
+
description: "Rendered log file to write to."
|
|
12039
|
+
}).option("prompt", {
|
|
12040
|
+
type: "string",
|
|
12041
|
+
description: "Prompt to send to Claude (also can be passed after --)",
|
|
12042
|
+
alias: "p"
|
|
12043
|
+
}).option("verbose", {
|
|
12044
|
+
type: "boolean",
|
|
12045
|
+
description: "Enable verbose logging, will emit ./agent-yes.log",
|
|
12046
|
+
default: false
|
|
12047
|
+
}).option("exit-on-idle", {
|
|
12048
|
+
type: "string",
|
|
12049
|
+
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12050
|
+
deprecated: "use --idle instead",
|
|
12051
|
+
default: "60s",
|
|
12052
|
+
alias: "e"
|
|
12053
|
+
}).option("idle", {
|
|
12054
|
+
type: "string",
|
|
12055
|
+
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12056
|
+
alias: "i"
|
|
12057
|
+
}).option("queue", {
|
|
12058
|
+
type: "boolean",
|
|
12059
|
+
description: "Queue Agent when spawning multiple agents in the same directory/repo, can be disabled with --no-queue",
|
|
12060
|
+
default: true
|
|
12061
|
+
}).positional("cli", {
|
|
12062
|
+
describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
|
|
12063
|
+
type: "string",
|
|
12064
|
+
choices: SUPPORTED_CLIS,
|
|
12065
|
+
demandOption: false,
|
|
12066
|
+
default: cliName
|
|
12067
|
+
}).help().version().parserConfiguration({
|
|
12068
|
+
"unknown-options-as-args": true,
|
|
12069
|
+
"halt-at-non-option": true
|
|
12070
|
+
}).parseSync();
|
|
12071
|
+
const optionalIndex = (e) => 0 <= e ? e : undefined;
|
|
12072
|
+
const rawArgs = argv.slice(2);
|
|
12073
|
+
const cliArgIndex = optionalIndex(rawArgs.indexOf(String(parsedArgv._[0])));
|
|
12074
|
+
const dashIndex = optionalIndex(rawArgs.indexOf("--"));
|
|
12075
|
+
const cliArgsForSpawn = parsedArgv._[0] ? rawArgs.slice(cliArgIndex ?? 0, dashIndex ?? undefined) : [];
|
|
12076
|
+
const dashPrompt = dashIndex ? rawArgs.slice(dashIndex + 1).join(" ") : undefined;
|
|
12077
|
+
return {
|
|
12078
|
+
cli: cliName || parsedArgv.cli || parsedArgv._[0]?.toString()?.replace?.(/-yes$/, ""),
|
|
12079
|
+
cliArgs: cliArgsForSpawn,
|
|
12080
|
+
prompt: [parsedArgv.prompt, dashPrompt].join(" ").trim() || undefined,
|
|
12081
|
+
exitOnIdle: Number((parsedArgv.idle || parsedArgv.exitOnIdle)?.replace(/.*/, (e) => String(index_default(e))) || 0),
|
|
12082
|
+
queue: parsedArgv.queue,
|
|
12083
|
+
robust: parsedArgv.robust,
|
|
12084
|
+
logFile: parsedArgv.logFile,
|
|
12085
|
+
verbose: parsedArgv.verbose
|
|
12086
|
+
};
|
|
12087
|
+
}
|
|
12088
|
+
|
|
12024
12089
|
// ts/cli.ts
|
|
12025
|
-
var
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
var argv = yargs_default(hideBin(process.argv)).usage("Usage: $0 [cli] [cli-yes args] [agent-cli args] [--] [prompts...]").example("$0 claude --idle=30s -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout, and the prompt is everything after `--`").option("robust", {
|
|
12031
|
-
type: "boolean",
|
|
12032
|
-
default: true,
|
|
12033
|
-
description: "re-spawn Claude with --continue if it crashes, only works for claude yet",
|
|
12034
|
-
alias: "r"
|
|
12035
|
-
}).option("logFile", {
|
|
12036
|
-
type: "string",
|
|
12037
|
-
description: "Rendered log file to write to."
|
|
12038
|
-
}).option("prompt", {
|
|
12039
|
-
type: "string",
|
|
12040
|
-
description: "Prompt to send to Claude (also can be passed after --)",
|
|
12041
|
-
alias: "p"
|
|
12042
|
-
}).option("verbose", {
|
|
12043
|
-
type: "boolean",
|
|
12044
|
-
description: "Enable verbose logging, will emit ./agent-yes.log",
|
|
12045
|
-
default: false
|
|
12046
|
-
}).option("exit-on-idle", {
|
|
12047
|
-
type: "string",
|
|
12048
|
-
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12049
|
-
deprecated: "use --idle instead",
|
|
12050
|
-
default: "60s",
|
|
12051
|
-
alias: "e"
|
|
12052
|
-
}).option("idle", {
|
|
12053
|
-
type: "string",
|
|
12054
|
-
description: 'Exit after a period of inactivity, e.g., "5s" or "1m"',
|
|
12055
|
-
alias: "i"
|
|
12056
|
-
}).option("queue", {
|
|
12057
|
-
type: "boolean",
|
|
12058
|
-
description: "Queue Agent when spawning multiple agents in the same directory/repo, can be disabled with --no-queue",
|
|
12059
|
-
default: true
|
|
12060
|
-
}).positional("cli", {
|
|
12061
|
-
describe: "The AI CLI to run, e.g., claude, codex, copilot, cursor, gemini",
|
|
12062
|
-
type: "string",
|
|
12063
|
-
choices: SUPPORTED_CLIS,
|
|
12064
|
-
demandOption: false,
|
|
12065
|
-
default: cliName
|
|
12066
|
-
}).help().version().parserConfiguration({
|
|
12067
|
-
"unknown-options-as-args": true,
|
|
12068
|
-
"halt-at-non-option": true
|
|
12069
|
-
}).parseSync();
|
|
12070
|
-
var optionalIndex = (e) => 0 <= e ? e : undefined;
|
|
12071
|
-
var rawArgs = process.argv.slice(2);
|
|
12072
|
-
var cliArgIndex = optionalIndex(rawArgs.indexOf(String(argv._[0])));
|
|
12073
|
-
var dashIndex = optionalIndex(rawArgs.indexOf("--"));
|
|
12074
|
-
var cliArgsForSpawn = argv._[0] ? rawArgs.slice(cliArgIndex ?? 0, dashIndex ?? undefined) : [];
|
|
12075
|
-
var dashPrompt = dashIndex ? rawArgs.slice(dashIndex + 1).join(" ") : undefined;
|
|
12076
|
-
if (argv.verbose) {
|
|
12090
|
+
var config2 = parseCliArgs(process.argv);
|
|
12091
|
+
if (!config2.cli) {
|
|
12092
|
+
phpdie_default2("missing cli def");
|
|
12093
|
+
}
|
|
12094
|
+
if (config2.verbose) {
|
|
12077
12095
|
process.env.VERBOSE = "true";
|
|
12078
|
-
console.log(
|
|
12079
|
-
}
|
|
12080
|
-
var { exitCode } = await cliYes(
|
|
12081
|
-
cli: cliName || argv.cli || argv._[0]?.toString()?.replace?.(/-yes$/, "") || phpdie_default2("missing cli def"),
|
|
12082
|
-
cliArgs: cliArgsForSpawn,
|
|
12083
|
-
prompt: [argv.prompt, dashPrompt].join(" ").trim() || undefined,
|
|
12084
|
-
exitOnIdle: Number((argv.exitOnIdle || argv.idle)?.replace(/.*/, (e) => String(index_default(e))) || 0),
|
|
12085
|
-
queue: argv.queue,
|
|
12086
|
-
robust: argv.robust,
|
|
12087
|
-
logFile: argv.logFile,
|
|
12088
|
-
verbose: argv.verbose
|
|
12089
|
-
});
|
|
12096
|
+
console.log(config2);
|
|
12097
|
+
}
|
|
12098
|
+
var { exitCode } = await cliYes(config2);
|
|
12090
12099
|
process.exit(exitCode ?? 1);
|
|
12091
12100
|
|
|
12092
|
-
//# debugId=
|
|
12101
|
+
//# debugId=E45F0C460719CB9D64756E2164756E21
|
|
12093
12102
|
//# sourceMappingURL=cli.js.map
|