coder-config 0.45.7 → 0.45.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +16 -32
- package/lib/constants.js +1 -1
- package/package.json +2 -1
package/lib/cli.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const os = require('os');
|
|
8
|
+
const chalk = require('chalk');
|
|
8
9
|
const { VERSION, TOOL_PATHS } = require('./constants');
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -323,39 +324,22 @@ function runCli(manager) {
|
|
|
323
324
|
function printHelp() {
|
|
324
325
|
const showLoops = isRalphLoopsEnabled();
|
|
325
326
|
|
|
326
|
-
// ANSI color codes
|
|
327
|
-
const c = {
|
|
328
|
-
reset: '\x1b[0m',
|
|
329
|
-
bold: '\x1b[1m',
|
|
330
|
-
dim: '\x1b[2m',
|
|
331
|
-
cyan: '\x1b[36m',
|
|
332
|
-
green: '\x1b[32m',
|
|
333
|
-
yellow: '\x1b[33m',
|
|
334
|
-
blue: '\x1b[34m',
|
|
335
|
-
magenta: '\x1b[35m',
|
|
336
|
-
white: '\x1b[37m',
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
// Check if colors should be disabled
|
|
340
|
-
const noColor = process.env.NO_COLOR || process.env.TERM === 'dumb';
|
|
341
|
-
if (noColor) {
|
|
342
|
-
Object.keys(c).forEach(k => c[k] = '');
|
|
343
|
-
}
|
|
344
|
-
|
|
345
327
|
// Helper to format a command line
|
|
346
328
|
const cmd = (name, desc) => {
|
|
347
329
|
const paddedName = name.padEnd(32);
|
|
348
|
-
return `${
|
|
330
|
+
return `${chalk.cyan(paddedName)}${desc}`;
|
|
349
331
|
};
|
|
350
332
|
|
|
351
333
|
// Helper to create a boxed section
|
|
352
334
|
const box = (title, lines) => {
|
|
353
|
-
|
|
335
|
+
// Strip ANSI codes for length calculation
|
|
336
|
+
const stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
337
|
+
const maxLen = Math.max(...lines.map(l => stripAnsi(l).length), title.length + 4);
|
|
354
338
|
const width = Math.min(maxLen + 2, 80);
|
|
355
|
-
const top = `┌─ ${
|
|
339
|
+
const top = `┌─ ${chalk.bold(title)} ${'─'.repeat(Math.max(0, width - title.length - 5))}┐`;
|
|
356
340
|
const bot = `└${'─'.repeat(width)}┘`;
|
|
357
341
|
const content = lines.map(l => {
|
|
358
|
-
const stripped = l
|
|
342
|
+
const stripped = stripAnsi(l);
|
|
359
343
|
const padding = Math.max(0, width - stripped.length - 1);
|
|
360
344
|
return `│ ${l}${' '.repeat(padding)}│`;
|
|
361
345
|
}).join('\n');
|
|
@@ -364,15 +348,15 @@ function printHelp() {
|
|
|
364
348
|
|
|
365
349
|
// Header
|
|
366
350
|
console.log(`
|
|
367
|
-
${
|
|
351
|
+
${chalk.yellow('Usage:')} ${chalk.bold('coder-config')} [OPTIONS] ${chalk.cyan('COMMAND')} [ARGS]...
|
|
368
352
|
|
|
369
|
-
${
|
|
353
|
+
${chalk.dim('Configuration manager for AI coding tools (Claude Code, Gemini CLI, Codex CLI)')}
|
|
370
354
|
`);
|
|
371
355
|
|
|
372
356
|
// Options section
|
|
373
357
|
console.log(box('Options', [
|
|
374
|
-
`${
|
|
375
|
-
`${
|
|
358
|
+
`${chalk.green('--version')} ${chalk.dim('-v')} Show version and exit`,
|
|
359
|
+
`${chalk.green('--help')} ${chalk.dim('-h')} Show this message and exit`,
|
|
376
360
|
]));
|
|
377
361
|
console.log();
|
|
378
362
|
|
|
@@ -458,11 +442,11 @@ ${c.dim}Configuration manager for AI coding tools (Claude Code, Gemini CLI, Code
|
|
|
458
442
|
console.log();
|
|
459
443
|
|
|
460
444
|
// Examples
|
|
461
|
-
console.log(
|
|
462
|
-
console.log(` ${
|
|
463
|
-
console.log(` ${
|
|
464
|
-
console.log(` ${
|
|
465
|
-
console.log(` ${
|
|
445
|
+
console.log(chalk.yellow('Examples:'));
|
|
446
|
+
console.log(` ${chalk.dim('$')} coder-config init`);
|
|
447
|
+
console.log(` ${chalk.dim('$')} coder-config add postgres github`);
|
|
448
|
+
console.log(` ${chalk.dim('$')} coder-config memory add preference "Use TypeScript"`);
|
|
449
|
+
console.log(` ${chalk.dim('$')} coder-config ui`);
|
|
466
450
|
console.log();
|
|
467
451
|
}
|
|
468
452
|
|
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.8",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@iarna/toml": "^3.0.0",
|
|
45
|
+
"chalk": "^4.1.2",
|
|
45
46
|
"js-yaml": "^4.1.1",
|
|
46
47
|
"node-pty": "^1.1.0",
|
|
47
48
|
"ws": "^8.19.0"
|