import { homedir } from 'node:os';
import { resolve } from 'node:path';
import { isInteractive } from '../config/runtime.js';
import { createLogger } from '../ui/logger.js';
export function buildCommandContext(options) {
    const json = options.json ?? false;
    const verbose = options.verbose ?? false;
    return {
        scope: options.scope ?? 'all',
        dryRun: options.dryRun ?? false,
        verbose,
        json,
        cwd: resolve(options.cwd ?? process.cwd()),
        home: homedir(),
        interactive: isInteractive(json),
        logger: createLogger({ json, verbose }),
    };
}
