| 167 | } |
| 168 | |
| 169 | private printRootHelp(out: NodeJS.WriteStream): void { |
| 170 | // MiniMax brand gradient: #F0177A (pink) → #FA7B2A (orange), one color per row |
| 171 | const LOGO = [ |
| 172 | '███╗ ███╗███╗ ███╗██╗ ██╗', |
| 173 | '████╗ ████║████╗ ████║╚██╗██╔╝', |
| 174 | '██╔████╔██║██╔████╔██║ ╚███╔╝ ', |
| 175 | '██║╚██╔╝██║██║╚██╔╝██║ ██╔██╗ ', |
| 176 | '██║ ╚═╝ ██║██║ ╚═╝ ██║██╔╝ ██╗', |
| 177 | '╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝', |
| 178 | ]; |
| 179 | const GRADIENT: [number, number, number][] = [ |
| 180 | [240, 23, 122], |
| 181 | [242, 43, 106], |
| 182 | [244, 63, 90], |
| 183 | [246, 83, 74], |
| 184 | [248, 103, 58], |
| 185 | [250, 123, 42], |
| 186 | ]; |
| 187 | |
| 188 | out.write('\n'); |
| 189 | for (let i = 0; i < LOGO.length; i++) { |
| 190 | if (out.isTTY) { |
| 191 | const [r, g, b] = GRADIENT[i]; |
| 192 | out.write(`\x1b[1;38;2;${r};${g};${b}m${LOGO[i]}\x1b[0m\n`); |
| 193 | } else { |
| 194 | out.write(LOGO[i] + '\n'); |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | const b = (s: string) => this.bold(s, out); |
| 199 | const a = (s: string) => this.accent(s, out); |
| 200 | const d = (s: string) => this.dim(s, out); |
| 201 | |
| 202 | out.write(` |
| 203 | ${b('Usage:')} mmx <resource> <command> [flags] |
| 204 | |
| 205 | ${b('Resources:')} |
| 206 | ${a('auth')} ${d('Authentication (login, status, refresh, logout)')} |
| 207 | ${a('text')} ${d('Text generation (chat)')} |
| 208 | ${a('speech')} ${d('Speech synthesis (synthesize, voices)')} |
| 209 | ${a('image')} ${d('Image generation (generate)')} |
| 210 | ${a('video')} ${d('Video generation (generate, task get, download)')} |
| 211 | ${a('music')} ${d('Music generation (generate, cover)')} |
| 212 | ${a('search')} ${d('Web search (query)')} |
| 213 | ${a('vision')} ${d('Image understanding (describe)')} |
| 214 | ${a('quota')} ${d('Usage quotas (show)')} |
| 215 | ${a('config')} ${d('CLI configuration (show, set, export-schema)')} |
| 216 | ${a('file')} ${d('File storage (upload, list, delete)')} |
| 217 | ${a('update')} ${d('Update mmx to a newer version')} |
| 218 | |
| 219 | ${b('Global Flags:')} |
| 220 | ${a('--api-key <key>')} ${d('API key (overrides all other auth)')} |
| 221 | ${a('--region <region>')} ${d('API region: global (default), cn')} |
| 222 | ${a('--base-url <url>')} ${d('API base URL (overrides region)')} |
| 223 | ${a('--output <format>')} ${d('Output format: text, json')} |
| 224 | ${a('--quiet')} ${d('Suppress non-essential output')} |
| 225 | ${a('--verbose')} ${d('Print HTTP request/response details')} |
| 226 | ${a('--timeout <seconds>')} ${d('Request timeout (default: 300)')} |