feat(cli): add --verbose flag for stderr warnings

Sets CODEBURN_VERBOSE=1 via commander preAction, which the fs-utils
helpers check before emitting stderr lines on skipped or failed reads.
Closes LOW-1 from the 2026-04-16 audit.
This commit is contained in:
Ninym 2026-04-17 08:12:09 +02:00
parent 646635c262
commit 8f5927153e

View file

@ -78,8 +78,12 @@ const program = new Command()
.name('codeburn')
.description('See where your AI coding tokens go - by task, tool, model, and project')
.version(version)
.option('--verbose', 'print warnings to stderr on read failures and skipped files')
program.hook('preAction', async () => {
program.hook('preAction', async (thisCommand) => {
if (thisCommand.opts<{ verbose?: boolean }>().verbose) {
process.env['CODEBURN_VERBOSE'] = '1'
}
await loadCurrency()
})