@getalby/cli
Advanced tools
+1
-1
@@ -27,3 +27,3 @@ #!/usr/bin/env node | ||
| .description("CLI for Nostr Wallet Connect (NIP-47) with lightning tools") | ||
| .version("0.2.1") | ||
| .version("0.2.4") | ||
| .option("-c, --connection-secret <string>", "NWC connection secret (nostr+walletconnect://...) or path to file containing it (preferred)") | ||
@@ -30,0 +30,0 @@ .addHelpText("afterAll", ` |
+16
-1
| import { NWCClient } from "@getalby/sdk"; | ||
| import { readFileSync } from "node:fs"; | ||
| import { homedir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| export function getClient(program) { | ||
@@ -11,3 +13,16 @@ const opts = program.opts(); | ||
| if (!connectionSecret) { | ||
| console.error("Error: --connection-secret is required for this command"); | ||
| const defaultPath = join(homedir(), ".alby-cli", "connection-secret.key"); | ||
| try { | ||
| connectionSecret = readFileSync(defaultPath, "utf-8").trim(); | ||
| } | ||
| catch (error) { | ||
| const err = error; | ||
| if (err.code !== "ENOENT") { | ||
| // only throw an error if it's not a file not found error | ||
| throw err; | ||
| } | ||
| } | ||
| } | ||
| if (!connectionSecret) { | ||
| console.error("Error: No connection secret found. Pass -c <secret>, set NWC_URL, or create ~/.alby-cli/connection-secret.key"); | ||
| process.exit(1); | ||
@@ -14,0 +29,0 @@ } |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "repository": "https://github.com/getAlby/cli.git", | ||
| "version": "0.2.3", | ||
| "version": "0.2.4", | ||
| "type": "module", | ||
@@ -8,0 +8,0 @@ "main": "build/index.js", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
64414
0.88%1104
1.38%