wiggum-cli 0.2.1 → 0.2.2
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/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/colors.d.ts +48 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/colors.js +85 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/header.d.ts +5 -1
- package/dist/utils/header.d.ts.map +1 -1
- package/dist/utils/header.js +19 -4
- package/dist/utils/header.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/init.ts +5 -4
- package/src/utils/colors.ts +95 -0
- package/src/utils/header.ts +21 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoOrE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -8,9 +8,9 @@ import { Generator, formatGenerationResult } from '../generator/index.js';
|
|
|
8
8
|
import { AIEnhancer, formatAIAnalysis, } from '../ai/index.js';
|
|
9
9
|
import { hasApiKey, getApiKeyEnvVar, getAvailableProvider, AVAILABLE_MODELS } from '../ai/providers.js';
|
|
10
10
|
import * as prompts from '@clack/prompts';
|
|
11
|
-
import pc from 'picocolors';
|
|
12
11
|
import fs from 'fs';
|
|
13
12
|
import path from 'path';
|
|
13
|
+
import { simpson } from '../utils/colors.js';
|
|
14
14
|
/**
|
|
15
15
|
* Initialize Ralph in the current project
|
|
16
16
|
* Scans the project and generates configuration
|
|
@@ -36,7 +36,7 @@ export async function initCommand(options) {
|
|
|
36
36
|
}
|
|
37
37
|
// Display scan results
|
|
38
38
|
console.log('');
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(simpson.yellow('─── Scan Results ───'));
|
|
40
40
|
console.log(formatScanResult(scanResult));
|
|
41
41
|
console.log('');
|
|
42
42
|
// Step 2: AI Enhancement
|
|
@@ -61,7 +61,7 @@ export async function initCommand(options) {
|
|
|
61
61
|
// If no API key found, prompt for one
|
|
62
62
|
if (!hasKey) {
|
|
63
63
|
console.log('');
|
|
64
|
-
console.log(
|
|
64
|
+
console.log(simpson.pink('No API key found for AI enhancement.'));
|
|
65
65
|
console.log('');
|
|
66
66
|
// Ask which provider to use
|
|
67
67
|
const providerChoice = await prompts.select({
|
|
@@ -143,7 +143,7 @@ export async function initCommand(options) {
|
|
|
143
143
|
const selectedModel = modelChoice;
|
|
144
144
|
const modelLabel = modelOptions.find(m => m.value === selectedModel)?.label || selectedModel;
|
|
145
145
|
console.log('');
|
|
146
|
-
console.log(
|
|
146
|
+
console.log(simpson.yellow(`─── AI Enhancement (${provider} / ${modelLabel}) ───`));
|
|
147
147
|
const aiEnhancer = new AIEnhancer({
|
|
148
148
|
provider,
|
|
149
149
|
model: selectedModel,
|
|
@@ -195,7 +195,7 @@ export async function initCommand(options) {
|
|
|
195
195
|
const generationResult = await generator.generate(scanResult);
|
|
196
196
|
spinner.stop('Configuration files generated');
|
|
197
197
|
console.log('');
|
|
198
|
-
console.log(
|
|
198
|
+
console.log(simpson.yellow('─── Generation Results ───'));
|
|
199
199
|
console.log(formatGenerationResult(generationResult));
|
|
200
200
|
if (generationResult.success) {
|
|
201
201
|
console.log('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAA2B,MAAM,oBAAoB,CAAC;AAQtE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAoB;IACpD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC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AAC,CAAC;YAChB,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;YAClD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simpson Color Palette
|
|
3
|
+
* Custom ANSI color utilities for the CLI
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Simpson color palette hex values
|
|
7
|
+
*/
|
|
8
|
+
export declare const SIMPSON_COLORS: {
|
|
9
|
+
readonly blue: "#2f64d6";
|
|
10
|
+
readonly yellow: "#f8db27";
|
|
11
|
+
readonly brown: "#9c5b01";
|
|
12
|
+
readonly white: "#ffffff";
|
|
13
|
+
readonly pink: "#ff81c1";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Simpson color functions for terminal output
|
|
17
|
+
*/
|
|
18
|
+
export declare const simpson: {
|
|
19
|
+
yellow: (text: string) => string;
|
|
20
|
+
blue: (text: string) => string;
|
|
21
|
+
brown: (text: string) => string;
|
|
22
|
+
white: (text: string) => string;
|
|
23
|
+
pink: (text: string) => string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Box drawing characters
|
|
27
|
+
*/
|
|
28
|
+
export declare const box: {
|
|
29
|
+
topLeft: string;
|
|
30
|
+
topRight: string;
|
|
31
|
+
bottomLeft: string;
|
|
32
|
+
bottomRight: string;
|
|
33
|
+
horizontal: string;
|
|
34
|
+
vertical: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Draw a horizontal line
|
|
38
|
+
*/
|
|
39
|
+
export declare function drawLine(width?: number): string;
|
|
40
|
+
/**
|
|
41
|
+
* Draw a box around text
|
|
42
|
+
*/
|
|
43
|
+
export declare function drawBox(text: string, padding?: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* Section header with horizontal lines
|
|
46
|
+
*/
|
|
47
|
+
export declare function sectionHeader(title: string): string;
|
|
48
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AA8BX;;GAEG;AACH,eAAO,MAAM,OAAO;mBACH,MAAM,KAAG,MAAM;iBACjB,MAAM,KAAG,MAAM;kBACd,MAAM,KAAG,MAAM;kBACf,MAAM,KAAG,MAAM;iBAChB,MAAM,KAAG,MAAM;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;CAOf,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,GAAE,MAAW,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU,GAAG,MAAM,CASjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGnD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simpson Color Palette
|
|
3
|
+
* Custom ANSI color utilities for the CLI
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Simpson color palette hex values
|
|
7
|
+
*/
|
|
8
|
+
export const SIMPSON_COLORS = {
|
|
9
|
+
blue: '#2f64d6',
|
|
10
|
+
yellow: '#f8db27',
|
|
11
|
+
brown: '#9c5b01',
|
|
12
|
+
white: '#ffffff',
|
|
13
|
+
pink: '#ff81c1',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Convert hex to RGB
|
|
17
|
+
*/
|
|
18
|
+
function hexToRgb(hex) {
|
|
19
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
20
|
+
if (!result) {
|
|
21
|
+
return { r: 255, g: 255, b: 255 };
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
r: parseInt(result[1], 16),
|
|
25
|
+
g: parseInt(result[2], 16),
|
|
26
|
+
b: parseInt(result[3], 16),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create ANSI escape code for foreground color from hex
|
|
31
|
+
*/
|
|
32
|
+
function fgHex(hex) {
|
|
33
|
+
const { r, g, b } = hexToRgb(hex);
|
|
34
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Reset ANSI escape code
|
|
38
|
+
*/
|
|
39
|
+
const reset = '\x1b[0m';
|
|
40
|
+
/**
|
|
41
|
+
* Simpson color functions for terminal output
|
|
42
|
+
*/
|
|
43
|
+
export const simpson = {
|
|
44
|
+
yellow: (text) => `${fgHex(SIMPSON_COLORS.yellow)}${text}${reset}`,
|
|
45
|
+
blue: (text) => `${fgHex(SIMPSON_COLORS.blue)}${text}${reset}`,
|
|
46
|
+
brown: (text) => `${fgHex(SIMPSON_COLORS.brown)}${text}${reset}`,
|
|
47
|
+
white: (text) => `${fgHex(SIMPSON_COLORS.white)}${text}${reset}`,
|
|
48
|
+
pink: (text) => `${fgHex(SIMPSON_COLORS.pink)}${text}${reset}`,
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Box drawing characters
|
|
52
|
+
*/
|
|
53
|
+
export const box = {
|
|
54
|
+
topLeft: '┌',
|
|
55
|
+
topRight: '┐',
|
|
56
|
+
bottomLeft: '└',
|
|
57
|
+
bottomRight: '┘',
|
|
58
|
+
horizontal: '─',
|
|
59
|
+
vertical: '│',
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Draw a horizontal line
|
|
63
|
+
*/
|
|
64
|
+
export function drawLine(width = 50) {
|
|
65
|
+
return simpson.brown(box.horizontal.repeat(width));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Draw a box around text
|
|
69
|
+
*/
|
|
70
|
+
export function drawBox(text, padding = 1) {
|
|
71
|
+
const paddedText = ' '.repeat(padding) + text + ' '.repeat(padding);
|
|
72
|
+
const width = paddedText.length;
|
|
73
|
+
const top = simpson.brown(box.topLeft + box.horizontal.repeat(width) + box.topRight);
|
|
74
|
+
const middle = simpson.brown(box.vertical) + paddedText + simpson.brown(box.vertical);
|
|
75
|
+
const bottom = simpson.brown(box.bottomLeft + box.horizontal.repeat(width) + box.bottomRight);
|
|
76
|
+
return `${top}\n${middle}\n${bottom}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Section header with horizontal lines
|
|
80
|
+
*/
|
|
81
|
+
export function sectionHeader(title) {
|
|
82
|
+
const line = drawLine(50);
|
|
83
|
+
return `\n${line}\n${simpson.yellow(title)}\n${line}`;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC;IAE9F,OAAO,GAAG,GAAG,KAAK,MAAM,KAAK,MAAM,EAAE,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1B,OAAO,KAAK,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/utils/header.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Display the RALPH ASCII header
|
|
2
|
+
* Display the RALPH ASCII header with welcome box
|
|
3
3
|
*/
|
|
4
4
|
export declare function displayHeader(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Display a minimal header (for subcommands)
|
|
7
|
+
*/
|
|
8
|
+
export declare function displayMinimalHeader(): void;
|
|
5
9
|
//# sourceMappingURL=header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/utils/header.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/utils/header.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAgBpC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C"}
|
package/dist/utils/header.js
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import cfonts from 'cfonts';
|
|
2
|
+
import { simpson, drawBox, SIMPSON_COLORS } from './colors.js';
|
|
2
3
|
/**
|
|
3
|
-
* Display the RALPH ASCII header
|
|
4
|
+
* Display the RALPH ASCII header with welcome box
|
|
4
5
|
*/
|
|
5
6
|
export function displayHeader() {
|
|
6
|
-
|
|
7
|
+
// Welcome box like Claude Code
|
|
8
|
+
const welcomeText = simpson.pink('*') + ' Welcome to ' + simpson.yellow('Ralph') + '🍩';
|
|
9
|
+
console.log('');
|
|
10
|
+
console.log(drawBox(welcomeText, 2));
|
|
11
|
+
console.log('');
|
|
12
|
+
// ASCII art logo in Simpson yellow
|
|
13
|
+
cfonts.say('WIGGUM CLI', {
|
|
7
14
|
font: 'block',
|
|
8
|
-
colors: [
|
|
15
|
+
colors: [SIMPSON_COLORS.yellow],
|
|
9
16
|
letterSpacing: 1,
|
|
10
17
|
lineHeight: 1,
|
|
11
|
-
space:
|
|
18
|
+
space: false,
|
|
12
19
|
maxLength: 0,
|
|
13
20
|
});
|
|
14
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Display a minimal header (for subcommands)
|
|
24
|
+
*/
|
|
25
|
+
export function displayMinimalHeader() {
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log(simpson.yellow('Ralph') + simpson.brown(' │ ') + 'AI-powered loop development');
|
|
28
|
+
console.log('');
|
|
29
|
+
}
|
|
15
30
|
//# sourceMappingURL=header.js.map
|
package/dist/utils/header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/utils/header.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/utils/header.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,+BAA+B;IAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IACxF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,mCAAmC;IACnC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE;QACvB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC;QAC/B,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,CAAC;KACb,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,6BAA6B,CAAC,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
package/src/commands/init.ts
CHANGED
|
@@ -17,6 +17,7 @@ import * as prompts from '@clack/prompts';
|
|
|
17
17
|
import pc from 'picocolors';
|
|
18
18
|
import fs from 'fs';
|
|
19
19
|
import path from 'path';
|
|
20
|
+
import { simpson, sectionHeader, drawLine } from '../utils/colors.js';
|
|
20
21
|
|
|
21
22
|
export interface InitOptions {
|
|
22
23
|
ai?: boolean;
|
|
@@ -53,7 +54,7 @@ export async function initCommand(options: InitOptions): Promise<void> {
|
|
|
53
54
|
|
|
54
55
|
// Display scan results
|
|
55
56
|
console.log('');
|
|
56
|
-
console.log(
|
|
57
|
+
console.log(simpson.yellow('─── Scan Results ───'));
|
|
57
58
|
console.log(formatScanResult(scanResult));
|
|
58
59
|
console.log('');
|
|
59
60
|
|
|
@@ -84,7 +85,7 @@ export async function initCommand(options: InitOptions): Promise<void> {
|
|
|
84
85
|
// If no API key found, prompt for one
|
|
85
86
|
if (!hasKey) {
|
|
86
87
|
console.log('');
|
|
87
|
-
console.log(
|
|
88
|
+
console.log(simpson.pink('No API key found for AI enhancement.'));
|
|
88
89
|
console.log('');
|
|
89
90
|
|
|
90
91
|
// Ask which provider to use
|
|
@@ -175,7 +176,7 @@ export async function initCommand(options: InitOptions): Promise<void> {
|
|
|
175
176
|
const modelLabel = modelOptions.find(m => m.value === selectedModel)?.label || selectedModel;
|
|
176
177
|
|
|
177
178
|
console.log('');
|
|
178
|
-
console.log(
|
|
179
|
+
console.log(simpson.yellow(`─── AI Enhancement (${provider} / ${modelLabel}) ───`));
|
|
179
180
|
|
|
180
181
|
const aiEnhancer = new AIEnhancer({
|
|
181
182
|
provider,
|
|
@@ -236,7 +237,7 @@ export async function initCommand(options: InitOptions): Promise<void> {
|
|
|
236
237
|
spinner.stop('Configuration files generated');
|
|
237
238
|
|
|
238
239
|
console.log('');
|
|
239
|
-
console.log(
|
|
240
|
+
console.log(simpson.yellow('─── Generation Results ───'));
|
|
240
241
|
console.log(formatGenerationResult(generationResult));
|
|
241
242
|
|
|
242
243
|
if (generationResult.success) {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simpson Color Palette
|
|
3
|
+
* Custom ANSI color utilities for the CLI
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Simpson color palette hex values
|
|
8
|
+
*/
|
|
9
|
+
export const SIMPSON_COLORS = {
|
|
10
|
+
blue: '#2f64d6',
|
|
11
|
+
yellow: '#f8db27',
|
|
12
|
+
brown: '#9c5b01',
|
|
13
|
+
white: '#ffffff',
|
|
14
|
+
pink: '#ff81c1',
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Convert hex to RGB
|
|
19
|
+
*/
|
|
20
|
+
function hexToRgb(hex: string): { r: number; g: number; b: number } {
|
|
21
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
22
|
+
if (!result) {
|
|
23
|
+
return { r: 255, g: 255, b: 255 };
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
r: parseInt(result[1], 16),
|
|
27
|
+
g: parseInt(result[2], 16),
|
|
28
|
+
b: parseInt(result[3], 16),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create ANSI escape code for foreground color from hex
|
|
34
|
+
*/
|
|
35
|
+
function fgHex(hex: string): string {
|
|
36
|
+
const { r, g, b } = hexToRgb(hex);
|
|
37
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Reset ANSI escape code
|
|
42
|
+
*/
|
|
43
|
+
const reset = '\x1b[0m';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Simpson color functions for terminal output
|
|
47
|
+
*/
|
|
48
|
+
export const simpson = {
|
|
49
|
+
yellow: (text: string): string => `${fgHex(SIMPSON_COLORS.yellow)}${text}${reset}`,
|
|
50
|
+
blue: (text: string): string => `${fgHex(SIMPSON_COLORS.blue)}${text}${reset}`,
|
|
51
|
+
brown: (text: string): string => `${fgHex(SIMPSON_COLORS.brown)}${text}${reset}`,
|
|
52
|
+
white: (text: string): string => `${fgHex(SIMPSON_COLORS.white)}${text}${reset}`,
|
|
53
|
+
pink: (text: string): string => `${fgHex(SIMPSON_COLORS.pink)}${text}${reset}`,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Box drawing characters
|
|
58
|
+
*/
|
|
59
|
+
export const box = {
|
|
60
|
+
topLeft: '┌',
|
|
61
|
+
topRight: '┐',
|
|
62
|
+
bottomLeft: '└',
|
|
63
|
+
bottomRight: '┘',
|
|
64
|
+
horizontal: '─',
|
|
65
|
+
vertical: '│',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Draw a horizontal line
|
|
70
|
+
*/
|
|
71
|
+
export function drawLine(width: number = 50): string {
|
|
72
|
+
return simpson.brown(box.horizontal.repeat(width));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Draw a box around text
|
|
77
|
+
*/
|
|
78
|
+
export function drawBox(text: string, padding: number = 1): string {
|
|
79
|
+
const paddedText = ' '.repeat(padding) + text + ' '.repeat(padding);
|
|
80
|
+
const width = paddedText.length;
|
|
81
|
+
|
|
82
|
+
const top = simpson.brown(box.topLeft + box.horizontal.repeat(width) + box.topRight);
|
|
83
|
+
const middle = simpson.brown(box.vertical) + paddedText + simpson.brown(box.vertical);
|
|
84
|
+
const bottom = simpson.brown(box.bottomLeft + box.horizontal.repeat(width) + box.bottomRight);
|
|
85
|
+
|
|
86
|
+
return `${top}\n${middle}\n${bottom}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Section header with horizontal lines
|
|
91
|
+
*/
|
|
92
|
+
export function sectionHeader(title: string): string {
|
|
93
|
+
const line = drawLine(50);
|
|
94
|
+
return `\n${line}\n${simpson.yellow(title)}\n${line}`;
|
|
95
|
+
}
|
package/src/utils/header.ts
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import cfonts from 'cfonts';
|
|
2
|
+
import { simpson, drawBox, SIMPSON_COLORS } from './colors.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Display the RALPH ASCII header
|
|
5
|
+
* Display the RALPH ASCII header with welcome box
|
|
5
6
|
*/
|
|
6
7
|
export function displayHeader(): void {
|
|
7
|
-
|
|
8
|
+
// Welcome box like Claude Code
|
|
9
|
+
const welcomeText = simpson.pink('*') + ' Welcome to ' + simpson.yellow('Ralph') + '🍩';
|
|
10
|
+
console.log('');
|
|
11
|
+
console.log(drawBox(welcomeText, 2));
|
|
12
|
+
console.log('');
|
|
13
|
+
|
|
14
|
+
// ASCII art logo in Simpson yellow
|
|
15
|
+
cfonts.say('WIGGUM CLI', {
|
|
8
16
|
font: 'block',
|
|
9
|
-
colors: [
|
|
17
|
+
colors: [SIMPSON_COLORS.yellow],
|
|
10
18
|
letterSpacing: 1,
|
|
11
19
|
lineHeight: 1,
|
|
12
|
-
space:
|
|
20
|
+
space: false,
|
|
13
21
|
maxLength: 0,
|
|
14
22
|
});
|
|
15
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Display a minimal header (for subcommands)
|
|
27
|
+
*/
|
|
28
|
+
export function displayMinimalHeader(): void {
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log(simpson.yellow('Ralph') + simpson.brown(' │ ') + 'AI-powered loop development');
|
|
31
|
+
console.log('');
|
|
32
|
+
}
|