@orbitpanel/cli 0.1.0 → 0.2.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/dist/lib/ui.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * UI helpers for @orbitpanel/cli.
3
+ * Consistent branding, colors, and formatting across all commands.
4
+ */
5
+ import chalk from 'chalk';
6
+ // Brand colors
7
+ const BRAND = chalk.hex('#0D9488'); // Teal (Orbit accent)
8
+ const BRAND_DIM = chalk.hex('#0D9488').dim;
9
+ const HEADER = chalk.hex('#1B2A4A').bold; // Navy (Orbit primary)
10
+ const SEPARATOR = chalk.dim('─'.repeat(50));
11
+ /** Print the Orbit CLI banner. */
12
+ export function banner(version) {
13
+ const lines = [
14
+ '',
15
+ ` ${BRAND.bold('ORBIT')} ${chalk.dim('CLI')} ${chalk.dim(`v${version}`)}`,
16
+ ` ${chalk.dim('Strumento locale per sviluppatori OrbitPanel')}`,
17
+ SEPARATOR,
18
+ ];
19
+ return lines.join('\n');
20
+ }
21
+ /** Section header with teal accent. */
22
+ export function section(title) {
23
+ return `\n ${BRAND.bold(title)}`;
24
+ }
25
+ /** Key-value pair with aligned formatting. */
26
+ export function kv(key, value, width = 14) {
27
+ return ` ${chalk.dim(key.padEnd(width))} ${value}`;
28
+ }
29
+ /** Success message with green checkmark. */
30
+ export function success(msg) {
31
+ return ` ${chalk.green('✓')} ${msg}`;
32
+ }
33
+ /** Error message with red cross. */
34
+ export function error(msg) {
35
+ return ` ${chalk.red('✗')} ${msg}`;
36
+ }
37
+ /** Warning message with yellow triangle. */
38
+ export function warn(msg) {
39
+ return ` ${chalk.yellow('!')} ${msg}`;
40
+ }
41
+ /** Info message with dim bullet. */
42
+ export function info(msg) {
43
+ return ` ${chalk.dim('·')} ${msg}`;
44
+ }
45
+ /** Hint text (dim, indented). */
46
+ export function hint(msg) {
47
+ return ` ${chalk.dim(msg)}`;
48
+ }
49
+ /** Status badge with color. */
50
+ export function badge(label, color = 'dim') {
51
+ const colors = {
52
+ green: chalk.bgGreen.black,
53
+ yellow: chalk.bgYellow.black,
54
+ red: chalk.bgRed.white,
55
+ blue: chalk.bgBlue.white,
56
+ teal: chalk.bgHex('#0D9488').white,
57
+ dim: chalk.dim,
58
+ };
59
+ return (colors[color] ?? chalk.dim)(` ${label} `);
60
+ }
61
+ /** Priority badge. */
62
+ export function priorityBadge(priority) {
63
+ const map = {
64
+ LOW: ['BASSA', 'dim'],
65
+ MEDIUM: ['MEDIA', 'blue'],
66
+ HIGH: ['ALTA', 'yellow'],
67
+ URGENT: ['URGENTE', 'red'],
68
+ };
69
+ const [label, color] = map[priority] ?? [priority, 'dim'];
70
+ return badge(label, color);
71
+ }
72
+ /** Status badge. */
73
+ export function statusBadge(status) {
74
+ const map = {
75
+ scheduled: ['Pianificato', 'blue'],
76
+ in_progress: ['In Corso', 'yellow'],
77
+ completed: ['Completato', 'green'],
78
+ verified: ['Verificato', 'teal'],
79
+ };
80
+ const [label, color] = map[status] ?? [status, 'dim'];
81
+ return badge(label, color);
82
+ }
83
+ /** Origin badge. */
84
+ export function originBadge(origin) {
85
+ const map = {
86
+ manual: ['Manuale', 'dim'],
87
+ ticket: ['Ticket', 'blue'],
88
+ protocol: ['Protocollo', 'dim'],
89
+ agent: ['Agent', 'green'],
90
+ cli: ['CLI', 'teal'],
91
+ };
92
+ const [label, color] = map[origin] ?? [origin, 'dim'];
93
+ return badge(label, color);
94
+ }
95
+ /** Format a table row for intervention list. */
96
+ export function interventionRow(item) {
97
+ const id = chalk.dim(String(item.id ?? '').slice(0, 8));
98
+ const title = String(item.title ?? '').slice(0, 40).padEnd(40);
99
+ const status = statusBadge(String(item.status ?? ''));
100
+ const priority = priorityBadge(String(item.priority ?? ''));
101
+ const origin = originBadge(String(item.origin ?? ''));
102
+ const date = chalk.dim(String(item.created_at ?? '').slice(0, 10));
103
+ return ` ${id} ${title} ${status} ${priority} ${origin} ${date}`;
104
+ }
105
+ /** Separator line. */
106
+ export function separator() {
107
+ return SEPARATOR;
108
+ }
109
+ /** Empty line. */
110
+ export function blank() {
111
+ return '';
112
+ }
113
+ //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/lib/ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAe;AACf,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAO,sBAAsB;AAChE,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC;AAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,uBAAuB;AAEjE,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AAE5C,kCAAkC;AAClC,MAAM,UAAU,MAAM,CAAC,OAAe;IACpC,MAAM,KAAK,GAAG;QACZ,EAAE;QACF,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE;QAC1E,KAAK,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,EAAE;QAChE,SAAS;KACV,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACpC,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,EAAE,CAAC,GAAW,EAAE,KAAa,EAAE,KAAK,GAAG,EAAE;IACvD,OAAO,KAAK,KAAK,CAAC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S;IACvB,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,kBAAkB;AAClB,MAAM,UAAU,KAAK;IACnB,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -89,10 +89,10 @@
89
89
  "login": {
90
90
  "aliases": [],
91
91
  "args": {},
92
- "description": "Salva il token MCP per autenticarsi con il backend Orbit.\nIl token si genera dalla UI di Orbit Sito Token MCP Crea Token.",
92
+ "description": "Salva il token MCP per autenticarsi con il backend Orbit.\nIl token si genera dalla UI di Orbit > Sito > Token MCP > Crea Token.",
93
93
  "examples": [
94
94
  "<%= config.bin %> login --token orbit_mcp_xxx",
95
- "<%= config.bin %> login --token orbit_mcp_xxx --api-url https://api.custom.com"
95
+ "ORBIT_TOKEN=orbit_mcp_xxx <%= config.bin %> login"
96
96
  ],
97
97
  "flags": {
98
98
  "token": {
@@ -198,6 +198,27 @@
198
198
  "serve.js"
199
199
  ]
200
200
  },
201
+ "shell": {
202
+ "aliases": [],
203
+ "args": {},
204
+ "description": "Apre un ambiente interattivo con menu navigabili per gestire sessioni, report e interventi.",
205
+ "flags": {},
206
+ "hasDynamicHelp": false,
207
+ "hiddenAliases": [],
208
+ "id": "shell",
209
+ "pluginAlias": "@orbitpanel/cli",
210
+ "pluginName": "@orbitpanel/cli",
211
+ "pluginType": "core",
212
+ "strict": true,
213
+ "summary": "Avvia la shell interattiva di Orbit CLI",
214
+ "enableJsonFlag": false,
215
+ "isESM": true,
216
+ "relativePath": [
217
+ "dist",
218
+ "commands",
219
+ "shell.js"
220
+ ]
221
+ },
201
222
  "status": {
202
223
  "aliases": [],
203
224
  "args": {},
@@ -728,5 +749,5 @@
728
749
  ]
729
750
  }
