🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@getalby/cli

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getalby/cli

CLI for Nostr Wallet Connect (NIP-47) with a few additional useful lightning tools

Source
npmnpm
Version
0.0.0
Version published
Weekly downloads
50
-53.27%
Maintainers
4
Weekly downloads
 
Created
Source

Alby NWC CLI

CLI for Nostr Wallet Connect (NIP-47) with lightning tools.

Usage

npx @getalby/cli --connection-secret <NWC_CONNECTION_STRING> <command> [options]

The --connection-secret (or -c) option is required for wallet operations. You can get a connection string from your NWC-compatible wallet (e.g., Alby).

Testing Wallet

For testing the CLI without using real funds, you can create a test wallet using the NWC Faucet:

curl -X POST "https://faucet.nwc.dev?balance=10000"

This returns a connection string for a test wallet with 10,000 sats. Test wallets can send payments to each other but cannot interact with the real lightning network.

To top up an existing test wallet:

curl -X POST "https://faucet.nwc.dev/wallets/<username>/topup?amount=5000"

Commands

Wallet Commands

These commands require --connection-secret:

# Get wallet balance
npx @getalby/cli -c "nostr+walletconnect://..." get-balance

# Get wallet info
npx @getalby/cli -c "nostr+walletconnect://..." get-info

# Get wallet service capabilities
npx @getalby/cli -c "nostr+walletconnect://..." get-wallet-service-info

# Create an invoice
npx @getalby/cli -c "nostr+walletconnect://..." make-invoice --amount 1000 --description "Payment"

# Pay an invoice
npx @getalby/cli -c "nostr+walletconnect://..." pay-invoice --invoice "lnbc..."

# Look up an invoice by payment hash
npx @getalby/cli -c "nostr+walletconnect://..." lookup-invoice --payment-hash "abc123..."

# List transactions
npx @getalby/cli -c "nostr+walletconnect://..." list-transactions --limit 10

# Fetch L402-protected resource
npx @getalby/cli -c "nostr+walletconnect://..." fetch-l402 --url "https://example.com/api"

Lightning Tools

These commands don't require a wallet connection:

# Convert USD to sats
npx @getalby/cli fiat-to-sats --currency USD --amount 10

# Parse a BOLT-11 invoice
npx @getalby/cli parse-invoice --invoice "lnbc..."

# Request invoice from lightning address
npx @getalby/cli request-invoice --address "hello@getalby.com" --amount 1000

Command Reference

CommandDescriptionRequired Options
get-balanceGet wallet balance-
get-infoGet wallet info-
get-wallet-service-infoGet wallet capabilities-
make-invoiceCreate a lightning invoice--amount
pay-invoicePay a lightning invoice--invoice
lookup-invoiceLook up an invoice--payment-hash or --invoice
list-transactionsList transactions-
fiat-to-satsConvert fiat to sats--currency, --amount
parse-invoiceParse a BOLT-11 invoice--invoice
request-invoiceRequest invoice from lightning address--address, --amount
fetch-l402Fetch L402-protected resource--url

Output

All commands output JSON to stdout. Errors are output to stderr as JSON with an error field.

Keywords

lightning

FAQs

Package last updated on 01 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts