@blkc-code/cli 0.1.3 → 0.3.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/blkc.cjs +75131 -0
- package/package.json +18 -30
- package/bin/blkc.js +0 -24
- package/dist/cli.js +0 -24
- package/dist/commands/block.d.ts +0 -13
- package/dist/commands/block.d.ts.map +0 -1
- package/dist/commands/block.js +0 -196
- package/dist/commands/block.js.map +0 -1
- package/dist/commands/circuit.d.ts +0 -13
- package/dist/commands/circuit.d.ts.map +0 -1
- package/dist/commands/circuit.js +0 -160
- package/dist/commands/circuit.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -14
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -332
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/kit.d.ts +0 -13
- package/dist/commands/kit.d.ts.map +0 -1
- package/dist/commands/kit.js +0 -152
- package/dist/commands/kit.js.map +0 -1
- package/dist/commands/logbook.d.ts +0 -13
- package/dist/commands/logbook.d.ts.map +0 -1
- package/dist/commands/logbook.js +0 -170
- package/dist/commands/logbook.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -64
- package/dist/index.js.map +0 -1
- package/src/__tests__/smoke.test.ts +0 -8
- package/src/commands/block.ts +0 -219
- package/src/commands/circuit.ts +0 -182
- package/src/commands/deploy.ts +0 -373
- package/src/commands/kit.ts +0 -173
- package/src/commands/logbook.ts +0 -194
- package/src/index.ts +0 -70
package/src/commands/kit.ts
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BLKC CLI - Kit Commands
|
|
3
|
-
*
|
|
4
|
-
* Commands for working with BLKC Kits.
|
|
5
|
-
*
|
|
6
|
-
* @package @blkc-code/cli
|
|
7
|
-
* @license Apache-2.0
|
|
8
|
-
* @author Black Code Enterprises LLC
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Command } from "commander";
|
|
12
|
-
import chalk from "chalk";
|
|
13
|
-
import ora from "ora";
|
|
14
|
-
import { readFile } from "node:fs/promises";
|
|
15
|
-
import path from "node:path";
|
|
16
|
-
import { KitSchema } from "@blkc-code/core";
|
|
17
|
-
|
|
18
|
-
// ============================================================================
|
|
19
|
-
// Command: kit validate
|
|
20
|
-
// ============================================================================
|
|
21
|
-
|
|
22
|
-
function setupValidateCommand(program: Command): void {
|
|
23
|
-
program
|
|
24
|
-
.command("validate <manifest-path>")
|
|
25
|
-
.description("Validate a Kit manifest")
|
|
26
|
-
.action(async (manifestPath: string) => {
|
|
27
|
-
const spinner = ora("Validating Kit manifest...").start();
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const absolutePath = path.resolve(process.cwd(), manifestPath);
|
|
31
|
-
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
32
|
-
const manifest = JSON.parse(content);
|
|
33
|
-
|
|
34
|
-
const result = KitSchema.safeParse(manifest);
|
|
35
|
-
|
|
36
|
-
if (!result.success) {
|
|
37
|
-
spinner.fail("Validation failed");
|
|
38
|
-
console.error(chalk.red("\nValidation errors:"));
|
|
39
|
-
for (const issue of result.error.issues) {
|
|
40
|
-
console.error(` - ${chalk.red(issue.path.join("."))}: ${issue.message}`);
|
|
41
|
-
}
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
spinner.succeed("Kit manifest is valid");
|
|
46
|
-
const kit = result.data;
|
|
47
|
-
console.log(chalk.gray(`\nKit ID: ${kit.id}`));
|
|
48
|
-
console.log(chalk.gray(`Name: ${kit.name}`));
|
|
49
|
-
console.log(chalk.gray(`Blocks: ${kit.blocks.length}`));
|
|
50
|
-
} catch (error) {
|
|
51
|
-
spinner.fail(`Failed to validate: ${error}`);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ============================================================================
|
|
58
|
-
// Command: kit info
|
|
59
|
-
// ============================================================================
|
|
60
|
-
|
|
61
|
-
function setupInfoCommand(program: Command): void {
|
|
62
|
-
program
|
|
63
|
-
.command("info <manifest-path>")
|
|
64
|
-
.description("Show detailed information about a Kit")
|
|
65
|
-
.action(async (manifestPath: string) => {
|
|
66
|
-
const spinner = ora("Loading Kit info...").start();
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
const absolutePath = path.resolve(process.cwd(), manifestPath);
|
|
70
|
-
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
71
|
-
const manifest = JSON.parse(content);
|
|
72
|
-
|
|
73
|
-
const result = KitSchema.safeParse(manifest);
|
|
74
|
-
if (!result.success) {
|
|
75
|
-
spinner.fail("Invalid Kit manifest");
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const kit = result.data;
|
|
80
|
-
spinner.succeed(`Kit: ${kit.id}`);
|
|
81
|
-
|
|
82
|
-
console.log(chalk.bold("\nKit Information"));
|
|
83
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
84
|
-
console.log(chalk.gray(`ID: ${kit.id}`));
|
|
85
|
-
console.log(chalk.gray(`Name: ${kit.name}`));
|
|
86
|
-
console.log(chalk.gray(`Summary: ${kit.summary}`));
|
|
87
|
-
console.log(chalk.gray(`Version: ${kit.version}`));
|
|
88
|
-
console.log(chalk.gray(`Category: ${kit.category}`));
|
|
89
|
-
console.log(chalk.gray(`License: ${kit.license}`));
|
|
90
|
-
console.log(chalk.gray(`Visibility: ${kit.visibility}`));
|
|
91
|
-
|
|
92
|
-
if (kit.tags.length > 0) {
|
|
93
|
-
console.log(chalk.gray(`Tags: ${kit.tags.join(", ")}`));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
console.log(chalk.bold("\nBlocks"));
|
|
97
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
98
|
-
for (const blockRef of kit.blocks) {
|
|
99
|
-
console.log(chalk.gray(` - ${blockRef.blockId}@${blockRef.version}${blockRef.alias ? ` (as ${blockRef.alias})` : ''}`));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (kit.theme) {
|
|
103
|
-
console.log(chalk.bold("\nTheme"));
|
|
104
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
105
|
-
console.log(chalk.gray(` Version: ${kit.theme.version}`));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (kit.content && kit.content.pages.length > 0) {
|
|
109
|
-
console.log(chalk.bold("\nContent"));
|
|
110
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
111
|
-
console.log(chalk.gray(` Pages: ${kit.content.pages.length}`));
|
|
112
|
-
for (const page of kit.content.pages) {
|
|
113
|
-
console.log(chalk.gray(` - ${page.slug || "(home)"}: ${page.title} (${page.blocks.length} blocks)`));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (kit.repository) {
|
|
118
|
-
console.log(chalk.bold("\nRepository"));
|
|
119
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
120
|
-
console.log(chalk.gray(kit.repository));
|
|
121
|
-
}
|
|
122
|
-
} catch (error) {
|
|
123
|
-
spinner.fail(`Failed to show info: ${error}`);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// ============================================================================
|
|
130
|
-
// Command: kit publish
|
|
131
|
-
// ============================================================================
|
|
132
|
-
|
|
133
|
-
function setupPublishCommand(program: Command): void {
|
|
134
|
-
program
|
|
135
|
-
.command("publish")
|
|
136
|
-
.description("Publish a Kit to registry (simulated)")
|
|
137
|
-
.option("--dry-run", "Simulate publish without actually publishing")
|
|
138
|
-
.action(async (options) => {
|
|
139
|
-
const { dryRun } = options;
|
|
140
|
-
const spinner = ora(dryRun ? "Simulating publish..." : "Publishing Kit...").start();
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
// Simulate publish
|
|
144
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
145
|
-
|
|
146
|
-
if (dryRun) {
|
|
147
|
-
spinner.succeed("Dry run: Kit would be published");
|
|
148
|
-
} else {
|
|
149
|
-
spinner.succeed("Kit published successfully");
|
|
150
|
-
console.log(chalk.gray("\nNote: Actual publishing requires registry authentication."));
|
|
151
|
-
}
|
|
152
|
-
} catch (error) {
|
|
153
|
-
spinner.fail(`Failed to publish: ${error}`);
|
|
154
|
-
process.exit(1);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// ============================================================================
|
|
160
|
-
// Register Commands
|
|
161
|
-
// ============================================================================
|
|
162
|
-
|
|
163
|
-
/** Register all kit commands with the program */
|
|
164
|
-
export function registerKitCommands(program: Command): void {
|
|
165
|
-
const kitProgram = program
|
|
166
|
-
.command("kit")
|
|
167
|
-
.description("Kit commands")
|
|
168
|
-
.alias("k");
|
|
169
|
-
|
|
170
|
-
setupValidateCommand(kitProgram);
|
|
171
|
-
setupInfoCommand(kitProgram);
|
|
172
|
-
setupPublishCommand(kitProgram);
|
|
173
|
-
}
|
package/src/commands/logbook.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BLKC CLI - Logbook Commands
|
|
3
|
-
*
|
|
4
|
-
* Commands for working with BLKC Logbook.
|
|
5
|
-
*
|
|
6
|
-
* @package @blkc-code/cli
|
|
7
|
-
* @license Apache-2.0
|
|
8
|
-
* @author Black Code Enterprises LLC
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Command } from "commander";
|
|
12
|
-
import chalk from "chalk";
|
|
13
|
-
import ora from "ora";
|
|
14
|
-
import { stat } from "node:fs/promises";
|
|
15
|
-
import path from "node:path";
|
|
16
|
-
import { Logbook, verifyLogbook, readLogbook, LogbookVerificationResult } from "@blkc-code/logbook";
|
|
17
|
-
|
|
18
|
-
// ============================================================================
|
|
19
|
-
// Command: logbook verify
|
|
20
|
-
// ============================================================================
|
|
21
|
-
|
|
22
|
-
function setupVerifyCommand(program: Command): void {
|
|
23
|
-
program
|
|
24
|
-
.command("verify <file-path>")
|
|
25
|
-
.description("Verify Logbook chain integrity")
|
|
26
|
-
.option("--algorithm <algo>", "Hash algorithm", "sha256")
|
|
27
|
-
.action(async (filePath: string, options: { algorithm: string }) => {
|
|
28
|
-
const spinner = ora("Verifying Logbook...").start();
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
32
|
-
|
|
33
|
-
// Check if file exists
|
|
34
|
-
try {
|
|
35
|
-
await stat(absolutePath);
|
|
36
|
-
} catch {
|
|
37
|
-
spinner.fail(`File not found: ${absolutePath}`);
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const result: LogbookVerificationResult = await verifyLogbook(absolutePath, options.algorithm);
|
|
42
|
-
|
|
43
|
-
if (result.valid) {
|
|
44
|
-
spinner.succeed("Logbook verification passed");
|
|
45
|
-
console.log(chalk.green("\n✓ Chain is valid"));
|
|
46
|
-
console.log(chalk.gray(` Entries: ${result.entries.length}`));
|
|
47
|
-
console.log(chalk.gray(` Last hash: ${result.lastHash?.substring(0, 16)}...`));
|
|
48
|
-
} else {
|
|
49
|
-
spinner.fail("Logbook verification failed");
|
|
50
|
-
console.error(chalk.red("\n✗ Chain is invalid"));
|
|
51
|
-
console.error(chalk.red(` Issues: ${result.issues.length}`));
|
|
52
|
-
|
|
53
|
-
for (const issue of result.issues) {
|
|
54
|
-
console.error(chalk.red(`\n Entry ${issue.index}:`));
|
|
55
|
-
console.error(chalk.red(` ${issue.message}`));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
spinner.fail(`Failed to verify: ${error}`);
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// ============================================================================
|
|
68
|
-
// Command: logbook check
|
|
69
|
-
// ============================================================================
|
|
70
|
-
|
|
71
|
-
function setupCheckCommand(program: Command): void {
|
|
72
|
-
program
|
|
73
|
-
.command("check <file-path>")
|
|
74
|
-
.description("Check Logbook for issues (alias for verify)")
|
|
75
|
-
.action(async (filePath: string) => {
|
|
76
|
-
// Delegate to verify
|
|
77
|
-
const verifyCmd = program.commands.find((c) => c.name() === "verify");
|
|
78
|
-
if (verifyCmd) {
|
|
79
|
-
await (verifyCmd.action as unknown as (filePath: string, options: Record<string, unknown>) => Promise<void>)(filePath, {});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// ============================================================================
|
|
85
|
-
// Command: logbook info
|
|
86
|
-
// ============================================================================
|
|
87
|
-
|
|
88
|
-
function setupInfoCommand(program: Command): void {
|
|
89
|
-
program
|
|
90
|
-
.command("info <file-path>")
|
|
91
|
-
.description("Show Logbook information")
|
|
92
|
-
.action(async (filePath: string) => {
|
|
93
|
-
const spinner = ora("Loading Logbook info...").start();
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
97
|
-
|
|
98
|
-
// Check if file exists
|
|
99
|
-
try {
|
|
100
|
-
await stat(absolutePath);
|
|
101
|
-
} catch {
|
|
102
|
-
spinner.fail(`File not found: ${absolutePath}`);
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const logbook = new Logbook({ filePath: absolutePath });
|
|
107
|
-
const info = await logbook.info();
|
|
108
|
-
|
|
109
|
-
spinner.succeed(`Logbook: ${info.filePath}`);
|
|
110
|
-
|
|
111
|
-
console.log(chalk.bold("\nLogbook Information"));
|
|
112
|
-
console.log(chalk.gray("─".repeat(40)));
|
|
113
|
-
console.log(chalk.gray(`File: ${info.filePath}`));
|
|
114
|
-
console.log(chalk.gray(`Entry count: ${info.entryCount}`));
|
|
115
|
-
|
|
116
|
-
if (info.firstEntry) {
|
|
117
|
-
console.log(chalk.gray(`\nFirst Entry:`));
|
|
118
|
-
console.log(chalk.gray(` Timestamp: ${info.firstEntry.timestamp}`));
|
|
119
|
-
console.log(chalk.gray(` Actor: ${info.firstEntry.actor.name}`));
|
|
120
|
-
console.log(chalk.gray(` Event: ${info.firstEntry.event}`));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (info.lastEntry) {
|
|
124
|
-
console.log(chalk.gray(`\nLast Entry:`));
|
|
125
|
-
console.log(chalk.gray(` Timestamp: ${info.lastEntry.timestamp}`));
|
|
126
|
-
console.log(chalk.gray(` Actor: ${info.lastEntry.actor.name}`));
|
|
127
|
-
console.log(chalk.gray(` Event: ${info.lastEntry.event}`));
|
|
128
|
-
console.log(chalk.gray(` Hash: ${info.lastHash?.substring(0, 16)}...`));
|
|
129
|
-
}
|
|
130
|
-
} catch (error) {
|
|
131
|
-
spinner.fail(`Failed to show info: ${error}`);
|
|
132
|
-
process.exit(1);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// ============================================================================
|
|
138
|
-
// Command: logbook tail
|
|
139
|
-
// ============================================================================
|
|
140
|
-
|
|
141
|
-
function setupTailCommand(program: Command): void {
|
|
142
|
-
program
|
|
143
|
-
.command("tail <file-path>")
|
|
144
|
-
.description("Show the last N entries from Logbook")
|
|
145
|
-
.option("--lines <n>", "Number of lines to show", "10")
|
|
146
|
-
.action(async (filePath: string, options: { lines: string }) => {
|
|
147
|
-
const spinner = ora("Reading Logbook...").start();
|
|
148
|
-
|
|
149
|
-
try {
|
|
150
|
-
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
151
|
-
const lines = parseInt(options.lines, 10) || 10;
|
|
152
|
-
|
|
153
|
-
const entries = await readLogbook(absolutePath);
|
|
154
|
-
const tailEntries = entries.slice(-lines);
|
|
155
|
-
|
|
156
|
-
spinner.succeed(`Showing last ${tailEntries.length} entries`);
|
|
157
|
-
|
|
158
|
-
for (const entry of tailEntries) {
|
|
159
|
-
console.log(chalk.gray(`\n[${entry.timestamp}] ${entry.event}`));
|
|
160
|
-
console.log(chalk.gray(` Actor: ${entry.actor.name}`));
|
|
161
|
-
if (entry.subject) {
|
|
162
|
-
console.log(chalk.gray(` Subject: ${entry.subject.type}:${entry.subject.id}`));
|
|
163
|
-
}
|
|
164
|
-
if (entry.hash) {
|
|
165
|
-
console.log(chalk.gray(` Hash: ${entry.hash.substring(0, 16)}...`));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (tailEntries.length === 0) {
|
|
170
|
-
console.log(chalk.gray("\nNo entries found"));
|
|
171
|
-
}
|
|
172
|
-
} catch (error) {
|
|
173
|
-
spinner.fail(`Failed to tail: ${error}`);
|
|
174
|
-
process.exit(1);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// ============================================================================
|
|
180
|
-
// Register Commands
|
|
181
|
-
// ============================================================================
|
|
182
|
-
|
|
183
|
-
/** Register all logbook commands with the program */
|
|
184
|
-
export function registerLogbookCommands(program: Command): void {
|
|
185
|
-
const logbookProgram = program
|
|
186
|
-
.command("logbook")
|
|
187
|
-
.description("Logbook commands")
|
|
188
|
-
.alias("l");
|
|
189
|
-
|
|
190
|
-
setupVerifyCommand(logbookProgram);
|
|
191
|
-
setupCheckCommand(logbookProgram);
|
|
192
|
-
setupInfoCommand(logbookProgram);
|
|
193
|
-
setupTailCommand(logbookProgram);
|
|
194
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BLKC CLI - Developer tools for BLKC
|
|
3
|
-
*
|
|
4
|
-
* This package provides command-line tools for working with BLKC Blocks, Kits, Circuits, and Logbook.
|
|
5
|
-
*
|
|
6
|
-
* @package @blkc-code/cli
|
|
7
|
-
* @version 0.1.0
|
|
8
|
-
* @license Apache-2.0
|
|
9
|
-
* @author Black Code Enterprises LLC
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { Command } from "commander";
|
|
13
|
-
import { registerBlockCommands } from "./commands/block.js";
|
|
14
|
-
import { registerKitCommands } from "./commands/kit.js";
|
|
15
|
-
import { registerCircuitCommands } from "./commands/circuit.js";
|
|
16
|
-
import { registerLogbookCommands } from "./commands/logbook.js";
|
|
17
|
-
import { registerDeployCommands } from "./commands/deploy.js";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The main BLKC CLI program.
|
|
21
|
-
*/
|
|
22
|
-
export const program = new Command();
|
|
23
|
-
|
|
24
|
-
// Configure the CLI
|
|
25
|
-
program
|
|
26
|
-
.name("blkc")
|
|
27
|
-
.description("BLKC developer CLI - Tools for working with Blocks, Kits, Circuits, and Logbook")
|
|
28
|
-
.version("0.1.0");
|
|
29
|
-
|
|
30
|
-
// Show help after errors
|
|
31
|
-
program.showHelpAfterError();
|
|
32
|
-
|
|
33
|
-
// Configure output to prevent duplicate errors
|
|
34
|
-
program.configureOutput({
|
|
35
|
-
outputError: (str) => {
|
|
36
|
-
// Only print the error if it's not already been handled
|
|
37
|
-
if (str && !str.includes("error:")) {
|
|
38
|
-
console.error(str.trim());
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// Register all command groups
|
|
44
|
-
registerBlockCommands(program);
|
|
45
|
-
registerKitCommands(program);
|
|
46
|
-
registerCircuitCommands(program);
|
|
47
|
-
registerLogbookCommands(program);
|
|
48
|
-
registerDeployCommands(program);
|
|
49
|
-
|
|
50
|
-
// Add a global --help flag
|
|
51
|
-
program.option("--debug", "Enable debug mode");
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Run the CLI.
|
|
55
|
-
*/
|
|
56
|
-
export async function run(): Promise<void> {
|
|
57
|
-
try {
|
|
58
|
-
await program.parseAsync(process.argv);
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if (error instanceof Error) {
|
|
61
|
-
console.error(`Error: ${error.message}`);
|
|
62
|
-
} else {
|
|
63
|
-
console.error("An unknown error occurred");
|
|
64
|
-
}
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Export for bin usage
|
|
70
|
-
export default program;
|