@openluxeco/cli 0.5.2 → 0.6.0
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/package.json +1 -1
- package/src/banner.js +68 -0
- package/src/cli.js +2 -0
package/package.json
CHANGED
package/src/banner.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenLuxe splash — the diamond estate mark stacked above the wordmark,
|
|
3
|
+
* washed in champagne gold. Shown at the top of `openluxe` / `openluxe help`.
|
|
4
|
+
*
|
|
5
|
+
* Zero-dep: hand-set ASCII + 256-color ANSI. Color is applied only on an
|
|
6
|
+
* interactive stdout without NO_COLOR, so piped output stays clean.
|
|
7
|
+
*/
|
|
8
|
+
import { VERSION } from './config.js';
|
|
9
|
+
|
|
10
|
+
// The mark: nested shield/gem outline (public/images/mark.svg) — apex, angled
|
|
11
|
+
// shoulders, vertical sides, chamfered flat base, hollow double-walled center.
|
|
12
|
+
const MARK = [
|
|
13
|
+
' ╱╲',
|
|
14
|
+
' ╱ ╲',
|
|
15
|
+
' ╱ ╱╲ ╲',
|
|
16
|
+
' ╱ ╱ ╲ ╲',
|
|
17
|
+
' ╱ ╱ ╲ ╲',
|
|
18
|
+
' ╱ ╱ ╲ ╲',
|
|
19
|
+
' │ │ │ │',
|
|
20
|
+
' │ │ │ │',
|
|
21
|
+
' │ ╰────────╯ │',
|
|
22
|
+
' ╲ ╱',
|
|
23
|
+
' ╲──────────╱',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const WORDMARK = [
|
|
27
|
+
' ██████╗ ██████╗ ███████╗███╗ ██╗██╗ ██╗ ██╗██╗ ██╗███████╗',
|
|
28
|
+
'██╔═══██╗██╔══██╗██╔════╝████╗ ██║██║ ██║ ██║╚██╗██╔╝██╔════╝',
|
|
29
|
+
'██║ ██║██████╔╝█████╗ ██╔██╗ ██║██║ ██║ ██║ ╚███╔╝ █████╗ ',
|
|
30
|
+
'██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║██║ ██║ ██║ ██╔██╗ ██╔══╝ ',
|
|
31
|
+
'╚██████╔╝██║ ███████╗██║ ╚████║███████╗╚██████╔╝██╔╝ ██╗███████╗',
|
|
32
|
+
' ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const WIDTH = 68; // wordmark width — everything centers against it
|
|
36
|
+
|
|
37
|
+
// Champagne ramp, light → deep gold (xterm 256).
|
|
38
|
+
const MARK_RAMP = [230, 230, 223, 223, 222, 221, 220, 220, 178, 178, 172];
|
|
39
|
+
const WORD_RAMP = [223, 222, 220, 220, 178, 172];
|
|
40
|
+
|
|
41
|
+
function paint(line, color, on) {
|
|
42
|
+
return on ? `\x1b[38;5;${color}m${line}\x1b[0m` : line;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function center(line, width = WIDTH) {
|
|
46
|
+
const pad = Math.max(0, Math.floor((width - line.length) / 2));
|
|
47
|
+
return ' '.repeat(pad) + line;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function banner() {
|
|
51
|
+
const on = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;
|
|
52
|
+
const dim = (s) => (on ? `\x1b[2m${s}\x1b[0m` : s);
|
|
53
|
+
|
|
54
|
+
const markPad = ' '.repeat(Math.floor((WIDTH - 20) / 2) - 2);
|
|
55
|
+
const lines = [
|
|
56
|
+
'',
|
|
57
|
+
...MARK.map((l, i) => markPad + paint(l, MARK_RAMP[i], on)),
|
|
58
|
+
'',
|
|
59
|
+
...WORDMARK.map((l, i) => paint(l, WORD_RAMP[i], on)),
|
|
60
|
+
'',
|
|
61
|
+
center(`v${VERSION} · the platform, from your terminal · openluxe.co/developers`).replace(
|
|
62
|
+
/^(\s*)(.*)$/,
|
|
63
|
+
(_, s, t) => s + dim(t),
|
|
64
|
+
),
|
|
65
|
+
'',
|
|
66
|
+
];
|
|
67
|
+
return lines.join('\n');
|
|
68
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { RESOURCES } from './resources.js';
|
|
|
3
3
|
import * as auth from './auth.js';
|
|
4
4
|
import { load, VERSION } from './config.js';
|
|
5
5
|
import { serve as mcpServe } from './mcp.js';
|
|
6
|
+
import { banner } from './banner.js';
|
|
6
7
|
|
|
7
8
|
const C = {
|
|
8
9
|
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
@@ -198,6 +199,7 @@ async function callApi(method, path, { positionals = [], flags = {}, body }) {
|
|
|
198
199
|
|
|
199
200
|
function topHelp() {
|
|
200
201
|
const { token, user, base } = load();
|
|
202
|
+
console.log(banner());
|
|
201
203
|
console.log(`
|
|
202
204
|
${C.bold('openluxe')} — OpenLuxe API command-line client
|
|
203
205
|
|