daffy-cli
v0.1.0
Published
CLI for the Daffy Public API — search nonprofits, donate, check balances, and more
Maintainers
Readme
daffy-cli
CLI for the Daffy Public API. Search nonprofits, make donations, check balances, send gifts, and more — straight from the terminal.
Quick Start
cd daffy-cli
npm install
npm run buildSet your API key (get one at https://www.daffy.org/settings/api):
export DAFFY_API_KEY="your-key-here"Run a command:
node dist/bin.js balanceCommands
Account
daffy-cli me # Your profile
daffy-cli balance # Your fund balance
daffy-cli causes # Your selected causesNon-Profits
daffy-cli search "khan academy" # Search by name
daffy-cli search --cause 1 # Filter by cause ID
daffy-cli search "schools" --page 2 # Paginate results
daffy-cli nonprofit 261544963 # Details by EINDonations
daffy-cli donations # List your donations
daffy-cli donations --page 2 # Page through results
daffy-cli donate --ein 261544963 --amount 25
daffy-cli donate --ein 261544963 --amount 25 --note "Keep it up"
daffy-cli cancel 12345 # Cancel a pending donationContributions
daffy-cli contributions # List your contributions
daffy-cli contributions --page 3Gifts
daffy-cli gifts # List your gifts
daffy-cli gift <code> # Gift details by code
daffy-cli gift create --name "Alex" --amount 25JSON Output
Append --json to any command to get raw API JSON instead of formatted output. Useful for scripting and piping:
daffy-cli balance --json
daffy-cli search "khan academy" --json | jq '.items[].name'
daffy-cli donations --json --page 2Options
| Flag | Description |
|---|---|
| --help, -h | Show usage |
| --json | Output raw JSON (works with every command) |
| --yes, -y | Skip confirmation prompts (for donate, cancel, gift create) |
| --page N | Page number for paginated commands |
Environment Variables
| Variable | Description |
|---|---|
| DAFFY_API_KEY | Required. Your Daffy API key. |
| NO_COLOR | Set to any value to disable colored output. |
Publishing
npm pack --dry-run # Preview what gets published (only dist/)
npm publish # Publish to npmAfter publishing:
npx daffy-cli balance