From 5b02333232d58cfdcb6dc7b78b2a67b86e8e4299 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Mon, 13 Apr 2026 19:55:43 +0200 Subject: [PATCH] Improve discoverability of review-bot workflows in CLI help Operators asked for easier branch/PR automation discovery from the default status/help surface. This adds a dedicated AGENT BOT section to both rich and plain output and locks it with install tests. Constraint: Keep existing command catalog output and formatting stable Rejected: Hide these commands under docs-only guidance | users requested in-CLI discoverability Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep AGENT BOT command docs in sync with review-bot-watch behavior changes Tested: node --check bin/multiagent-safety.js Tested: node --test --test-name-pattern 'default invocation runs non-mutating status output' test/install.test.js Not-tested: full node --test test/*.test.js suite --- bin/multiagent-safety.js | 31 +++++++++++++++++++++++++++++++ test/install.test.js | 5 +++++ 2 files changed, 36 insertions(+) diff --git a/bin/multiagent-safety.js b/bin/multiagent-safety.js index ab76f43..ba81bef 100755 --- a/bin/multiagent-safety.js +++ b/bin/multiagent-safety.js @@ -147,6 +147,10 @@ const CLI_COMMAND_DESCRIPTIONS = [ ['help', 'Show this help output'], ['version', 'Print GuardeX version'], ]; +const AGENT_BOT_DESCRIPTIONS = [ + ['review', 'Monitor open PRs targeting current branch and dispatch codex-agent review flow'], + ['start', 'bash scripts/review-bot-watch.sh --interval 30'], +]; const AI_SETUP_PROMPT = `Use this exact checklist to setup GuardeX (Guardian T-Rex for your repo) in this repository for Codex or Claude. @@ -261,9 +265,20 @@ function commandCatalogLines(indent = ' ') { ); } +function agentBotCatalogLines(indent = ' ') { + const maxCommandLength = AGENT_BOT_DESCRIPTIONS.reduce( + (max, [command]) => Math.max(max, command.length), + 0, + ); + return AGENT_BOT_DESCRIPTIONS.map( + ([command, description]) => `${indent}${command.padEnd(maxCommandLength + 2)}${description}`, + ); +} + function printToolLogsSummary() { const usageLine = ` $ ${SHORT_TOOL_NAME} [options]`; const commandDetails = commandCatalogLines(' '); + const agentBotDetails = agentBotCatalogLines(' '); if (!supportsAnsiColors()) { console.log(`${TOOL_NAME}-tools logs:`); @@ -273,12 +288,17 @@ function printToolLogsSummary() { for (const line of commandDetails) { console.log(line); } + console.log(' AGENT BOT'); + for (const line of agentBotDetails) { + console.log(line); + } return; } const title = colorize(`${TOOL_NAME}-tools logs`, '1;36'); const usageHeader = colorize('USAGE', '1'); const commandsHeader = colorize('COMMANDS', '1'); + const agentBotHeader = colorize('AGENT BOT', '1'); const pipe = colorize('│', '90'); const tee = colorize('├', '90'); const corner = colorize('└', '90'); @@ -294,6 +314,14 @@ function printToolLogsSummary() { } console.log(` ${pipe}${line.slice(2)}`); } + console.log(` ${tee}─ ${agentBotHeader}`); + for (const line of agentBotDetails) { + if (!line) { + console.log(` ${pipe}`); + continue; + } + console.log(` ${pipe}${line.slice(2)}`); + } console.log(` ${corner}─ ${colorize(`Try '${TOOL_NAME} doctor' for one-step repair + verification.`, '2')}`); } @@ -311,6 +339,9 @@ USAGE COMMANDS ${commandCatalogLines().join('\n')} +AGENT BOT +${agentBotCatalogLines().join('\n')} + NOTES - Running ${TOOL_NAME} with no command defaults to: ${SHORT_TOOL_NAME} status - Short alias: ${SHORT_TOOL_NAME} diff --git a/test/install.test.js b/test/install.test.js index bdaee80..a146a3d 100644 --- a/test/install.test.js +++ b/test/install.test.js @@ -797,6 +797,11 @@ test('default invocation runs non-mutating status output', () => { assert.match(result.stdout, /guardex-tools logs:/); assert.match(result.stdout, /USAGE\n\s+\$ gx \[options\]/); assert.match(result.stdout, /COMMANDS\n\s+status\s+Show GuardeX CLI \+ service health without modifying files/); + assert.match( + result.stdout, + /AGENT BOT\n\s+review\s+Monitor open PRs targeting current branch and dispatch codex-agent review flow/, + ); + assert.match(result.stdout, /AGENT BOT[\s\S]*\n\s+start\s+bash scripts\/review-bot-watch\.sh --interval 30/); assert.equal(fs.existsSync(path.join(repoDir, '.githooks', 'pre-commit')), false); });