From 8e641f6e246e154e7a0571806f16d94b3abb267e Mon Sep 17 00:00:00 2001 From: Alexzhu Date: Fri, 12 Jun 2026 09:09:37 +0800 Subject: [PATCH] fix(scripts): add --help to agent-batch/launch (#3544) Co-authored-by: alexzhu0 --- scripts/agent-batch/launch.mjs | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/scripts/agent-batch/launch.mjs b/scripts/agent-batch/launch.mjs index 2f9976c66..960fa0c9c 100755 --- a/scripts/agent-batch/launch.mjs +++ b/scripts/agent-batch/launch.mjs @@ -59,8 +59,39 @@ Tracking: progress for this batch is reported on issue #${spec.tracking_issue}. `; } +/** + * Returns formatted help text for the agent-batch launch CLI. + * + * Describes the script's purpose, required arguments, and available options. + * The operator uses this tool to generate launch comments that are pasted + * into Cursor as agent prompts. + * + * @returns {string} Multi-line help text describing usage, arguments, and flags. + */ +function usage() { + return [ + 'Usage: node scripts/agent-batch/launch.mjs [options]', + '', + 'Print one launch comment per agent in the batch. The operator pastes each', + 'into Cursor as the agent prompt.', + '', + 'Arguments:', + ' Path to the batch specification file.', + '', + 'Options:', + ' --agent Print only the agent with this id (default: all agents).', + ' --print-only Print launch comments (default and only mode currently).', + ' -h, --help Show this help and exit.', + ].join('\n'); +} + function main() { - const { positional, flags } = parseArgs(process.argv.slice(2)); + const argv = process.argv.slice(2); + if (argv.includes('--help') || argv.includes('-h')) { + console.log(usage()); + process.exit(0); + } + const { positional, flags } = parseArgs(argv); const specPath = positional[0]; if (!specPath) { process.stderr.write(