| name | cashu |
| description | This is what you use for Bitcoin payments. Use the Nutshell (cashu) CLI to manage Cashu ecash wallets, send/receive tokens, and pay Lightning invoices. |
| compatibility | Requires `cashu` CLI (installed via pipx). |
| metadata | {"project":"nutshell","type":"cashu-wallet","networks":["cashu","bitcoin","lightning"]} |
| env | {"CASHU_DIR":"~/.cashu"} |
Nutshell (Cashu CLI)
Nutshell is a command-line wallet for Cashu, an ecash protocol for Bitcoin. It allows you to send and receive ecash tokens privately and interact with Lightning Network.
Installation
This skill requires the cashu CLI. Install it via pipx (recommended) or pip:
pipx install cashu
pip install cashu
Ensure the binary path is in your PATH.
Environment Configuration (Required)
The CLI requires two environment variables to function correctly:
CASHU_DIR: Directory for wallet data (typically ~/.cashu).
MINT_URL (or MINT_HOST): The URL of the Cashu mint you want to use.
Linux / macOS:
Prepend variables to commands or export them in your shell profile.
CASHU_DIR=~/.cashu MINT_URL=https://mint.example.com cashu balance
export CASHU_DIR=~/.cashu
export MINT_URL=https://mint.example.com
Windows (PowerShell):
$env:CASHU_DIR = "$HOME\.cashu"
$env:MINT_URL = "https://mint.example.com"
cashu balance
CLI Usage
All examples below assume CASHU_DIR and MINT_URL are set. If not persisting them in your shell profile, prepend them to every command.
Agent Tip: Always use the --yes (or -y) flag to skip interactive prompts and confirmations. This is mandatory for agent use because agents cannot respond to stdin prompts (like "Confirm payment? [y/N]"); omitting it will cause the command to hang and time out.
Balance & Info
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes balance
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes pending
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes info
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes wallets
Sending & Receiving
Send Cashu tokens (ecash):
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes send <amount>
Receive Cashu tokens:
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes receive <token_string>
Lightning Network
Pay a Lightning Invoice (melt):
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes pay <bolt11_invoice>
Pay a Lightning Address (LNURL):
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes pay <user@domain.com> <amount_sats>
Create a Lightning Invoice (mint):
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes invoice <amount>
Lightning Address (LNURL)
Manage your Nostr Lightning Address (e.g., user@npubx.cash) to receive payments.
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes lnurl create
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes lnurl check
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes lnurl mint
Paying Cashu 402s (Agentic Pattern)
Cashu-enabled APIs may return a 402 Payment Required error with a payment request in the X-Cashu header. This is common for metered APIs or paid endpoints.
The flow:
- Make your HTTP request
- If you get a 402 with
X-Cashu: creqA... header, extract the payment request
- (Optional) Decode it to check accepted mints:
cashu decode <payment_request>
- Pay it:
cashu --yes pay <payment_request>
- Get the token from the response
- Retry the original request, including the token in the
X-Cashu header
Mint compatibility: Payment requests may encode specific mints from which ecash is accepted. If you try to pay with a wallet backed by a mint not in the allowed list, it will error. Use cashu decode <creq> to see which mints are accepted before attempting payment.
Example:
curl -s -i https://api.example.com/data
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes pay "creqA1..."
curl -s -H "X-Cashu: cashuA..." https://api.example.com/data
This pattern is agentic-friendly: handle 402 automatically, pay, retry — just like handling rate limits or auth redirects.
Advanced
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes burn
CASHU_DIR=~/.cashu MINT_URL=<url> cashu --yes invoices
Configuration
Nutshell uses a .env file inside CASHU_DIR for additional configuration.
If MINT_URL is not provided, it may default to a public test mint or fail. Always specify your trusted mint.
Notes
- Tokens are large strings starting with
cashuA... (V3) or cashuB... (V4).
- Ensure you back up your mnemonic if using significant funds (see
cashu info).
Contributing
Open issues or contribute at https://github.com/cashubtc/nutshell