Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ minimax text chat --message "Hi" --output json | jq . # pipe-friendly
minimax config export-schema | jq . # tool schemas
```

## Changelog

### v0.5.0
- **Brand status bar**: HTTP requests now print a beautiful true-color status bar showing `MINIMAX Region: CN | Key: sk-c...nI7s | Model: MiniMax-M2.7` in MiniMax brand colors (blue, purple, cyan, pink)
- Status bar respects `--quiet` flag and only renders in TTY terminals
- Removed duplicate `[Model: ...]` output from `text chat` command

### v0.1.0
- Initial release — text, image, video, speech, music, vision, and search commands

## Output Philosophy

- `stdout` → data only (text, paths, JSON)
Expand Down
35 changes: 35 additions & 0 deletions src/client/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,41 @@ export async function request(
process.stderr.write(`> ${opts.method || 'GET'} ${opts.url}\n`);
process.stderr.write(`> Auth: ${credential.token.slice(0, 8)}...\n`);
}

// ANSI 真彩色 (24-bit) 与基础排版
if (!config.quiet && process.stderr.isTTY) {
const reset = '\x1b[0m';
const dim = '\x1b[2m';
const bold = '\x1b[1m'; // 新增加粗效果

// 从 MiniMax Logo/品牌视觉提取的 RGB 颜色
const mmBlue = '\x1b[38;2;43;82;255m'; // 主品牌色:MiniMax 科技蓝 (#2B52FF)
const mmPurple = '\x1b[38;2;147;51;234m'; // 辅助品牌色:活力紫 (#9333EA)
const mmCyan = '\x1b[38;2;6;184;212m'; // 点缀色:青色 (#06B8D4)
const mmPink = '\x1b[38;2;236;72;153m'; // 点缀色:粉红 (#EC4899)

// 提取 Region (根据 baseUrl 推断)
const region = config.baseUrl.includes('minimaxi.com') ? 'CN' : 'Global';

// 提取脱敏的 Key
const token = credential.token;
const maskedKey = token.length > 8 ? `${token.slice(0, 4)}...${token.slice(-4)}` : '***';

// 尝试从 body 中提取 Model
let modelStr = '';
if (opts.body && typeof opts.body === 'object' && 'model' in opts.body) {
modelStr = ` ${dim}|${reset} ${dim}Model:${reset} ${mmPurple}${(opts.body as any).model}${reset}`;
}

// 打印带有完整 MINIMAX 标识的状态栏
process.stderr.write(
`${bold}${mmBlue}MINIMAX${reset} ` +
`${dim}Region:${reset} ${mmCyan}${region}${reset} ` +
`${dim}|${reset} ` +
`${dim}Key:${reset} ${mmPink}${maskedKey}${reset}` +
`${modelStr}\n`
);
}
}

const timeoutMs = (opts.timeout || config.timeout) * 1000;
Expand Down
7 changes: 0 additions & 7 deletions src/commands/text/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ export default defineCommand({
const url = chatEndpoint(config.baseUrl);

if (shouldStream) {
if (!config.quiet) {
process.stderr.write(`[Model: ${model}]\n`);
}
const res = await request(config, {
url,
method: 'POST',
Expand Down Expand Up @@ -214,10 +211,6 @@ export default defineCommand({

const text = extractText(response.content);

if (!config.quiet && format === 'text') {
process.stderr.write(`[Model: ${response.model || model}]\n`);
}

if (config.quiet || format === 'text') {
console.log(text);
} else {
Expand Down