@shepai/cli 1.6.0 → 1.6.1
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/src/presentation/cli/commands/settings/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/show.command.js +16 -18
- package/dist/src/presentation/cli/ui/index.d.ts +1 -1
- package/dist/src/presentation/cli/ui/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/output.d.ts +5 -4
- package/dist/src/presentation/cli/ui/output.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/output.js +6 -7
- package/dist/src/presentation/cli/ui/tables.d.ts +10 -5
- package/dist/src/presentation/cli/ui/tables.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/tables.js +62 -17
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.html +2 -2
- package/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/index.html +2 -2
- package/web/.next/server/app/index.rsc +1 -1
- package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.html +2 -2
- package/web/.next/server/app/version.rsc +1 -1
- package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
- package/web/.next/server/pages/404.html +2 -2
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- /package/web/.next/static/{KEXMk8lvSdd16ntuo5U2V → tXmFlRBlP8T8QaqOrcoHM}/_buildManifest.js +0 -0
- /package/web/.next/static/{KEXMk8lvSdd16ntuo5U2V → tXmFlRBlP8T8QaqOrcoHM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{KEXMk8lvSdd16ntuo5U2V → tXmFlRBlP8T8QaqOrcoHM}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAO5C;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAO5C;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA+B3C"}
|
|
@@ -13,7 +13,7 @@ import { OutputFormatter } from '../../ui/output.js';
|
|
|
13
13
|
import { getShepDbPath } from '../../../../infrastructure/services/filesystem/shep-directory.service.js';
|
|
14
14
|
import { getSettings } from '../../../../infrastructure/services/settings.service.js';
|
|
15
15
|
import { statSync } from 'node:fs';
|
|
16
|
-
import { messages
|
|
16
|
+
import { messages } from '../../ui/index.js';
|
|
17
17
|
/**
|
|
18
18
|
* Create the show settings command
|
|
19
19
|
*/
|
|
@@ -31,24 +31,10 @@ Examples:
|
|
|
31
31
|
.action((options) => {
|
|
32
32
|
try {
|
|
33
33
|
const settings = getSettings();
|
|
34
|
-
|
|
34
|
+
// Build database metadata for table format
|
|
35
|
+
const dbMeta = options.output === 'table' ? getDatabaseMeta() : undefined;
|
|
36
|
+
const output = OutputFormatter.format(settings, options.output, dbMeta);
|
|
35
37
|
console.log(output);
|
|
36
|
-
// Show database metadata for table format
|
|
37
|
-
if (options.output === 'table') {
|
|
38
|
-
const dbPath = getShepDbPath();
|
|
39
|
-
let sizeStr = 'unknown';
|
|
40
|
-
try {
|
|
41
|
-
const stats = statSync(dbPath);
|
|
42
|
-
sizeStr = formatFileSize(stats.size);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
// File may not be accessible
|
|
46
|
-
}
|
|
47
|
-
messages.newline();
|
|
48
|
-
console.log(fmt.heading('Database'));
|
|
49
|
-
console.log(` ${fmt.label('Path:')} ${dbPath}`);
|
|
50
|
-
console.log(` ${fmt.label('Size:')} ${sizeStr}`);
|
|
51
|
-
}
|
|
52
38
|
}
|
|
53
39
|
catch (error) {
|
|
54
40
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
@@ -57,6 +43,18 @@ Examples:
|
|
|
57
43
|
}
|
|
58
44
|
});
|
|
59
45
|
}
|
|
46
|
+
function getDatabaseMeta() {
|
|
47
|
+
const dbPath = getShepDbPath();
|
|
48
|
+
let size = 'unknown';
|
|
49
|
+
try {
|
|
50
|
+
const stats = statSync(dbPath);
|
|
51
|
+
size = formatFileSize(stats.size);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// File may not be accessible
|
|
55
|
+
}
|
|
56
|
+
return { path: dbPath, size };
|
|
57
|
+
}
|
|
60
58
|
function formatFileSize(bytes) {
|
|
61
59
|
if (bytes < 1024)
|
|
62
60
|
return `${bytes} B`;
|
|
@@ -15,6 +15,6 @@ export { colors, type Colors } from './colors.js';
|
|
|
15
15
|
export { symbols, type Symbols } from './symbols.js';
|
|
16
16
|
export { fmt, type Formatters } from './formatters.js';
|
|
17
17
|
export { messages, type Messages } from './messages.js';
|
|
18
|
-
export { TableFormatter } from './tables.js';
|
|
18
|
+
export { TableFormatter, type DatabaseMeta } from './tables.js';
|
|
19
19
|
export { OutputFormatter, type OutputFormat } from './output.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Output Format Utilities
|
|
3
3
|
*
|
|
4
4
|
* Provides utilities for formatting output in multiple formats:
|
|
5
|
-
* - Table (default,
|
|
5
|
+
* - Table (default, clean text-based layout)
|
|
6
6
|
* - JSON (structured data)
|
|
7
7
|
* - YAML (human-readable structured data)
|
|
8
8
|
*
|
|
9
9
|
* @module output
|
|
10
10
|
*/
|
|
11
|
+
import { type DatabaseMeta } from './tables.js';
|
|
11
12
|
export type OutputFormat = 'table' | 'json' | 'yaml';
|
|
12
13
|
/**
|
|
13
14
|
* Output formatter for multiple formats
|
|
@@ -16,11 +17,11 @@ export declare class OutputFormatter {
|
|
|
16
17
|
/**
|
|
17
18
|
* Formats data according to the specified output format
|
|
18
19
|
*/
|
|
19
|
-
static format(data: unknown, format: OutputFormat): string;
|
|
20
|
+
static format(data: unknown, format: OutputFormat, dbMeta?: DatabaseMeta): string;
|
|
20
21
|
/**
|
|
21
|
-
* Formats data as a
|
|
22
|
+
* Formats data as a clean text display
|
|
22
23
|
*/
|
|
23
|
-
static formatAsTable(data: unknown): string;
|
|
24
|
+
static formatAsTable(data: unknown, dbMeta?: DatabaseMeta): string;
|
|
24
25
|
/**
|
|
25
26
|
* Formats data as JSON
|
|
26
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAErD;;GAEG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM;IAWjF;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM;IAIlE;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;IAI1C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;CAG3C"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Output Format Utilities
|
|
3
3
|
*
|
|
4
4
|
* Provides utilities for formatting output in multiple formats:
|
|
5
|
-
* - Table (default,
|
|
5
|
+
* - Table (default, clean text-based layout)
|
|
6
6
|
* - JSON (structured data)
|
|
7
7
|
* - YAML (human-readable structured data)
|
|
8
8
|
*
|
|
@@ -17,10 +17,10 @@ export class OutputFormatter {
|
|
|
17
17
|
/**
|
|
18
18
|
* Formats data according to the specified output format
|
|
19
19
|
*/
|
|
20
|
-
static format(data, format) {
|
|
20
|
+
static format(data, format, dbMeta) {
|
|
21
21
|
switch (format) {
|
|
22
22
|
case 'table':
|
|
23
|
-
return OutputFormatter.formatAsTable(data);
|
|
23
|
+
return OutputFormatter.formatAsTable(data, dbMeta);
|
|
24
24
|
case 'json':
|
|
25
25
|
return OutputFormatter.formatAsJSON(data);
|
|
26
26
|
case 'yaml':
|
|
@@ -28,11 +28,10 @@ export class OutputFormatter {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Formats data as a
|
|
31
|
+
* Formats data as a clean text display
|
|
32
32
|
*/
|
|
33
|
-
static formatAsTable(data) {
|
|
34
|
-
|
|
35
|
-
return table.toString();
|
|
33
|
+
static formatAsTable(data, dbMeta) {
|
|
34
|
+
return TableFormatter.createSettingsTable(data, dbMeta);
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Formats data as JSON
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Table Formatting Utilities
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
5
|
-
*
|
|
4
|
+
* Provides clean text-based rendering for structured CLI output.
|
|
5
|
+
* Uses alignment, whitespace, and colors instead of box-drawing borders.
|
|
6
6
|
*
|
|
7
7
|
* @module tables
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
export interface DatabaseMeta {
|
|
10
|
+
path: string;
|
|
11
|
+
size: string;
|
|
12
|
+
}
|
|
10
13
|
/**
|
|
11
14
|
* Table formatter for CLI output
|
|
12
15
|
*/
|
|
13
16
|
export declare class TableFormatter {
|
|
17
|
+
private static readonly LABEL_WIDTH;
|
|
14
18
|
/**
|
|
15
|
-
* Creates a formatted
|
|
19
|
+
* Creates a clean, formatted settings display string.
|
|
16
20
|
*/
|
|
17
|
-
static createSettingsTable(settings: unknown):
|
|
21
|
+
static createSettingsTable(settings: unknown, dbMeta?: DatabaseMeta): string;
|
|
22
|
+
private static section;
|
|
18
23
|
}
|
|
19
24
|
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/tables.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/ui/tables.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAM;IAEzC;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM;IAgE5E,OAAO,CAAC,MAAM,CAAC,OAAO;CAcvB"}
|
|
@@ -1,32 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Table Formatting Utilities
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
5
|
-
*
|
|
4
|
+
* Provides clean text-based rendering for structured CLI output.
|
|
5
|
+
* Uses alignment, whitespace, and colors instead of box-drawing borders.
|
|
6
6
|
*
|
|
7
7
|
* @module tables
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { colors } from './colors.js';
|
|
10
|
+
import pc from 'picocolors';
|
|
10
11
|
/**
|
|
11
12
|
* Table formatter for CLI output
|
|
12
13
|
*/
|
|
13
14
|
export class TableFormatter {
|
|
15
|
+
static LABEL_WIDTH = 15;
|
|
14
16
|
/**
|
|
15
|
-
* Creates a formatted
|
|
17
|
+
* Creates a clean, formatted settings display string.
|
|
16
18
|
*/
|
|
17
|
-
static createSettingsTable(settings) {
|
|
19
|
+
static createSettingsTable(settings, dbMeta) {
|
|
18
20
|
const s = settings;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// Models
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const lines = [];
|
|
22
|
+
lines.push(` ${pc.bold(colors.brand('Settings'))}`);
|
|
23
|
+
lines.push('');
|
|
24
|
+
// Models
|
|
25
|
+
lines.push(...TableFormatter.section('Models', [
|
|
26
|
+
['Analyze', s.models.analyze],
|
|
27
|
+
['Requirements', s.models.requirements],
|
|
28
|
+
['Plan', s.models.plan],
|
|
29
|
+
['Implement', s.models.implement],
|
|
30
|
+
]));
|
|
31
|
+
// User
|
|
32
|
+
lines.push(...TableFormatter.section('User', [
|
|
33
|
+
['Name', s.user.name],
|
|
34
|
+
['Email', s.user.email],
|
|
35
|
+
['GitHub', s.user.githubUsername],
|
|
36
|
+
]));
|
|
37
|
+
// Environment
|
|
38
|
+
lines.push(...TableFormatter.section('Environment', [
|
|
39
|
+
['Editor', s.environment.defaultEditor],
|
|
40
|
+
['Shell', s.environment.shellPreference],
|
|
41
|
+
]));
|
|
42
|
+
// System
|
|
43
|
+
lines.push(...TableFormatter.section('System', [
|
|
44
|
+
['Auto-Update', String(s.system.autoUpdate)],
|
|
45
|
+
['Log Level', s.system.logLevel],
|
|
46
|
+
]));
|
|
47
|
+
// Agent
|
|
48
|
+
lines.push(...TableFormatter.section('Agent', [
|
|
49
|
+
['Type', s.agent.type],
|
|
50
|
+
['Auth', s.agent.authMethod],
|
|
51
|
+
...(s.agent.token ? [['Token', '••••••••']] : []),
|
|
52
|
+
]));
|
|
53
|
+
// Database
|
|
54
|
+
if (dbMeta) {
|
|
55
|
+
lines.push(...TableFormatter.section('Database', [
|
|
56
|
+
['Path', dbMeta.path],
|
|
57
|
+
['Size', dbMeta.size],
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
return lines.join('\n');
|
|
61
|
+
}
|
|
62
|
+
static section(title, rows) {
|
|
63
|
+
const lines = [];
|
|
64
|
+
lines.push(` ${pc.bold(title)}`);
|
|
65
|
+
for (const [label, value] of rows) {
|
|
66
|
+
const paddedLabel = label.padEnd(TableFormatter.LABEL_WIDTH);
|
|
67
|
+
if (value === undefined || value === null) {
|
|
68
|
+
lines.push(` ${colors.muted(paddedLabel)}${pc.italic(colors.muted('(not set)'))}`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
lines.push(` ${colors.muted(paddedLabel)}${value}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
lines.push('');
|
|
75
|
+
return lines;
|
|
31
76
|
}
|
|
32
77
|
}
|