MCPcopy
hub / github.com/MiniMax-AI/cli / printHelp

Method printHelp

src/registry.ts:140–167  ·  view source on GitHub ↗
(commandPath: string[], out: NodeJS.WriteStream = process.stdout, region: Region = 'global')

Source from the content-addressed store, hash-verified

138 private dim = (s: string, out: NodeJS.WriteStream) => out.isTTY ? `\x1b[2m${s}\x1b[0m` : s;
139
140 printHelp(commandPath: string[], out: NodeJS.WriteStream = process.stdout, region: Region = 'global'): void {
141 if (commandPath.length === 0) {
142 this.printRootHelp(out);
143 return;
144 }
145
146 let node = this.root;
147 for (const part of commandPath) {
148 const child = node.children.get(part);
149 if (!child) {
150 this.printRootHelp(out);
151 return;
152 }
153 node = child;
154 }
155
156 if (node.command) {
157 this.printCommandHelp(node.command, out, region);
158 return;
159 }
160
161 // Group help (e.g. `mmx auth --help`)
162 const prefix = commandPath.join(' ');
163 out.write(`\n${this.bold('Usage:', out)} mmx ${prefix} <command> [flags]\n\n`);
164 out.write(`${this.bold('Commands:', out)}\n`);
165 this.printChildren(node, prefix, out);
166 out.write('\n');
167 }
168
169 private printRootHelp(out: NodeJS.WriteStream): void {
170 // MiniMax brand gradient: #F0177A (pink) → #FA7B2A (orange), one color per row

Callers 2

mainFunction · 0.80
showDashboardAfterLoginFunction · 0.80

Calls 3

printRootHelpMethod · 0.95
printCommandHelpMethod · 0.95
printChildrenMethod · 0.95

Tested by

no test coverage detected