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

Function createUsageCommand

src/commands/usage.ts:190–211  ·  view source on GitHub ↗
(deps: UsageDeps = {})

Source from the content-addressed store, hash-verified

188}
189
190export function createUsageCommand(deps: UsageDeps = {}): Command {
191 const cmd = new Command('usage')
192 .alias('credits')
193 .description(
194 'Show credit balance and plan/entitlement info (proactive pre-flight before a large test run)',
195 )
196 .addHelpText('after', GLOBAL_OPTS_HINT)
197 .addHelpText(
198 'after',
199 '\nExamples:\n' +
200 ' testsprite usage # show balance + plan\n' +
201 ' testsprite usage --output json # machine-readable balance\n' +
202 ' testsprite credits # alias for usage\n' +
203 '\nNote: credit balance requires a backend update to /me. Until shipped,\n' +
204 " check your portal's Billing page (/dashboard/settings/billing) for your balance.",
205 )
206 .action(async (_cmdOpts, command: Command) => {
207 await runUsage(resolveCommonOptions(command), deps);
208 });
209
210 return cmd;
211}
212
213function resolveCommonOptions(command: Command): CommonOptions {
214 const globals = command.optsWithGlobals() as Partial<CommonOptions> & {

Callers 2

index.tsFile · 0.85
usage.test.tsFile · 0.85

Calls 2

runUsageFunction · 0.85
resolveCommonOptionsFunction · 0.70

Tested by

no test coverage detected