diff --git a/README.md b/README.md index e1aaadd..12dd76f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Then pass `--wallet-name` to any command to use that wallet: ```bash npx @getalby/cli --wallet-name work get-balance -npx @getalby/cli --wallet-name personal pay-invoice --invoice lnbc... +npx @getalby/cli --wallet-name personal pay-invoice lnbc... ``` ### Connection secret resolution (in order of priority) @@ -105,7 +105,7 @@ npx @getalby/cli get-wallet-service-info npx @getalby/cli make-invoice --amount 1000 --description "Payment" # Pay an invoice -npx @getalby/cli pay-invoice --invoice "lnbc..." +npx @getalby/cli pay-invoice "lnbc..." # Send a keysend payment npx @getalby/cli pay-keysend --pubkey "02abc..." --amount 100 diff --git a/src/commands/pay-invoice.ts b/src/commands/pay-invoice.ts index ef88e1c..351e158 100644 --- a/src/commands/pay-invoice.ts +++ b/src/commands/pay-invoice.ts @@ -6,13 +6,13 @@ export function registerPayInvoiceCommand(program: Command) { program .command("pay-invoice") .description("Pay a lightning invoice") - .requiredOption("-i, --invoice ", "Invoice to pay") + .argument("", "Invoice to pay") .option("-a, --amount ", "Amount (for zero-amount invoices)", parseInt) - .action(async (options) => { + .action(async (invoice, options) => { await handleError(async () => { const client = await getClient(program); const result = await payInvoice(client, { - invoice: options.invoice, + invoice, amount_in_sats: options.amount, }); output(result);