@nostrbox/cli 1.1.0 ā 1.1.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/nip05check.js +66 -39
- package/dist/nip05check.js.map +1 -1
- package/dist/nip05lookup.js +90 -43
- package/dist/nip05lookup.js.map +1 -1
- package/dist/utils/argParser.d.ts +31 -0
- package/dist/utils/argParser.d.ts.map +1 -0
- package/dist/utils/argParser.js +149 -0
- package/dist/utils/argParser.js.map +1 -0
- package/package.json +3 -2
package/dist/nip05check.js
CHANGED
|
@@ -1,55 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
const core_1 = require("@nostrbox/core");
|
|
8
|
+
const ora_1 = __importDefault(require("ora"));
|
|
9
|
+
const argParser_js_1 = require("./utils/argParser.js");
|
|
10
|
+
function createParser() {
|
|
11
|
+
return new argParser_js_1.ArgumentParser({
|
|
12
|
+
options: [
|
|
13
|
+
{
|
|
14
|
+
name: 'omit-relay-check',
|
|
15
|
+
alias: 'o',
|
|
16
|
+
type: 'flag',
|
|
17
|
+
description: 'Skip relay validation'
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
positional: {
|
|
21
|
+
name: 'domain',
|
|
22
|
+
description: 'Domain to check (e.g., domain.com)',
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function parseArgs(args) {
|
|
28
|
+
const parser = createParser();
|
|
29
|
+
const parsed = parser.parse(args);
|
|
30
|
+
return {
|
|
31
|
+
omitRelayCheck: parsed['omit-relay-check'] || false,
|
|
32
|
+
domain: parsed._positional || ''
|
|
33
|
+
};
|
|
34
|
+
}
|
|
5
35
|
async function main() {
|
|
6
36
|
const args = process.argv.slice(2);
|
|
7
37
|
if (args.length === 0) {
|
|
8
|
-
|
|
9
|
-
|
|
38
|
+
const parser = createParser();
|
|
39
|
+
parser.printHelp('nip05check', 'š NIP-05 Domain Checker', undefined, 'domain.com');
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
let parsedArgs;
|
|
43
|
+
try {
|
|
44
|
+
parsedArgs = parseArgs(args);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(`ā Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
10
48
|
process.exit(1);
|
|
11
49
|
}
|
|
12
|
-
const domain =
|
|
50
|
+
const { domain, omitRelayCheck } = parsedArgs;
|
|
13
51
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log(`š„ Entries count: ${result.entriesCount}`);
|
|
24
|
-
if (result.relayValidation) {
|
|
25
|
-
console.log(`\nš Relay Validation:`);
|
|
26
|
-
console.log(` Total relays: ${result.relayValidation.totalRelays}`);
|
|
27
|
-
console.log(` Unique relays: ${result.relayValidation.uniqueRelays}`);
|
|
28
|
-
console.log(` Valid relays: ${result.relayValidation.validRelays}`);
|
|
29
|
-
console.log(` Invalid relays: ${result.relayValidation.invalidRelays}`);
|
|
30
|
-
if (result.relayValidation.relayDetails && result.relayValidation.relayDetails.length > 0) {
|
|
31
|
-
console.log(`\nš Relay Details:`);
|
|
32
|
-
for (const relay of result.relayValidation.relayDetails) {
|
|
33
|
-
const status = relay.isValid ? 'ā
' : 'ā';
|
|
34
|
-
const timeInfo = relay.responseTime ? `[${relay.responseTime}ms]` : '';
|
|
35
|
-
const errorInfo = relay.error ? `(${relay.error})` : '';
|
|
36
|
-
console.log(` ${status} ${relay.url} ${errorInfo} ${timeInfo}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
52
|
+
const spinner = (0, ora_1.default)('Checking nostr.json file...').start();
|
|
53
|
+
const nostrBox = new core_1.NostrBoxCore();
|
|
54
|
+
// Add a small delay to show the first message
|
|
55
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
56
|
+
if (!omitRelayCheck) {
|
|
57
|
+
spinner.text = 'Validating domain and relays...';
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
spinner.text = 'Validating domain (skipping relay check)...';
|
|
39
61
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
const result = await nostrBox.nip05Check(domain, omitRelayCheck);
|
|
63
|
+
spinner.text = 'Loading user data...';
|
|
64
|
+
// Display all users and their relays
|
|
65
|
+
let users = [];
|
|
66
|
+
try {
|
|
67
|
+
users = await nostrBox.listUsersWithRelays(domain, omitRelayCheck);
|
|
68
|
+
spinner.text = 'Formatting results...';
|
|
69
|
+
// Small delay to show the formatting message
|
|
70
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
45
71
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
console.log(` ⢠${warning}`);
|
|
50
|
-
}
|
|
72
|
+
catch (userError) {
|
|
73
|
+
spinner.text = 'Formatting results...';
|
|
74
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
51
75
|
}
|
|
52
|
-
|
|
76
|
+
spinner.succeed('Validation complete!');
|
|
77
|
+
// Use the NostrBoxCore formatting method
|
|
78
|
+
const formattedOutput = nostrBox.formatDomainValidationResult(result, users, omitRelayCheck);
|
|
79
|
+
formattedOutput.forEach(line => console.log(line));
|
|
53
80
|
// Exit with error code if validation failed
|
|
54
81
|
if (!result.nostrJsonValid) {
|
|
55
82
|
process.exit(1);
|
package/dist/nip05check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nip05check.js","sourceRoot":"","sources":["../src/nip05check.ts"],"names":[],"mappings":"
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UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;QACxD,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAA;QAEvC,yCAAyC;QACzC,MAAM,eAAe,GAAG,QAAQ,CAAC,4BAA4B,CAAC,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;QAC5F,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;QAElD,4CAA4C;QAC5C,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;QACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,gBAAgB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;IACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
package/dist/nip05lookup.js
CHANGED
|
@@ -2,62 +2,109 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const core_1 = require("@nostrbox/core");
|
|
5
|
+
const argParser_js_1 = require("./utils/argParser.js");
|
|
6
|
+
function createParser() {
|
|
7
|
+
return new argParser_js_1.ArgumentParser({
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
name: 'type',
|
|
11
|
+
alias: 't',
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'Specify output type',
|
|
14
|
+
choices: ['hex', 'bech32', 'relays', 'all']
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'raw',
|
|
18
|
+
alias: 'r',
|
|
19
|
+
type: 'flag',
|
|
20
|
+
description: 'Output raw value without formatting'
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
positional: {
|
|
24
|
+
name: 'identifier',
|
|
25
|
+
description: 'NIP-05 identifier (e.g., dave@jb55.com)',
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function parseArgs(args) {
|
|
31
|
+
const parser = createParser();
|
|
32
|
+
const parsed = parser.parse(args);
|
|
33
|
+
return {
|
|
34
|
+
type: parsed.type || 'all',
|
|
35
|
+
raw: parsed.raw || false,
|
|
36
|
+
identifier: parsed._positional || ''
|
|
37
|
+
};
|
|
38
|
+
}
|
|
5
39
|
async function main() {
|
|
6
40
|
const args = process.argv.slice(2);
|
|
7
41
|
if (args.length === 0) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
console.error('Types: hex, bech32, relays, all (default)');
|
|
12
|
-
console.error('');
|
|
13
|
-
console.error('Examples:');
|
|
14
|
-
console.error(' nip05lookup dave@jb55.com # All information');
|
|
15
|
-
console.error(' nip05lookup -t hex dave@jb55.com # Hex pubkey only');
|
|
16
|
-
console.error(' nip05lookup -t bech32 dave@jb55.com # Npub format only');
|
|
17
|
-
console.error(' nip05lookup -t relays dave@jb55.com # Relays only');
|
|
18
|
-
console.error(' nip05lookup jb55.com # Domain-only lookup');
|
|
19
|
-
process.exit(1);
|
|
42
|
+
const parser = createParser();
|
|
43
|
+
parser.printHelp('nip05lookup', 'š NIP-05 Lookup Tool', undefined, 'dave@jb55.com');
|
|
44
|
+
process.exit(0);
|
|
20
45
|
}
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const typeArg = args[1];
|
|
25
|
-
if (!['hex', 'bech32', 'relays', 'all'].includes(typeArg)) {
|
|
26
|
-
console.error(`ā Invalid type: ${typeArg}`);
|
|
27
|
-
console.error('Valid types: hex, bech32, relays, all');
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
type = typeArg;
|
|
31
|
-
identifier = args[2];
|
|
46
|
+
let parsedArgs;
|
|
47
|
+
try {
|
|
48
|
+
parsedArgs = parseArgs(args);
|
|
32
49
|
}
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error(`ā Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
52
|
+
process.exit(1);
|
|
35
53
|
}
|
|
54
|
+
const { type, raw, identifier } = parsedArgs;
|
|
36
55
|
try {
|
|
37
56
|
const result = await (0, core_1.lookupNip05)(identifier, type);
|
|
38
57
|
const outputs = (0, core_1.formatNip05Output)(result, type);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
console.log('='.repeat(50));
|
|
43
|
-
// Show the results based on type
|
|
44
|
-
if (type === 'hex' || type === 'all') {
|
|
45
|
-
if (outputs.includes(result.pubkey)) {
|
|
46
|
-
console.log(`\nš Hex pubkey:`);
|
|
58
|
+
if (raw) {
|
|
59
|
+
// Raw output - just the values without formatting
|
|
60
|
+
if (type === 'hex') {
|
|
47
61
|
console.log(result.pubkey);
|
|
48
62
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
else if (type === 'bech32') {
|
|
64
|
+
if (result.npub) {
|
|
65
|
+
console.log(result.npub);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (type === 'relays') {
|
|
69
|
+
if (result.relays && result.relays.length > 0) {
|
|
70
|
+
result.relays.forEach(relay => console.log(relay));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (type === 'all') {
|
|
74
|
+
// For 'all' type with raw, output each value on separate lines
|
|
75
|
+
console.log(result.pubkey);
|
|
76
|
+
if (result.npub) {
|
|
77
|
+
console.log(result.npub);
|
|
78
|
+
}
|
|
79
|
+
if (result.relays && result.relays.length > 0) {
|
|
80
|
+
result.relays.forEach(relay => console.log(relay));
|
|
81
|
+
}
|
|
54
82
|
}
|
|
55
83
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
84
|
+
else {
|
|
85
|
+
// Formatted output
|
|
86
|
+
const displayName = result.name ? `${result.name}@${result.domain}` : `_@${result.domain}`;
|
|
87
|
+
console.log(`š NIP-05 Lookup: ${displayName}`);
|
|
88
|
+
console.log('='.repeat(50));
|
|
89
|
+
// Show the results based on type
|
|
90
|
+
if (type === 'hex' || type === 'all') {
|
|
91
|
+
if (outputs.includes(result.pubkey)) {
|
|
92
|
+
console.log(`\nš Hex pubkey:`);
|
|
93
|
+
console.log(result.pubkey);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (type === 'bech32' || type === 'all') {
|
|
97
|
+
if (result.npub && outputs.includes(result.npub)) {
|
|
98
|
+
console.log(`\nš Npub (bech32):`);
|
|
99
|
+
console.log(result.npub);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (type === 'relays' || type === 'all') {
|
|
103
|
+
if (result.relays && result.relays.length > 0) {
|
|
104
|
+
console.log(`\nš Relays:`);
|
|
105
|
+
for (const relay of result.relays) {
|
|
106
|
+
console.log(relay);
|
|
107
|
+
}
|
|
61
108
|
}
|
|
62
109
|
}
|
|
63
110
|
}
|
package/dist/nip05lookup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nip05lookup.js","sourceRoot":"","sources":["../src/nip05lookup.ts"],"names":[],"mappings":";;;AAEA,yCAAqF;
|
|
1
|
+
{"version":3,"file":"nip05lookup.js","sourceRoot":"","sources":["../src/nip05lookup.ts"],"names":[],"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,qBAAqB,CAAC,CAAA;oBAClC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBAC1B,CAAC;YACH,CAAC;YAED,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;gBACxC,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC9C,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;oBAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;wBAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;oBACpB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,YAAY,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;QACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kBAAkB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;IAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ArgOption {
|
|
2
|
+
name: string;
|
|
3
|
+
alias?: string;
|
|
4
|
+
type: 'flag' | 'string';
|
|
5
|
+
description?: string;
|
|
6
|
+
choices?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ArgDefinition {
|
|
9
|
+
options: ArgOption[];
|
|
10
|
+
positional?: {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ParsedArguments {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
_positional?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class ArgumentParser {
|
|
21
|
+
private definition;
|
|
22
|
+
constructor(definition: ArgDefinition);
|
|
23
|
+
parse(args: string[]): ParsedArguments;
|
|
24
|
+
private findOption;
|
|
25
|
+
private generateUsage;
|
|
26
|
+
private generateOptions;
|
|
27
|
+
private generateExamples;
|
|
28
|
+
printHelp(command: string, title?: string, description?: string, exampleValue?: string): void;
|
|
29
|
+
private getExampleDescription;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=argParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argParser.d.ts","sourceRoot":"","sources":["../../src/utils/argParser.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;CACF;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAe;gBAErB,UAAU,EAAE,aAAa;IAIrC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,eAAe;IAiDtC,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,gBAAgB;IA4BxB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IAuB7F,OAAO,CAAC,qBAAqB;CAe9B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgumentParser = void 0;
|
|
4
|
+
class ArgumentParser {
|
|
5
|
+
constructor(definition) {
|
|
6
|
+
this.definition = definition;
|
|
7
|
+
}
|
|
8
|
+
parse(args) {
|
|
9
|
+
const result = {};
|
|
10
|
+
let i = 0;
|
|
11
|
+
while (i < args.length) {
|
|
12
|
+
const arg = args[i];
|
|
13
|
+
if (arg.startsWith('-')) {
|
|
14
|
+
const option = this.findOption(arg);
|
|
15
|
+
if (!option) {
|
|
16
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
17
|
+
}
|
|
18
|
+
if (option.type === 'flag') {
|
|
19
|
+
result[option.name] = true;
|
|
20
|
+
i++;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
if (i + 1 >= args.length) {
|
|
24
|
+
const choices = option.choices ? ` (choices: ${option.choices.join(', ')})` : '';
|
|
25
|
+
throw new Error(`Option ${arg} requires a value${choices}`);
|
|
26
|
+
}
|
|
27
|
+
const value = args[i + 1];
|
|
28
|
+
if (option.choices && !option.choices.includes(value)) {
|
|
29
|
+
throw new Error(`Invalid value for ${arg}: ${value}. Valid choices: ${option.choices.join(', ')}`);
|
|
30
|
+
}
|
|
31
|
+
result[option.name] = value;
|
|
32
|
+
i += 2;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Positional argument
|
|
37
|
+
if (this.definition.positional) {
|
|
38
|
+
result._positional = arg;
|
|
39
|
+
}
|
|
40
|
+
i++;
|
|
41
|
+
break; // Only handle one positional for now
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Check required positional
|
|
45
|
+
if (this.definition.positional?.required && !result._positional) {
|
|
46
|
+
const desc = this.definition.positional.description || this.definition.positional.name;
|
|
47
|
+
throw new Error(`Required argument missing: ${desc}`);
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
findOption(arg) {
|
|
52
|
+
const cleanArg = arg.replace(/^-+/, '');
|
|
53
|
+
return this.definition.options.find(opt => opt.name === cleanArg || opt.alias === cleanArg);
|
|
54
|
+
}
|
|
55
|
+
generateUsage(programName) {
|
|
56
|
+
let usage = `Usage: ${programName}`;
|
|
57
|
+
if (this.definition.options.length > 0) {
|
|
58
|
+
usage += ' [options]';
|
|
59
|
+
}
|
|
60
|
+
if (this.definition.positional) {
|
|
61
|
+
const pos = this.definition.positional;
|
|
62
|
+
usage += pos.required ? ` <${pos.name}>` : ` [${pos.name}]`;
|
|
63
|
+
}
|
|
64
|
+
return usage;
|
|
65
|
+
}
|
|
66
|
+
generateOptions() {
|
|
67
|
+
const lines = [];
|
|
68
|
+
if (this.definition.options.length > 0) {
|
|
69
|
+
lines.push('Options:');
|
|
70
|
+
for (const opt of this.definition.options) {
|
|
71
|
+
let optLine = ' ';
|
|
72
|
+
if (opt.alias) {
|
|
73
|
+
optLine += `-${opt.alias}, `;
|
|
74
|
+
}
|
|
75
|
+
optLine += `--${opt.name}`;
|
|
76
|
+
if (opt.type !== 'flag') {
|
|
77
|
+
optLine += ` <${opt.name}>`;
|
|
78
|
+
}
|
|
79
|
+
if (opt.description) {
|
|
80
|
+
optLine = optLine.padEnd(25) + opt.description;
|
|
81
|
+
}
|
|
82
|
+
if (opt.choices) {
|
|
83
|
+
optLine += ` (choices: ${opt.choices.join(', ')})`;
|
|
84
|
+
}
|
|
85
|
+
lines.push(optLine);
|
|
86
|
+
}
|
|
87
|
+
lines.push('');
|
|
88
|
+
}
|
|
89
|
+
return lines;
|
|
90
|
+
}
|
|
91
|
+
generateExamples(programName, exampleValue) {
|
|
92
|
+
const examples = [];
|
|
93
|
+
const sampleValue = exampleValue || 'input';
|
|
94
|
+
// Basic usage
|
|
95
|
+
if (this.definition.positional) {
|
|
96
|
+
examples.push(`${programName} ${sampleValue}`);
|
|
97
|
+
}
|
|
98
|
+
// Generate examples for each option
|
|
99
|
+
for (const opt of this.definition.options) {
|
|
100
|
+
if (opt.type === 'flag') {
|
|
101
|
+
if (opt.alias) {
|
|
102
|
+
examples.push(`${programName} -${opt.alias} ${sampleValue}`);
|
|
103
|
+
}
|
|
104
|
+
examples.push(`${programName} --${opt.name} ${sampleValue}`);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const optValue = opt.choices?.[0] || 'value';
|
|
108
|
+
if (opt.alias) {
|
|
109
|
+
examples.push(`${programName} -${opt.alias} ${optValue} ${sampleValue}`);
|
|
110
|
+
}
|
|
111
|
+
examples.push(`${programName} --${opt.name} ${optValue} ${sampleValue}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return examples;
|
|
115
|
+
}
|
|
116
|
+
printHelp(command, title, description, exampleValue) {
|
|
117
|
+
if (title)
|
|
118
|
+
console.log(title);
|
|
119
|
+
if (description)
|
|
120
|
+
console.log(description);
|
|
121
|
+
console.log(this.generateUsage(command));
|
|
122
|
+
console.log('');
|
|
123
|
+
const optionLines = this.generateOptions();
|
|
124
|
+
optionLines.forEach(line => console.log(line));
|
|
125
|
+
const examples = this.generateExamples(command, exampleValue);
|
|
126
|
+
if (examples.length > 0) {
|
|
127
|
+
console.log('Examples:');
|
|
128
|
+
const maxLength = Math.max(...examples.map(ex => ex.length));
|
|
129
|
+
const padding = Math.max(maxLength + 6, 45);
|
|
130
|
+
examples.forEach(example => {
|
|
131
|
+
const paddedExample = ` ${example}`.padEnd(padding);
|
|
132
|
+
console.log(`${paddedExample}# ${this.getExampleDescription(example, command)}`);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getExampleDescription(example, programName) {
|
|
137
|
+
const parts = example.replace(programName, '').trim().split(' ');
|
|
138
|
+
if (parts.length === 1)
|
|
139
|
+
return 'Basic usage';
|
|
140
|
+
const firstArg = parts[0];
|
|
141
|
+
if (firstArg.startsWith('-')) {
|
|
142
|
+
const option = this.definition.options.find(opt => firstArg === `--${opt.name}` || firstArg === `-${opt.alias}`);
|
|
143
|
+
return option?.description || 'With option';
|
|
144
|
+
}
|
|
145
|
+
return 'Usage example';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.ArgumentParser = ArgumentParser;
|
|
149
|
+
//# sourceMappingURL=argParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argParser.js","sourceRoot":"","sources":["../../src/utils/argParser.ts"],"names":[],"mappings":";;;AAsBA,MAAa,cAAc;IAGzB,YAAY,UAAyB;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,IAAc;QAClB,MAAM,MAAM,GAAoB,EAAE,CAAA;QAClC,IAAI,CAAC,GAAG,CAAC,CAAA;QAET,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YAEnB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;gBACnC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAA;gBAC3C,CAAC;gBAED,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBAC3B,MAAM,CAAC,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D,wCAgLC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nostrbox/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "CLI tool for NIP-05 operations using NostrBox core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"author": "",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nostrbox/core": "1.
|
|
31
|
+
"@nostrbox/core": "1.3.0",
|
|
32
|
+
"ora": "^8.2.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@saithodev/semantic-release-gitea": "^2.1.0",
|