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

Function runList

src/commands/agent.ts:674–694  ·  view source on GitHub ↗
(opts: CommonOptions, deps: AgentDeps = {})

Source from the content-addressed store, hash-verified

672}
673
674export async function runList(opts: CommonOptions, deps: AgentDeps = {}): Promise<void> {
675 const out = makeOutput(opts.output, deps);
676
677 const results: ListResult[] = (
678 Object.entries(TARGETS) as [AgentTarget, { status: string; mode: string; path: string }][]
679 ).map(([t, spec]) => ({
680 target: t,
681 status: spec.status,
682 mode: spec.mode,
683 path: spec.path,
684 }));
685
686 out.print(results, data => {
687 const items = data as ListResult[];
688 const header = `${'TARGET'.padEnd(14)} ${'STATUS'.padEnd(12)} ${'MODE'.padEnd(18)} PATH`;
689 const rows = items.map(
690 r => `${r.target.padEnd(14)} ${r.status.padEnd(12)} ${r.mode.padEnd(18)} ${r.path}`,
691 );
692 return [header, ...rows].join('\n');
693 });
694}
695
696// ---------------------------------------------------------------------------
697// Command factory

Callers 1

createAgentCommandFunction · 0.70

Calls 2

printMethod · 0.80
makeOutputFunction · 0.70

Tested by

no test coverage detected