murphys-laws-cli
v0.1.0
Published
Command-line interface for the Murphy's Laws public REST API
Readme
murphys-laws-cli
Command-line interface for the public Murphy's Laws
REST API. Built on top of murphys-laws-sdk.
Install
Run once with npx:
npx murphys-laws-cli randomOr install globally:
npm install -g murphys-laws-cli
murphy randomRequires Node.js 22+.
Commands
murphy search <query> [--limit N] [--offset N] [--category SLUG]
murphy random
murphy today
murphy get <id>
murphy categories
murphy category <slug> [--limit N]
murphy submit <text> [--title T] [--author A] [--category SLUG]Submitting is rate-limited per the API's write policy.
Global flags
--jsonemit machine-readable JSON instead of formatted text--no-colordisable ANSI colors.NO_COLORenv and non-TTY output also disable colors automatically--base-url <url>override API base URL (defaulthttps://murphys-laws.com); handy for running against a local backend--user-agent <ua>override User-Agent header-h, --helpshow help-v, --versionshow CLI version
Exit codes
| Code | Meaning | |------|---------| | 0 | success | | 1 | not found (404) | | 2 | usage error (bad arguments, unknown command, validation error) | | 3 | rate limited (429) | | 4 | network or unexpected error |
License
CC0-1.0.
