NWC Tools is a command-line interface for interacting with Lightning Network wallets via the Nostr Wallet Connect (NWC) protocol. This tool allows you to manage your Lightning wallet, create invoices, make payments, and more, all through a simple terminal interface.
- Connect to any NWC-compatible wallet
- Create Lightning invoices
- Pay Lightning invoices
- Check wallet balance
- List transaction history
- Generate on-chain addresses
If you have Go installed (version 1.19 or newer), you can install NWC Tools directly:
go install github.com/bitvora/nwc-tools@latest
This will download, compile, and install the nwc-tools
binary in your $GOPATH/bin
directory. Make sure this directory is in your system's PATH.
- Clone the repository:
git clone https://github.com/bitvora/nwc-tools.git
cd nwc-tools
- Build the application:
go build -o nwc-tools
- Optionally, move the binary to a location in your PATH:
sudo mv nwc-tools /usr/local/bin/
Run the tool:
nwc-tools
You will be prompted to enter a Nostr Wallet Connect URL, which looks something like:
nostr+walletconnect://<pubkey>?relay=<relayURL>&secret=<secretKey>
You can get this URL from your compatible Lightning wallet.
Once connected, you can use the following commands:
make_invoice <amount_msat> <description> [<expiry_seconds>]
- Create a new Lightning invoicepay_invoice <lightning_invoice_string>
- Pay a Lightning invoiceget_balance
- Check your wallet's current balancelist_transactions
- View recent transactionsmake_chain_address
- Generate a new on-chain Bitcoin addressexit
- Close the application
You can specify log level when starting the application:
nwc-tools --loglevel=debug
Available log levels: debug
, info
, warn
, error
nwc> make_invoice 50000 "Test invoice" 3600
This creates an invoice for 50,000 millisatoshis (50 sats) with a description "Test invoice" that expires in 3600 seconds (1 hour).
nwc> pay_invoice lnbc500n1p3qz7typp5...
nwc> get_balance
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.