730
751
  },
731
- "version": "0.1.0"
752
+ "version": "0.2.0"
732
753
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbitpanel/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Orbit CLI — strumento locale per sviluppatori OrbitPanel",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,17 +21,30 @@
21
21
  "postpack": "rm -f oclif.manifest.json",
22
22
  "prepack": "npm run build"
23
23
  },
24
- "keywords": ["orbit", "cli", "mcp", "wordpress", "hosting", "maintenance"],
24
+ "keywords": [
25
+ "orbit",
26
+ "cli",
27
+ "mcp",
28
+ "wordpress",
29
+ "hosting",
30
+ "maintenance"
31
+ ],
25
32
  "author": "PrincipiADV",
26
33
  "license": "MIT",
27
34
  "dependencies": {
35
+ "@clack/prompts": "^1.2.0",
28
36
  "@modelcontextprotocol/sdk": "^1.12.0",
29
37
  "@oclif/core": "^4.0.0",
30
38
  "@oclif/plugin-help": "^6.0.0",
31
- "chalk": "^5.4.0"
39
+ "boxen": "^8.0.1",
40
+ "chalk": "^5.4.0",
41
+ "gradient-string": "^3.0.0",
42
+ "ora": "^9.3.0",
43
+ "terminal-link": "^5.0.0"
32
44
  },
33
45
  "devDependencies": {
34
46
  "@oclif/test": "^4.0.0",
47
+ "@types/gradient-string": "^1.1.6",
35
48
  "@types/node": "^22.0.0",
36
49
  "oclif": "^4.0.0",
37
50
  "tsx": "^4.19.0",
@@ -45,12 +58,21 @@
45
58
  "bin": "orbit",
46
59
  "dirname": "orbit",
47
60
  "commands": "./dist/commands",
61
+ "default": "shell",
48
62
  "topicSeparator": " ",
49
63
  "topics": {
50
- "session": { "description": "Gestione sessioni di lavoro" },
51
- "intervention": { "description": "Gestione interventi Orbit" },
52
- "report": { "description": "Invio report a Orbit" },
53
- "note": { "description": "Note sessione" }
64
+ "session": {
65
+ "description": "Gestione sessioni di lavoro"
66
+ },
67
+ "intervention": {
68
+ "description": "Gestione interventi Orbit"
69
+ },
70
+ "report": {
71
+ "description": "Invio report a Orbit"
72
+ },
73
+ "note": {
74
+ "description": "Note sessione"
75
+ }
54
76
  },
55
77
  "hooks": {
56
78
  "prerun": "./dist/hooks/prerun"