The Problem
Agents that need to handle Cashu ecash tokens require a programmatic way to create, receive, melt and track balances without building the plumbing from scratch. Existing tools are either GUI‑only or tightly coupled to a specific framework, leaving developers to re‑implement token handling, SQLite persistence, and Lightning‑mint interactions.
What This Does
The repository supplies a minimal Node.js CLI that wraps the coco‑cashu‑core library. The entry script cli/wallet.mjs parses sub‑commands (balance, receive, send, invoice, etc.) and maps them to core API calls. Persistent state lives in a SQLite file at ~/.cashu-wallet/wallet.db plus a plain‑text seed.txt for the wallet seed. The surrounding files – README.md, SKILL.md, LICENSE – document usage and licensing; cli/package.json declares the runtime dependencies.
How It Is Wired
- Entry point –
node cli/wallet.mjs <command>(as shown in the README). - Command dispatch –
wallet.mjsreadsprocess.argv, then routes to a largeswitch/if‑elseblock (101 branch points over 317 lines). Each branch calls a helper that directly invokes the coco‑cashu‑core API (e.g.,createInvoice,receiveToken,payInvoice). - External effects –
- Filesystem – reads/writes
~/.cashu-wallet/wallet.dbvia the core library’s SQLite layer; readsseed.txtfor seed material. - Network – contacts Lightning mints using HTTP calls encapsulated in the core library (no custom networking code in this repo).
- Module graph – only one internal module (
wallet.mjs) and no import edges; therefore the CLI is a self‑contained command dispatcher. The lack of internal dependencies means any change to command logic touches the single file, giving it the widest blast radius.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/cashu-skill
cd cashu-skill/cli
# Install runtime dependencies
npm install
# Show balance
node wallet.mjs balance
# Create a Lightning invoice for minting
node wallet.mjs invoice 1000
# Receive a token string
node wallet.mjs receive <token>
No additional configuration files are present; the CLI expects the SQLite DB and seed.txt to be created automatically in ~/.cashu-wallet on first run. The README lists all supported sub‑commands.
Real‑World Use
An AI‑driven personal finance agent could invoke the CLI to top‑up a user’s Cashu wallet after a successful Lightning payment:
const { execSync } = require('child_process');
function topUp(amount) {
const invoice = execSync(`node wallet.mjs invoice ${amount}`).toString();
// send invoice to Lightning node, wait for payment, then:
execSync(`node wallet.mjs receive ${invoiceToken}`);
}
The agent only needs to call the CLI; all token bookkeeping and persistence are handled by the wallet script.
Code Health & Issues
- High – Lockfile missing –
cli/package.jsonhas no accompanyingpackage-lock.jsonorpnpm-lock.yaml. This permits divergent dependency trees between development and production. - Medium – Dependabot not configured – No
.github/dependabot.yml; security updates tococo‑cashu‑coreor transitive packages will not be auto‑suggested. - Medium – High branching density –
cli/wallet.mjscontains 101 branch points in 317 lines, making the command dispatcher hard to test and maintain. Refactor into a strategy table or separate command modules. - SDLC observations – No test suite, no CI/CD pipeline, and no Dockerfile. The repository does include a LICENSE file.
The Bottom Line
The Cashu‑skill repo delivers a functional, single‑file CLI for Cashu token management, suitable for quick integration or prototyping. However, the monolithic command parser, lack of lockfile, and absent testing/CI infrastructure raise maintenance and security concerns. It is best used by teams comfortable extending the CLI or embedding it in a larger, tested automation framework.