{"skill":{"slug":"lnbits-with-qrcode","displayName":"LNBits Wallet wtih QR Code","summary":"Manage LNbits Lightning Wallet (Balance, Pay, Invoice)","description":"---\nname: lnbits\ndescription: Manage LNbits Lightning Wallet (Balance, Pay, Invoice)\nhomepage: https://lnbits.com\nmetadata: {\"clawdbot\":{\"emoji\":\"⚡\",\"requires\":{\"bins\":[\"python3\"],\"pip\":[\"qrcode[pil]\"],\"env\":[\"LNBITS_API_KEY\", \"LNBITS_BASE_URL\"]},\"primaryEnv\":\"LNBITS_API_KEY\"}}\n---\n\n# LNbits Wallet Manager\n\nEnable the assistant to safely and effectively manage an LNbits Lightning Network wallet.\n\n## 🛑 CRITICAL PROTOCOLS 🛑\n\n1.  **NEVER Expose Secrets**: Do NOT display Admin Keys, User IDs, or Wallet IDs.\n2.  **Explicit Confirmation**: You MUST ask for \"Yes/No\" confirmation before paying.\n    *   *Format*: \"I am about to send **[Amount] sats** to **[Memo/Dest]**. Proceed? (y/n)\"\n3.  **Check Balance First**: Always call `balance` before `pay` to prevent errors.\n4.  **ALWAYS Include Invoice + QR**: When generating an invoice, you MUST: (a) show the `payment_request` text for copying, and (b) output `MEDIA:` followed by the `qr_file` path on ONE line. NEVER skip this.\n\n## Usage\n\n### 0. Setup / Create Wallet\nIf the user does not have an LNbits wallet, you can create one for them on the demo server.\n\n```bash\npython3 {baseDir}/scripts/lnbits_cli.py create --name \"My Wallet\"\n```\n\n**Action**:\n1.  Run the command. The CLI prints JSON containing `adminkey` and `base_url` to stdout (visible in the terminal).\n2.  **NEVER Expose Secrets (applies here)**: Do NOT repeat, quote, or display the `adminkey` or any secret from the output in your chat response. The user sees the command output in their terminal; that is the only place the key should appear.\n3.  Instruct the user in plain language only, e.g.:\n    > \"A new wallet was created. The command output above contains your **adminkey** and **base_url**. Copy those values from the terminal and add them to your configuration or `.env` as `LNBITS_API_KEY` and `LNBITS_BASE_URL`. Do not paste the adminkey here or in any chat.\"\n\n### 1. Check Balance\nGet the current wallet balance in Satoshis.\n\n```bash\npython3 {baseDir}/scripts/lnbits_cli.py balance\n```\n\n### 2. Create Invoice (Receive)\nGenerate a Bolt11 invoice to receive funds. **QR code is always included by default.**\n*   **amount**: Amount in Satoshis (Integer).\n*   **memo**: Optional description.\n*   **--no-qr**: Skip QR code generation (if not needed).\n\n```bash\n# Invoice with QR code (default)\npython3 {baseDir}/scripts/lnbits_cli.py invoice --amount 1000 --memo \"Pizza\"\n\n# Invoice without QR code\npython3 {baseDir}/scripts/lnbits_cli.py invoice --amount 1000 --memo \"Pizza\" --no-qr\n```\n\n**⚠️ MANDATORY RESPONSE FORMAT**: When generating an invoice, your response MUST include:\n\n1. **Invoice text for copying**: Show the full `payment_request` string so user can copy it\n2. **QR code image**: Output `MEDIA:` followed by the `qr_file` path on ONE line\n\n**EXACT FORMAT** (follow precisely):\n```\nHere is your 100 sat invoice:\n\nlnbc1u1p5abc123...\n\nMEDIA:./clawd/.lnbits_qr/invoice_xxx.png\n```\n\n**CRITICAL**: The `MEDIA:` and file path MUST be on the SAME LINE. This sends the QR code image to the user.\n\n### 2b. Generate QR Code from Existing Invoice\nConvert any Bolt11 string to a QR code image file.\n\n```bash\npython3 {baseDir}/scripts/lnbits_cli.py qr <bolt11_string>\n```\n\nReturns: `{\"qr_file\": \"./.lnbits_qr/invoice_xxx.png\", \"bolt11\": \"...\"}`\n\n### 3. Pay Invoice (Send)\n**⚠️ REQUIRES CONFIRMATION**: Decode first, verify balance, ask user, then execute.\n\n```bash\n# Step 1: Decode to verify amount/memo\npython3 {baseDir}/scripts/lnbits_cli.py decode <bolt11_string>\n\n# Step 2: Pay (Only after user CONFIRMS)\npython3 {baseDir}/scripts/lnbits_cli.py pay <bolt11_string>\n```\n\n## Error Handling\nIf the CLI returns a JSON error (e.g., `{\"error\": \"Insufficient funds\"}`), summarize it clearly for the user. Do not show raw stack traces.","topics":["Invoice","Wallet"],"tags":{"latest":"1.0.2"},"stats":{"comments":1,"downloads":21447,"installsAllTime":809,"installsCurrent":20,"stars":6,"versions":3},"createdAt":1770437969454,"updatedAt":1778486069788},"latestVersion":{"version":"1.0.2","createdAt":1770509935863,"changelog":"- Updated invoice QR code response: Change from using IMAGE: to MEDIA: followed by the file path, ensuring QR images are properly handled.\n- Adjusted expected QR file path for invoices from /tmp/lnbits_qr/ to ./.lnbits_qr/, standardizing location for QR code images.\n- Updated examples and instructions to align with new response format (MEDIA: and path on one line).\n- No changes to commands or protocol; only the output format and file paths for QR code delivery were updated.","license":null},"metadata":{"setup":[{"key":"LNBITS_API_KEY","required":true},{"key":"LNBITS_BASE_URL","required":true}],"os":null,"systems":null},"owner":{"handle":"jamestsetsekas","userId":"s1721gnthgrtm0nvhdqsnrk9kn84nv7h","displayName":"James Tsetsekas","image":"https://avatars.githubusercontent.com/u/8147662?v=4"},"moderation":null}