diff --git a/gitnexus/src/cli/wiki.ts b/gitnexus/src/cli/wiki.ts index 833338f61..6230a3fff 100644 --- a/gitnexus/src/cli/wiki.ts +++ b/gitnexus/src/cli/wiki.ts @@ -339,8 +339,13 @@ export const wikiCommand = async ( console.log(`\n Tree saved to: ${treeFile}`); console.log(' You can edit this file to remove/rename modules.\n'); - // Ask for confirmation - const answer = await prompt(' Continue with generation? (Y/n/edit): '); + // Ask for confirmation (auto-continue in non-interactive environments) + if (!process.stdin.isTTY) { + console.log(' Non-interactive mode — auto-continuing with generation.\n'); + } + const answer = process.stdin.isTTY + ? await prompt(' Continue with generation? (Y/n/edit): ') + : 'y'; const choice = answer.trim().toLowerCase(); if (choice === 'n' || choice === 'no') { @@ -465,7 +470,7 @@ export const wikiCommand = async ( } } else { console.log(`\n Error: ${err.message}\n`); - if (process.env.DEBUG) { + if (process.env.GITNEXUS_VERBOSE) { console.error(err); } } diff --git a/gitnexus/test/integration/cli-e2e.test.ts b/gitnexus/test/integration/cli-e2e.test.ts index 94edb1590..8bfd05171 100644 --- a/gitnexus/test/integration/cli-e2e.test.ts +++ b/gitnexus/test/integration/cli-e2e.test.ts @@ -305,13 +305,11 @@ describe('CLI end-to-end', () => { expect(combined).not.toMatch(/API key:/); }); - it('wiki --verbose sets GITNEXUS_VERBOSE env', () => { - // --verbose should be accepted as a valid flag (not rejected by Commander) + it('wiki --help includes --verbose flag description', () => { const result = runCliRaw(['wiki', '--help'], repoRoot); if (result.status === null) return; expect(result.status).toBe(0); - // Confirm the flag description is present expect(result.stdout).toMatch(/verbose/i); }); });