@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
14 lines • 3.65 kB
JavaScript
import handlers from './index.js';
import hooks from '../../hooks/index.js';
const registerSharedAiOptions = command => command.option('--agent-file <path>', 'Override the generated Atlas AI workspace agent path.').option('--output <path>', 'Override the generated Copilot instructions file path.').option('--lock-file <path>', 'Override the generated Atlas AI lock file path.').option('--shared-package <name>', 'Override the shared Atlas AI package name used for discovery.');
const registerAiAuthoringOptions = command => command.requiredOption('--type <type>', 'Atlas AI doc type: symbol or guide.').requiredOption('--name <value>', 'Symbol name or guide seed used to derive the new Atlas AI doc.').option('--title <value>', 'Guide title override for new guide docs.').option('--summary <value>', 'Summary override for the scaffolded Atlas AI doc.').option('--entrypoint <path>', 'Entrypoint exported by the owning Atlas package.').option('--kind <kind>', 'Symbol kind for new symbol docs, for example component or hook.').option('--scope <scope>', 'Guide scope for new guide docs.').option('--package-dir <path>', 'Package directory that owns the new Atlas AI doc.').option('--output <path>', 'Override the generated Atlas AI doc path.').option('--dry-run', 'Preview the scaffolded Atlas AI doc without writing it.').option('--force', 'Overwrite an existing Atlas AI doc at the target path.').option('--shared-package <name>', 'Override the shared Atlas AI package name used for template discovery.');
const registerAiCommands = program => {
const ai = program.command('ai').description('Atlas AI context lifecycle commands.');
registerSharedAiOptions(ai.command('init').description('Initialize generated Atlas AI wiring from installed packages.').option('--dry-run', 'Preview generated Atlas AI files without writing them.').option('--force', 'Overwrite existing generated Atlas AI files.')).action(handlers.init).hook('preAction', hooks.versionCheck);
registerSharedAiOptions(ai.command('sync').description('Refresh generated Atlas AI wiring from installed packages.').option('--dry-run', 'Preview Atlas AI updates without writing them.')).action(handlers.sync).hook('preAction', hooks.versionCheck);
registerSharedAiOptions(ai.command('verify').description('Verify Atlas AI wiring against the installed Atlas packages.').option('--json', 'Print the Atlas AI verification result as JSON.').option('--policy-mode <mode>', 'Override the Atlas AI verification policy mode: localDevelopment, ci, or release.').option('--strict', 'Report installed Atlas packages that are not yet covered by the shared AI manifest.')).action(handlers.verify).hook('preAction', hooks.versionCheck);
registerSharedAiOptions(ai.command('resolve').description('Resolve the most relevant Atlas package guidance for a task or prompt.').requiredOption('--query <value>', 'Task, question, or prompt to resolve against Atlas context.').option('--json', 'Print the Atlas AI resolve result as JSON.').option('--limit <number>', 'Limit the number of matches returned.', value => Number.parseInt(value, 10)).option('--scope <scope>', 'Optional Atlas routing scope hint, for example forms or logging.').option('--explain', 'Include detailed scoring reasons in the resolve result.').option('--snapshot-only', 'Restrict resolve behavior to snapshot-first matching.')).action(handlers.resolve).hook('preAction', hooks.versionCheck);
registerAiAuthoringOptions(ai.command('new').description('Scaffold a draft Atlas AI symbol or guide doc for a package owner.')).action(handlers.create).hook('preAction', hooks.versionCheck);
return ai;
};
export default registerAiCommands;