(deps: AgentDeps = {})
| 702 | } |
| 703 | |
| 704 | export function createAgentCommand(deps: AgentDeps = {}): Command { |
| 705 | const agent = new Command('agent').description( |
| 706 | 'Install TestSprite guidance into coding-agent config (Claude Code, Cursor, Cline, Antigravity, Codex)', |
| 707 | ); |
| 708 | |
| 709 | agent |
| 710 | .command('install') |
| 711 | .description( |
| 712 | 'Write the TestSprite verification-loop skill file into a project for a coding agent', |
| 713 | ) |
| 714 | .option( |
| 715 | '--target <t>', |
| 716 | 'Agent target(s): claude, cursor, cline, antigravity, codex (comma-separated or repeated)', |
| 717 | collect, |
| 718 | [], |
| 719 | ) |
| 720 | .option('--dir <path>', 'Project root to write into (default: cwd)') |
| 721 | .option( |
| 722 | '--force', |
| 723 | 'For own-file targets: overwrite existing file (a .bak backup is kept). ' + |
| 724 | 'For codex (managed-section): replaces the section unconditionally; user content outside the section is never destroyed.', |
| 725 | ) |
| 726 | .addHelpText('after', GLOBAL_OPTS_HINT) |
| 727 | .action( |
| 728 | async (cmdOpts: { target: string[]; dir?: string; force?: boolean }, command: Command) => { |
| 729 | await runInstall( |
| 730 | { |
| 731 | ...resolveCommonOptions(command), |
| 732 | target: cmdOpts.target, |
| 733 | dir: cmdOpts.dir, |
| 734 | force: Boolean(cmdOpts.force), |
| 735 | }, |
| 736 | deps, |
| 737 | ); |
| 738 | }, |
| 739 | ); |
| 740 | |
| 741 | agent |
| 742 | .command('list') |
| 743 | .description('List supported agent targets, their status, and landing paths') |
| 744 | .addHelpText('after', GLOBAL_OPTS_HINT) |
| 745 | .action(async (_o, command: Command) => { |
| 746 | await runList(resolveCommonOptions(command), deps); |
| 747 | }); |
| 748 | |
| 749 | return agent; |
| 750 | } |
| 751 | |
| 752 | // --------------------------------------------------------------------------- |
| 753 | // Per-file helpers (per convention: copy from auth.ts) |
no test coverage detected