Interactive CLI installer and manager for all Sunnah hadith packages (npm + PyPI)
Project description
sunnah
One command. Every major Hadith collection.
Interactive package manager for the entire Sunnah ecosystem — npm + PyPI.
🌙 What is Sunnah?
sunnah is an interactive CLI package manager for the major hadith collections of Islam. Install, manage, and update every book in the Sunnah ecosystem from a single terminal command — for both npm (Node.js/React) and pip (Python).
npm install -g sunnah # Node.js CLI
pip install sunnah # Python CLI
sunnah # open interactive TUI
📦 Available Packages
| Book | npm | pip | Hadiths | CLI |
|---|---|---|---|---|
| Sahih al-Bukhari | sahih-al-bukhari |
sahih-al-bukhari |
7,563 | bukhari |
| Sahih Muslim | sahih-muslim |
sahih-muslim |
7,470 | muslim |
| Sunan Abi Dawud | sunan-abi-dawud |
sunan-abi-dawud |
5,274 | dawud |
| Jami al-Tirmidhi | jami-al-tirmidhi |
jami-al-tirmidhi |
3,956 | tirmidhi |
| Sunan Ibn Majah | sunan-ibn-majah |
sunan-ibn-majah |
4,341 | majah |
| Sunan al-Nasa'i | sunan-al-nasai |
sunan-al-nasai |
5,768 | nasai |
🚀 Installation
# JavaScript / Node.js
npm install -g sunnah
# Python
pip install sunnah
🖥️ Interactive TUI
sunnah
Opens a full-screen terminal UI. Navigate with ↑↓, toggle with space, press enter to install.
════════════════════════════════════════════════════════════
📿 Sunnah Package Manager v1.5.0
↑↓ nav space select a all i info u uninstall U update enter install q quit
════════════════════════════════════════════════════════════
▶ [✓] Sahih al-Bukhari ● npm (up to date)
Imam Muhammad ibn Ismail al-Bukhari
Most authentic hadith collection, second only to the Quran.
Hadiths: 7,563 CLI: bukhari --help npm: sahih-al-bukhari pip: sahih-al-bukhari
[ ] Sahih Muslim ○ not installed
[ ] Sunan Abi Dawud ○ not installed
...
Keyboard Controls
| Key | Action |
|---|---|
↑ ↓ |
Navigate |
space |
Toggle select |
a |
Select all / deselect all |
i |
Show package info |
u |
Uninstall selected |
U |
Update selected |
enter |
Install selected |
q |
Quit |
⚡ Commands
npm packages
sunnah list # all packages + npm/pip status
sunnah install bukhari # npm install -g sahih-al-bukhari
sunnah install bukhari nasai majah # install multiple at once
sunnah uninstall dawud # uninstall
sunnah update # check for updates
sunnah update --install # auto-install all updates
Python (pip) packages
sunnah pip install bukhari # pip install sahih-al-bukhari
sunnah pip install bukhari nasai # install multiple
sunnah pip uninstall dawud # uninstall
sunnah pip list # show Python package status
sunnah pip update # check for pip updates
sunnah pip update --install # auto-install pip updates
🔍 NEW: Cross-book search
sunnah search "prayer" # search all installed books (top 3 each)
sunnah search "fasting" --all # show all results
🎲 NEW: Random hadith
sunnah random # random hadith from a random installed book
sunnah random bukhari # random hadith specifically from Bukhari
ℹ️ NEW: Book info
sunnah info nasai # detailed info: versions, CLI, Python import
sunnah info jami-al-tirmidhi # works with full npm name too
⚛️ React hook generator
sunnah --react # generate useSunnah() for all installed books
sunnah --react bukhari muslim # specific books only
🐍 Python API
After pip install sunnah, you also get the individual book packages:
sunnah pip install bukhari muslim nasai
from sahih_al_bukhari import Bukhari
from sahih_muslim import Muslim
from sunan_al_nasai import Nasai
bukhari = Bukhari()
bukhari.get(1)
bukhari.search("prayer", limit=5)
bukhari.getRandom()
bukhari.getByChapter(1)
🟨 JavaScript / Node.js
sunnah install bukhari muslim
import bukhari from 'sahih-al-bukhari';
import muslim from 'sahih-muslim';
bukhari.get(1).english.text
muslim.search('prayer', 5)
📊 Version Stats
sunnah --version
────────────────────────────────────────────────────────────
📿 sunnah v1.5.0
────────────────────────────────────────────────────────────
Available : 6
npm inst. : 4 / 6
pip inst. : 3 / 6
Collection : Sahih al-Bukhari, Sahih Muslim, Sunan al-Nasa'i, Jami al-Tirmidhi
Hadiths : 24,257
🗂️ Monorepo Structure
sunnah/
├── bin/index.js ← npm CLI (interactive TUI + all commands)
├── python/sunnah_cli/ ← Python CLI (mirrors npm CLI exactly)
│ ├── __init__.py
│ ├── cli.py ← main Python CLI entry
│ ├── packages.py ← package registry (single source of truth)
│ ├── npm_utils.py ← npm helpers
│ └── pip_utils.py ← pip helpers
├── package.json
├── pyproject.toml
└── .github/workflows/ ← auto-publish to npm + PyPI on release
📄 License
GNU Affero General Public License v3.0 (AGPL-3.0)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sunnah-1.5.0.tar.gz.
File metadata
- Download URL: sunnah-1.5.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afa2ea5655d008a27145f50a624d6e91d7215b36844e135d5b50f6d02a9479f2
|
|
| MD5 |
80aba9f41847590432a7c396b46ca9be
|
|
| BLAKE2b-256 |
fb3d931c6c01929bbcb84b6b62be415b642a19d1f2baa62dd3429988615a42f7
|
File details
Details for the file sunnah-1.5.0-py3-none-any.whl.
File metadata
- Download URL: sunnah-1.5.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a8dee38a8832b0dda20b2bde5c3258f2422c4efd428221a93eaadf542ad735b
|
|
| MD5 |
e378dee04d598fcc8d3ca4cbe0c9de91
|
|
| BLAKE2b-256 |
fd3ed2783df67f93b18a1173ad5a7f453810d02d2b77f45d176e3114266bc255
|