@sharbaknra/hadith-cli
v0.1.0
Published
CLI tool for Islamic hadith entries with daily reminders and context-based recommendations
Maintainers
Readme
hadith-cli
Command-line tool that shows a hadith in your terminal and supports local hadith cache sync.
Requirements
- Node.js
>=18 - npm
Installation
# one-off run
npx hadith-cli startup
# global install
npm install -g hadith-cliInstalled binaries:
hadith-clihadith
Usage
# default command (same as "daily")
hadith-cli
# show today's entry
hadith-cli daily
# random entry
hadith-cli random
# search text
hadith-cli search "patience"
# list categories
hadith-cli category --list
# show entries for a category
hadith-cli category --category daily
# show specific entry by id
hadith-cli show morning-1
# favorites
hadith-cli favorites --add morning-1
hadith-cli favorites --list
hadith-cli favorites --remove morning-1
# show startup hadith now
hadith-cli startup
# scrape full english hadith cache
hadith-cli scrape-hadithMost content commands support:
-j, --jsonfor JSON output-p, --plainfor compact output
Auto-show Hadith On Terminal Open
The npm package does not edit your shell profile automatically. Configure it once in your shell startup file.
Bash (Linux/macOS)
Add to ~/.bashrc:
hadith-cli startup 2>/dev/null || trueReload:
source ~/.bashrcZsh (Linux/macOS)
Add to ~/.zshrc:
hadith-cli startup 2>/dev/null || trueReload:
source ~/.zshrcPowerShell (Windows)
Open profile:
notepad $PROFILEAdd:
hadith-cli startup 2>$nullRestart PowerShell.
Cache and Config
startupreads from local hadith cache.- If cache is missing/stale, it tries to sync from remote source.
- If sync fails (offline/network issue), it falls back to seed hadiths.
Environment variable:
HADITH_CLI_CONFIG_DIR- custom directory for config and hadith cache.
Development
npm install
npm run lint
npm run typecheck
npm test
npm run build
npm run checkPublishing
npm login
npm publishprepublishOnly runs npm run check, so publish fails if quality checks fail.
License
MIT
