@myclaude-cli/cli 0.3.0-alpha
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/bin/dev.js +5 -0
- package/bin/myclaude.js +20 -0
- package/dist/commands/help.d.ts +11 -0
- package/dist/commands/help.js +221 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/info.d.ts +12 -0
- package/dist/commands/info.js +87 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/install.d.ts +14 -0
- package/dist/commands/install.js +113 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +9 -0
- package/dist/commands/list.js +41 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.js +83 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +9 -0
- package/dist/commands/logout.js +25 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/publish.d.ts +10 -0
- package/dist/commands/publish.js +229 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/search.d.ts +18 -0
- package/dist/commands/search.js +108 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/status.d.ts +8 -0
- package/dist/commands/status.js +84 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/uninstall.d.ts +14 -0
- package/dist/commands/uninstall.js +98 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/validate.d.ts +9 -0
- package/dist/commands/validate.js +144 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/whoami.d.ts +9 -0
- package/dist/commands/whoami.js +52 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/api.d.ts +18 -0
- package/dist/core/api.js +135 -0
- package/dist/core/api.js.map +1 -0
- package/dist/core/auth.d.ts +30 -0
- package/dist/core/auth.js +71 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/browser-auth.d.ts +24 -0
- package/dist/core/browser-auth.js +155 -0
- package/dist/core/browser-auth.js.map +1 -0
- package/dist/core/install.d.ts +24 -0
- package/dist/core/install.js +191 -0
- package/dist/core/install.js.map +1 -0
- package/dist/core/lockfile.d.ts +18 -0
- package/dist/core/lockfile.js +41 -0
- package/dist/core/lockfile.js.map +1 -0
- package/dist/core/manifest.d.ts +41 -0
- package/dist/core/manifest.js +203 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/packer.d.ts +25 -0
- package/dist/core/packer.js +169 -0
- package/dist/core/packer.js.map +1 -0
- package/dist/core/paths.d.ts +2 -0
- package/dist/core/paths.js +50 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/secret-scan.d.ts +17 -0
- package/dist/core/secret-scan.js +73 -0
- package/dist/core/secret-scan.js.map +1 -0
- package/dist/ui/exit-codes.d.ts +91 -0
- package/dist/ui/exit-codes.js +51 -0
- package/dist/ui/exit-codes.js.map +1 -0
- package/dist/ui/format.d.ts +12 -0
- package/dist/ui/format.js +44 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/index.d.ts +13 -0
- package/dist/ui/index.js +11 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout.d.ts +28 -0
- package/dist/ui/layout.js +161 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +42 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/theme.d.ts +46 -0
- package/dist/ui/theme.js +180 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/utils/config.d.ts +11 -0
- package/dist/utils/config.js +44 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/keychain.d.ts +3 -0
- package/dist/utils/keychain.js +53 -0
- package/dist/utils/keychain.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Exit Code Protocol
|
|
3
|
+
*
|
|
4
|
+
* Consistent exit codes for both human and agent consumption.
|
|
5
|
+
* Agents can check $? to determine failure type without parsing text.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXIT: {
|
|
8
|
+
readonly OK: 0;
|
|
9
|
+
readonly ERROR: 1;
|
|
10
|
+
readonly AUTH: 2;
|
|
11
|
+
readonly NOT_FOUND: 3;
|
|
12
|
+
readonly VALIDATION: 4;
|
|
13
|
+
readonly CONFLICT: 5;
|
|
14
|
+
};
|
|
15
|
+
export type ExitCode = typeof EXIT[keyof typeof EXIT];
|
|
16
|
+
/**
|
|
17
|
+
* CLI capability manifest for agent discovery.
|
|
18
|
+
* Returned in root --json output so agents know what's available.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CLI_MANIFEST: {
|
|
21
|
+
readonly commands: readonly [{
|
|
22
|
+
readonly name: "search";
|
|
23
|
+
readonly args: "[query]";
|
|
24
|
+
readonly auth: false;
|
|
25
|
+
readonly description: "Search the marketplace";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "info";
|
|
28
|
+
readonly args: "<slug>";
|
|
29
|
+
readonly auth: false;
|
|
30
|
+
readonly description: "Product details";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "install";
|
|
33
|
+
readonly args: "<slug>";
|
|
34
|
+
readonly auth: true;
|
|
35
|
+
readonly description: "Install a product";
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "uninstall";
|
|
38
|
+
readonly args: "<slug>";
|
|
39
|
+
readonly auth: false;
|
|
40
|
+
readonly description: "Remove a product";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "list";
|
|
43
|
+
readonly args: "";
|
|
44
|
+
readonly auth: false;
|
|
45
|
+
readonly description: "List installed products";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "validate";
|
|
48
|
+
readonly args: "";
|
|
49
|
+
readonly auth: false;
|
|
50
|
+
readonly description: "Validate product before publishing";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "publish";
|
|
53
|
+
readonly args: "";
|
|
54
|
+
readonly auth: true;
|
|
55
|
+
readonly description: "Publish product to marketplace";
|
|
56
|
+
}, {
|
|
57
|
+
readonly name: "login";
|
|
58
|
+
readonly args: "";
|
|
59
|
+
readonly auth: false;
|
|
60
|
+
readonly description: "Authenticate via browser";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "logout";
|
|
63
|
+
readonly args: "";
|
|
64
|
+
readonly auth: false;
|
|
65
|
+
readonly description: "Clear credentials";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "whoami";
|
|
68
|
+
readonly args: "";
|
|
69
|
+
readonly auth: false;
|
|
70
|
+
readonly description: "Show current user";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "help";
|
|
73
|
+
readonly args: "[command]";
|
|
74
|
+
readonly auth: false;
|
|
75
|
+
readonly description: "Show help";
|
|
76
|
+
}];
|
|
77
|
+
readonly categories: readonly ["skills", "agents", "squads", "workflows", "design-systems", "claude-md", "prompts", "applications", "systems"];
|
|
78
|
+
readonly exitCodes: {
|
|
79
|
+
readonly 0: "success";
|
|
80
|
+
readonly 1: "general error";
|
|
81
|
+
readonly 2: "auth required";
|
|
82
|
+
readonly 3: "not found";
|
|
83
|
+
readonly 4: "validation error";
|
|
84
|
+
readonly 5: "conflict";
|
|
85
|
+
};
|
|
86
|
+
readonly flags: {
|
|
87
|
+
readonly global: "--json on every command for machine-readable output";
|
|
88
|
+
readonly search: "--category, --author, --free, --sort, --limit, --page";
|
|
89
|
+
readonly install: "--global, --force";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Exit Code Protocol
|
|
3
|
+
*
|
|
4
|
+
* Consistent exit codes for both human and agent consumption.
|
|
5
|
+
* Agents can check $? to determine failure type without parsing text.
|
|
6
|
+
*/
|
|
7
|
+
export const EXIT = {
|
|
8
|
+
OK: 0, // Success
|
|
9
|
+
ERROR: 1, // General error (network, server, unknown)
|
|
10
|
+
AUTH: 2, // Authentication required or expired
|
|
11
|
+
NOT_FOUND: 3, // Resource not found (product, user)
|
|
12
|
+
VALIDATION: 4, // Input validation failed (bad slug, invalid args)
|
|
13
|
+
CONFLICT: 5, // Already installed, already exists
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* CLI capability manifest for agent discovery.
|
|
17
|
+
* Returned in root --json output so agents know what's available.
|
|
18
|
+
*/
|
|
19
|
+
export const CLI_MANIFEST = {
|
|
20
|
+
commands: [
|
|
21
|
+
{ name: 'search', args: '[query]', auth: false, description: 'Search the marketplace' },
|
|
22
|
+
{ name: 'info', args: '<slug>', auth: false, description: 'Product details' },
|
|
23
|
+
{ name: 'install', args: '<slug>', auth: true, description: 'Install a product' },
|
|
24
|
+
{ name: 'uninstall', args: '<slug>', auth: false, description: 'Remove a product' },
|
|
25
|
+
{ name: 'list', args: '', auth: false, description: 'List installed products' },
|
|
26
|
+
{ name: 'validate', args: '', auth: false, description: 'Validate product before publishing' },
|
|
27
|
+
{ name: 'publish', args: '', auth: true, description: 'Publish product to marketplace' },
|
|
28
|
+
{ name: 'login', args: '', auth: false, description: 'Authenticate via browser' },
|
|
29
|
+
{ name: 'logout', args: '', auth: false, description: 'Clear credentials' },
|
|
30
|
+
{ name: 'whoami', args: '', auth: false, description: 'Show current user' },
|
|
31
|
+
{ name: 'help', args: '[command]', auth: false, description: 'Show help' },
|
|
32
|
+
],
|
|
33
|
+
categories: [
|
|
34
|
+
'skills', 'agents', 'squads', 'workflows',
|
|
35
|
+
'design-systems', 'claude-md', 'prompts', 'applications', 'systems',
|
|
36
|
+
],
|
|
37
|
+
exitCodes: {
|
|
38
|
+
0: 'success',
|
|
39
|
+
1: 'general error',
|
|
40
|
+
2: 'auth required',
|
|
41
|
+
3: 'not found',
|
|
42
|
+
4: 'validation error',
|
|
43
|
+
5: 'conflict',
|
|
44
|
+
},
|
|
45
|
+
flags: {
|
|
46
|
+
global: '--json on every command for machine-readable output',
|
|
47
|
+
search: '--category, --author, --free, --sort, --limit, --page',
|
|
48
|
+
install: '--global, --force',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=exit-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../../src/ui/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,EAAE,EAAU,CAAC,EAAG,UAAU;IAC1B,KAAK,EAAO,CAAC,EAAG,2CAA2C;IAC3D,IAAI,EAAQ,CAAC,EAAG,qCAAqC;IACrD,SAAS,EAAG,CAAC,EAAG,qCAAqC;IACrD,UAAU,EAAE,CAAC,EAAG,mDAAmD;IACnE,QAAQ,EAAI,CAAC,EAAG,oCAAoC;CAC5C,CAAA;AAIV;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE;QACR,EAAC,IAAI,EAAE,QAAQ,EAAK,IAAI,EAAE,SAAS,EAAG,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAC;QACzF,EAAC,IAAI,EAAE,MAAM,EAAO,IAAI,EAAE,QAAQ,EAAI,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAC;QAClF,EAAC,IAAI,EAAE,SAAS,EAAI,IAAI,EAAE,QAAQ,EAAI,IAAI,EAAE,IAAI,EAAG,WAAW,EAAE,mBAAmB,EAAC;QACpF,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAI,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAC;QACnF,EAAC,IAAI,EAAE,MAAM,EAAO,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAC;QAC1F,EAAC,IAAI,EAAE,UAAU,EAAG,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,oCAAoC,EAAC;QACrG,EAAC,IAAI,EAAE,SAAS,EAAI,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,IAAI,EAAG,WAAW,EAAE,gCAAgC,EAAC;QACjG,EAAC,IAAI,EAAE,OAAO,EAAM,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAC;QAC3F,EAAC,IAAI,EAAE,QAAQ,EAAK,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAC;QACpF,EAAC,IAAI,EAAE,QAAQ,EAAK,IAAI,EAAE,EAAE,EAAU,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAC;QACpF,EAAC,IAAI,EAAE,MAAM,EAAO,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAC;KAC9E;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW;QACzC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS;KACpE;IACD,SAAS,EAAE;QACT,CAAC,EAAE,SAAS;QACZ,CAAC,EAAE,eAAe;QAClB,CAAC,EAAE,eAAe;QAClB,CAAC,EAAE,WAAW;QACd,CAAC,EAAE,kBAAkB;QACrB,CAAC,EAAE,UAAU;KACd;IACD,KAAK,EAAE;QACL,MAAM,EAAE,qDAAqD;QAC7D,MAAM,EAAE,uDAAuD;QAC/D,OAAO,EAAE,mBAAmB;KAC7B;CACO,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Formatters
|
|
3
|
+
*
|
|
4
|
+
* Price, number, date, slug formatting.
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatPrice(price: number): string;
|
|
7
|
+
export declare function formatNumber(n: number): string;
|
|
8
|
+
export declare function formatDate(date: string | Date | null | undefined): string;
|
|
9
|
+
export declare function formatRating(rating: number, count?: number): string;
|
|
10
|
+
export declare function formatSlug(slug: string): string;
|
|
11
|
+
export declare function formatAuthor(username: string): string;
|
|
12
|
+
export declare function formatVersion(version: string): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Formatters
|
|
3
|
+
*
|
|
4
|
+
* Price, number, date, slug formatting.
|
|
5
|
+
*/
|
|
6
|
+
import { color } from './theme.js';
|
|
7
|
+
export function formatPrice(price) {
|
|
8
|
+
if (price === 0)
|
|
9
|
+
return color.success('free');
|
|
10
|
+
return color.warning(`$${price.toFixed(2)}`);
|
|
11
|
+
}
|
|
12
|
+
export function formatNumber(n) {
|
|
13
|
+
if (n >= 1_000_000)
|
|
14
|
+
return `${(n / 1_000_000).toFixed(1)}M`;
|
|
15
|
+
if (n >= 1000)
|
|
16
|
+
return `${(n / 1000).toFixed(1)}k`;
|
|
17
|
+
return String(n);
|
|
18
|
+
}
|
|
19
|
+
export function formatDate(date) {
|
|
20
|
+
if (!date)
|
|
21
|
+
return color.muted('—');
|
|
22
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
23
|
+
if (Number.isNaN(d.getTime()))
|
|
24
|
+
return color.muted('—');
|
|
25
|
+
return d.toISOString().slice(0, 10);
|
|
26
|
+
}
|
|
27
|
+
export function formatRating(rating, count) {
|
|
28
|
+
if (rating <= 0)
|
|
29
|
+
return color.muted('no ratings');
|
|
30
|
+
const stars = rating.toFixed(1);
|
|
31
|
+
const suffix = count ? color.muted(` (${count})`) : '';
|
|
32
|
+
return `${color.warning(stars)}${suffix}`;
|
|
33
|
+
}
|
|
34
|
+
export function formatSlug(slug) {
|
|
35
|
+
return color.bold(slug);
|
|
36
|
+
}
|
|
37
|
+
export function formatAuthor(username) {
|
|
38
|
+
const clean = username.startsWith('@') ? username : '@' + username;
|
|
39
|
+
return color.primary(clean);
|
|
40
|
+
}
|
|
41
|
+
export function formatVersion(version) {
|
|
42
|
+
return color.muted(`v${version.replace(/^v/, '')}`);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,IAAI,CAAC,IAAI,SAAS;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAA;IAC3D,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAA;IACjD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAsC;IAC/D,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAClC,MAAM,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1D,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACtD,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,KAAc;IACzD,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACjD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACtD,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,CAAA;AAC3C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,QAAQ,CAAA;IAClE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;AACrD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — UI Design System
|
|
3
|
+
*
|
|
4
|
+
* Single import for all visual components.
|
|
5
|
+
*/
|
|
6
|
+
export { color, detectColorLevel, BRAND } from './theme.js';
|
|
7
|
+
export type { ColorLevel } from './theme.js';
|
|
8
|
+
export { mascot, mascotWithWordmark, mascotWelcome, brandInline, separator, thinSeparator, header, card, indent, hint, action, icon, categoryLabel, INDENT, BLANK, } from './layout.js';
|
|
9
|
+
export { formatPrice, formatNumber, formatDate, formatRating, formatSlug, formatAuthor, formatVersion, } from './format.js';
|
|
10
|
+
export { table } from './table.js';
|
|
11
|
+
export type { TableOptions } from './table.js';
|
|
12
|
+
export { EXIT, CLI_MANIFEST } from './exit-codes.js';
|
|
13
|
+
export type { ExitCode } from './exit-codes.js';
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — UI Design System
|
|
3
|
+
*
|
|
4
|
+
* Single import for all visual components.
|
|
5
|
+
*/
|
|
6
|
+
export { color, detectColorLevel, BRAND } from './theme.js';
|
|
7
|
+
export { mascot, mascotWithWordmark, mascotWelcome, brandInline, separator, thinSeparator, header, card, indent, hint, action, icon, categoryLabel, INDENT, BLANK, } from './layout.js';
|
|
8
|
+
export { formatPrice, formatNumber, formatDate, formatRating, formatSlug, formatAuthor, formatVersion, } from './format.js';
|
|
9
|
+
export { table } from './table.js';
|
|
10
|
+
export { EXIT, CLI_MANIFEST } from './exit-codes.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAC,MAAM,YAAY,CAAA;AAGzD,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,SAAS,EACT,aAAa,EACb,MAAM,EACN,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,aAAa,EACb,MAAM,EACN,KAAK,GACN,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAGhC,OAAO,EAAC,IAAI,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Layout & Brand Elements
|
|
3
|
+
*
|
|
4
|
+
* Mascot, banner, frames, separators.
|
|
5
|
+
* All brand moments respect --json (never shown in machine output).
|
|
6
|
+
*/
|
|
7
|
+
export declare function mascot(): string;
|
|
8
|
+
export declare function mascotWithWordmark(): string;
|
|
9
|
+
export declare function mascotWelcome(username?: string): string;
|
|
10
|
+
export declare function brandInline(): string;
|
|
11
|
+
export declare function separator(width?: number): string;
|
|
12
|
+
export declare function thinSeparator(width?: number): string;
|
|
13
|
+
export declare function header(title: string, context?: string): string;
|
|
14
|
+
export declare function card(lines: string[], width?: number): string;
|
|
15
|
+
export declare const INDENT = " ";
|
|
16
|
+
export declare const BLANK = "";
|
|
17
|
+
export declare function indent(text: string, level?: number): string;
|
|
18
|
+
export declare const icon: {
|
|
19
|
+
success: string;
|
|
20
|
+
error: string;
|
|
21
|
+
warning: string;
|
|
22
|
+
info: string;
|
|
23
|
+
arrow: string;
|
|
24
|
+
dot: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function hint(text: string): string;
|
|
27
|
+
export declare function action(command: string): string;
|
|
28
|
+
export declare function categoryLabel(cat: string): string;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Layout & Brand Elements
|
|
3
|
+
*
|
|
4
|
+
* Mascot, banner, frames, separators.
|
|
5
|
+
* All brand moments respect --json (never shown in machine output).
|
|
6
|
+
*/
|
|
7
|
+
import { color } from './theme.js';
|
|
8
|
+
// --- Mascot (pixel-art robot, version B — 5 lines, half-block compressed) - //
|
|
9
|
+
const MASCOT_RAW = [
|
|
10
|
+
' ▄▄██▄▄▄▄██▄▄',
|
|
11
|
+
' ████ ██ ██',
|
|
12
|
+
' ████████████',
|
|
13
|
+
' ██▀▀▀▀██',
|
|
14
|
+
' ▀▀▀▀ ▀▀▀▀',
|
|
15
|
+
];
|
|
16
|
+
export function mascot() {
|
|
17
|
+
return MASCOT_RAW.map((line) => color.primary(line)).join('\n');
|
|
18
|
+
}
|
|
19
|
+
export function mascotWithWordmark() {
|
|
20
|
+
const m = MASCOT_RAW;
|
|
21
|
+
const pad = ' ';
|
|
22
|
+
// Wordmark sits beside mascot, vertically centered
|
|
23
|
+
const lines = [
|
|
24
|
+
color.primary(m[0]),
|
|
25
|
+
color.primary(m[1]) + pad + color.dim('my') + color.brandBold('Claude'),
|
|
26
|
+
color.primary(m[2]) + pad + color.muted('marketplace for claude code'),
|
|
27
|
+
color.primary(m[3]),
|
|
28
|
+
color.primary(m[4]),
|
|
29
|
+
];
|
|
30
|
+
return lines.join('\n');
|
|
31
|
+
}
|
|
32
|
+
export function mascotWelcome(username) {
|
|
33
|
+
const m = MASCOT_RAW;
|
|
34
|
+
const pad = ' ';
|
|
35
|
+
const greeting = username
|
|
36
|
+
? `welcome back, ${color.primary('@' + username)}`
|
|
37
|
+
: 'welcome to the marketplace';
|
|
38
|
+
const lines = [
|
|
39
|
+
color.primary(m[0]),
|
|
40
|
+
color.primary(m[1]) + pad + color.dim('my') + color.brandBold('Claude'),
|
|
41
|
+
color.primary(m[2]) + pad + color.muted(greeting),
|
|
42
|
+
color.primary(m[3]),
|
|
43
|
+
color.primary(m[4]),
|
|
44
|
+
];
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
// --- Inline brand --------------------------------------------------------- //
|
|
48
|
+
export function brandInline() {
|
|
49
|
+
return color.dim('my') + color.brandBold('Claude');
|
|
50
|
+
}
|
|
51
|
+
// --- Separators ----------------------------------------------------------- //
|
|
52
|
+
export function separator(width = 48) {
|
|
53
|
+
return color.muted('─'.repeat(width));
|
|
54
|
+
}
|
|
55
|
+
export function thinSeparator(width = 48) {
|
|
56
|
+
return color.muted('·'.repeat(width));
|
|
57
|
+
}
|
|
58
|
+
// --- Headers -------------------------------------------------------------- //
|
|
59
|
+
export function header(title, context) {
|
|
60
|
+
const brand = color.dim('my') + color.brandBold('C');
|
|
61
|
+
const ctx = context ? color.muted(` · ${context}`) : '';
|
|
62
|
+
return ` ${brand} ${color.muted('·')} ${title}${ctx}`;
|
|
63
|
+
}
|
|
64
|
+
// --- Cards / Frames ------------------------------------------------------- //
|
|
65
|
+
/** Strip ANSI escape codes for width calculation */
|
|
66
|
+
function stripAnsi(str) {
|
|
67
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
68
|
+
}
|
|
69
|
+
/** Word-wrap a line to fit within maxLen visible chars, preserving ANSI codes */
|
|
70
|
+
function wordWrap(line, maxLen) {
|
|
71
|
+
const visible = stripAnsi(line);
|
|
72
|
+
if (visible.length <= maxLen)
|
|
73
|
+
return [line];
|
|
74
|
+
// For lines with ANSI codes, we need to wrap by visible chars only.
|
|
75
|
+
// Simple approach: wrap the visible text, then re-apply as plain lines.
|
|
76
|
+
// This strips inner ANSI but avoids broken escape sequences.
|
|
77
|
+
const words = visible.split(' ');
|
|
78
|
+
const wrapped = [];
|
|
79
|
+
let current = '';
|
|
80
|
+
for (const word of words) {
|
|
81
|
+
if (current.length === 0) {
|
|
82
|
+
current = word;
|
|
83
|
+
}
|
|
84
|
+
else if (current.length + 1 + word.length <= maxLen) {
|
|
85
|
+
current += ' ' + word;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
wrapped.push(current);
|
|
89
|
+
current = word;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (current)
|
|
93
|
+
wrapped.push(current);
|
|
94
|
+
return wrapped;
|
|
95
|
+
}
|
|
96
|
+
export function card(lines, width) {
|
|
97
|
+
// Auto-detect width: use terminal width or default, capped at 72
|
|
98
|
+
const termWidth = process.stdout.columns || 80;
|
|
99
|
+
const cardWidth = width ?? Math.min(Math.max(termWidth - 4, 40), 72);
|
|
100
|
+
const innerWidth = cardWidth - 4; // 2 for borders + 2 for padding
|
|
101
|
+
const top = color.muted(` ┌${'─'.repeat(cardWidth - 2)}┐`);
|
|
102
|
+
const bot = color.muted(` └${'─'.repeat(cardWidth - 2)}┘`);
|
|
103
|
+
const border = color.muted('│');
|
|
104
|
+
const body = [];
|
|
105
|
+
for (const line of lines) {
|
|
106
|
+
const wrapped = wordWrap(line, innerWidth);
|
|
107
|
+
for (const wl of wrapped) {
|
|
108
|
+
const visible = stripAnsi(wl);
|
|
109
|
+
const pad = Math.max(0, innerWidth - visible.length);
|
|
110
|
+
body.push(` ${border} ${wl}${' '.repeat(pad)} ${border}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return [top, ...body, bot].join('\n');
|
|
114
|
+
}
|
|
115
|
+
// --- Spacing -------------------------------------------------------------- //
|
|
116
|
+
export const INDENT = ' ';
|
|
117
|
+
export const BLANK = '';
|
|
118
|
+
export function indent(text, level = 1) {
|
|
119
|
+
return INDENT.repeat(level) + text;
|
|
120
|
+
}
|
|
121
|
+
// --- Status indicators ---------------------------------------------------- //
|
|
122
|
+
export const icon = {
|
|
123
|
+
success: color.success('✓'),
|
|
124
|
+
error: color.error('✗'),
|
|
125
|
+
warning: color.warning('⚠'),
|
|
126
|
+
info: color.info('●'),
|
|
127
|
+
arrow: color.muted('→'),
|
|
128
|
+
dot: color.muted('·'),
|
|
129
|
+
};
|
|
130
|
+
// --- Hints / Actions ------------------------------------------------------ //
|
|
131
|
+
export function hint(text) {
|
|
132
|
+
return ` ${icon.arrow} ${color.muted(text)}`;
|
|
133
|
+
}
|
|
134
|
+
export function action(command) {
|
|
135
|
+
return ` ${icon.arrow} ${color.primary(command)}`;
|
|
136
|
+
}
|
|
137
|
+
// --- Category labels ------------------------------------------------------ //
|
|
138
|
+
const CATEGORY_COLORS = {
|
|
139
|
+
'skills': color.primary,
|
|
140
|
+
'skill': color.primary,
|
|
141
|
+
'agents': color.info,
|
|
142
|
+
'agent': color.info,
|
|
143
|
+
'squads': color.warning,
|
|
144
|
+
'squad': color.warning,
|
|
145
|
+
'workflows': color.success,
|
|
146
|
+
'workflow': color.success,
|
|
147
|
+
'design-systems': color.primary,
|
|
148
|
+
'design-system': color.primary,
|
|
149
|
+
'claude-md': color.muted,
|
|
150
|
+
'prompts': color.info,
|
|
151
|
+
'prompt': color.info,
|
|
152
|
+
'applications': color.warning,
|
|
153
|
+
'application': color.warning,
|
|
154
|
+
'systems': color.success,
|
|
155
|
+
'system': color.success,
|
|
156
|
+
};
|
|
157
|
+
export function categoryLabel(cat) {
|
|
158
|
+
const colorFn = CATEGORY_COLORS[cat] || color.muted;
|
|
159
|
+
return colorFn(cat);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/ui/layout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,gFAAgF;AAEhF,MAAM,UAAU,GAAG;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;CACjB,CAAA;AAED,MAAM,UAAU,MAAM;IACpB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,GAAG,UAAU,CAAA;IACpB,MAAM,GAAG,GAAG,KAAK,CAAA;IACjB,mDAAmD;IACnD,MAAM,KAAK,GAAG;QACZ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,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,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Table Renderer
|
|
3
|
+
*
|
|
4
|
+
* Clean tables with thin separators and category colors.
|
|
5
|
+
*/
|
|
6
|
+
export interface TableOptions {
|
|
7
|
+
indent?: number;
|
|
8
|
+
maxWidth?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function table(headers: string[], rows: string[][], opts?: TableOptions): string;
|
package/dist/ui/table.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Table Renderer
|
|
3
|
+
*
|
|
4
|
+
* Clean tables with thin separators and category colors.
|
|
5
|
+
*/
|
|
6
|
+
import { color } from './theme.js';
|
|
7
|
+
/** Strip ANSI escape codes for width calculation */
|
|
8
|
+
function stripAnsi(str) {
|
|
9
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
10
|
+
}
|
|
11
|
+
export function table(headers, rows, opts = {}) {
|
|
12
|
+
const { indent = 2, maxWidth = 80 } = opts;
|
|
13
|
+
if (rows.length === 0)
|
|
14
|
+
return '';
|
|
15
|
+
// Calculate column widths from visible text
|
|
16
|
+
const colWidths = headers.map((h, i) => Math.max(stripAnsi(h).length, ...rows.map((r) => stripAnsi(r[i] || '').length)));
|
|
17
|
+
const pad = ' '.repeat(indent);
|
|
18
|
+
const gap = ' ';
|
|
19
|
+
// Header
|
|
20
|
+
const headerLine = headers
|
|
21
|
+
.map((h, i) => {
|
|
22
|
+
const visible = stripAnsi(h).length;
|
|
23
|
+
return color.muted(h.toUpperCase()) + ' '.repeat(Math.max(0, colWidths[i] - visible));
|
|
24
|
+
})
|
|
25
|
+
.join(gap);
|
|
26
|
+
// Separator
|
|
27
|
+
const totalWidth = Math.min(colWidths.reduce((a, b) => a + b, 0) + (colWidths.length - 1) * gap.length, maxWidth - indent);
|
|
28
|
+
const sep = color.muted('─'.repeat(totalWidth));
|
|
29
|
+
// Data rows
|
|
30
|
+
const dataLines = rows.map((row) => row
|
|
31
|
+
.map((cell, i) => {
|
|
32
|
+
const visible = stripAnsi(cell).length;
|
|
33
|
+
return cell + ' '.repeat(Math.max(0, colWidths[i] - visible));
|
|
34
|
+
})
|
|
35
|
+
.join(gap));
|
|
36
|
+
return [
|
|
37
|
+
pad + headerLine,
|
|
38
|
+
pad + sep,
|
|
39
|
+
...dataLines.map((l) => pad + l),
|
|
40
|
+
].join('\n');
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/ui/table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,oDAAoD;AACpD,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC;AAOD,MAAM,UAAU,KAAK,CACnB,OAAiB,EACjB,IAAgB,EAChB,OAAqB,EAAE;IAEvB,MAAM,EAAC,MAAM,GAAG,CAAC,EAAE,QAAQ,GAAG,EAAE,EAAC,GAAG,IAAI,CAAA;IAExC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEhC,4CAA4C;IAC5C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACrC,IAAI,CAAC,GAAG,CACN,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EACnB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CACjD,CACF,CAAA;IAED,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9B,MAAM,GAAG,GAAG,IAAI,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AG,GAAG,GAAG;QACT,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;KACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* myClaude CLI — Color Theme
|
|
3
|
+
*
|
|
4
|
+
* Terracotta palette matching the web DS.
|
|
5
|
+
* Cascade: truecolor (#d97757) → 256-color (166) → basic ANSI (yellow) → no color
|
|
6
|
+
*/
|
|
7
|
+
declare const BRAND: {
|
|
8
|
+
readonly primary: readonly [217, 119, 87];
|
|
9
|
+
readonly muted: readonly [168, 162, 150];
|
|
10
|
+
readonly success: readonly [108, 158, 108];
|
|
11
|
+
readonly error: readonly [204, 94, 94];
|
|
12
|
+
readonly warning: readonly [214, 170, 82];
|
|
13
|
+
readonly info: readonly [130, 160, 200];
|
|
14
|
+
readonly surface: readonly [36, 35, 33];
|
|
15
|
+
};
|
|
16
|
+
export type ColorLevel = 'truecolor' | '256' | 'basic' | 'none';
|
|
17
|
+
export declare function detectColorLevel(): ColorLevel;
|
|
18
|
+
declare const RST = "\u001B[0m";
|
|
19
|
+
declare const BOLD = "\u001B[1m";
|
|
20
|
+
declare const DIM = "\u001B[2m";
|
|
21
|
+
export declare const color: {
|
|
22
|
+
primary: (t: string) => string;
|
|
23
|
+
muted: (t: string) => string;
|
|
24
|
+
success: (t: string) => string;
|
|
25
|
+
error: (t: string) => string;
|
|
26
|
+
warning: (t: string) => string;
|
|
27
|
+
info: (t: string) => string;
|
|
28
|
+
bold: (t: string) => string;
|
|
29
|
+
dim: (t: string) => string;
|
|
30
|
+
italic: (t: string) => string;
|
|
31
|
+
underline: (t: string) => string;
|
|
32
|
+
brandBold: (t: string) => string;
|
|
33
|
+
primaryBg: (t: string) => string;
|
|
34
|
+
};
|
|
35
|
+
export declare const codes: {
|
|
36
|
+
primary: () => string;
|
|
37
|
+
muted: () => string;
|
|
38
|
+
success: () => string;
|
|
39
|
+
error: () => string;
|
|
40
|
+
warning: () => string;
|
|
41
|
+
info: () => string;
|
|
42
|
+
bold: string;
|
|
43
|
+
dim: string;
|
|
44
|
+
italic: string;
|
|
45
|
+
};
|
|
46
|
+
export { BRAND, RST, BOLD, DIM };
|