MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / createProgram

Function createProgram

cli/src/index.ts:18–41  ·  view source on GitHub ↗
(context: CliContext)

Source from the content-addressed store, hash-verified

16
17const require = createRequire(import.meta.url);
18const packageJson = require('../package.json') as { version: string };
19
20export function createProgram(context: CliContext): Command {
21 const program = new Command();
22
23 program
24 .name('mslearn')
25 .description('CLI for the Microsoft Learn MCP server.')
26 .version(context.version)
27 .addOption(new Option('--endpoint <url>', 'Override the Learn MCP endpoint for this command.').hideHelp())
28 .showHelpAfterError()
29 .configureOutput({
30 writeOut: context.writeOut,
31 writeErr: context.writeErr,
32 outputError: (value, write) => {
33 write(value);
34 },
35 });
36
37 registerSearchCommand(program, context);
38 registerFetchCommand(program, context);
39 registerCodeSearchCommand(program, context);
40 registerDoctorCommand(program, context);
41 registerSetupCommand(program, context);
42 registerRemoveCommand(program, context);
43
44 return program;

Callers 1

runCliFunction · 0.85

Calls 4

registerSearchCommandFunction · 0.85
registerFetchCommandFunction · 0.85
registerDoctorCommandFunction · 0.85

Tested by

no test coverage detected