MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / createAgentCommand

Function createAgentCommand

src/commands/agent.ts:704–750  ·  view source on GitHub ↗
(deps: AgentDeps = {})

Source from the content-addressed store, hash-verified

702}
703
704export 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)

Callers 2

index.tsFile · 0.85
agent.test.tsFile · 0.85

Calls 3

runInstallFunction · 0.85
resolveCommonOptionsFunction · 0.70
runListFunction · 0.70

Tested by

no test coverage detected