sunnah 1.4.0 โ†’ 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +258 -398
  3. package/bin/index.js +1022 -1604
  4. package/books/jami-al-tirmidhi/README.md +201 -0
  5. package/books/jami-al-tirmidhi/bin/index.js +165 -0
  6. package/books/jami-al-tirmidhi/examples/express/server.js +7 -0
  7. package/books/jami-al-tirmidhi/examples/node-commonjs/example.js +7 -0
  8. package/books/jami-al-tirmidhi/examples/node-esm/example.mjs +6 -0
  9. package/books/jami-al-tirmidhi/examples/react/HadithExample.jsx +17 -0
  10. package/books/jami-al-tirmidhi/package.json +58 -0
  11. package/books/jami-al-tirmidhi/src/index.cjs +52 -0
  12. package/books/jami-al-tirmidhi/src/index.js +35 -0
  13. package/books/jami-al-tirmidhi/src/index.node.js +18 -0
  14. package/books/jami-al-tirmidhi/types/index.d.ts +28 -0
  15. package/books/sahih-al-bukhari/README.md +551 -0
  16. package/books/sahih-al-bukhari/bin/index.js +306 -0
  17. package/books/sahih-al-bukhari/data/bukhari.json.gz +0 -0
  18. package/books/sahih-al-bukhari/examples/express/server.js +49 -0
  19. package/books/sahih-al-bukhari/examples/node-commonjs/example.js +21 -0
  20. package/books/sahih-al-bukhari/examples/node-esm/example.mjs +24 -0
  21. package/books/sahih-al-bukhari/examples/react/HadithExample.jsx +73 -0
  22. package/books/sahih-al-bukhari/package.json +54 -0
  23. package/books/sahih-al-bukhari/src/index.cjs +55 -0
  24. package/books/sahih-al-bukhari/src/index.js +35 -0
  25. package/books/sahih-al-bukhari/src/index.node.js +21 -0
  26. package/books/sahih-al-bukhari/types/index.d.ts +35 -0
  27. package/books/sahih-muslim/LICENSE +661 -0
  28. package/books/sahih-muslim/README.md +547 -0
  29. package/books/sahih-muslim/bin/index.js +183 -0
  30. package/books/sahih-muslim/data/muslim.json.gz +0 -0
  31. package/books/sahih-muslim/examples/express/server.js +16 -0
  32. package/books/sahih-muslim/examples/node-commonjs/example.js +11 -0
  33. package/books/sahih-muslim/examples/node-esm/example.mjs +9 -0
  34. package/books/sahih-muslim/examples/react/HadithExample.jsx +28 -0
  35. package/books/sahih-muslim/package.json +58 -0
  36. package/books/sahih-muslim/src/index.cjs +52 -0
  37. package/books/sahih-muslim/src/index.js +35 -0
  38. package/books/sahih-muslim/src/index.node.js +18 -0
  39. package/books/sahih-muslim/types/index.d.ts +28 -0
  40. package/books/sunan-abi-dawud/LICENSE +661 -0
  41. package/books/sunan-abi-dawud/README.md +149 -0
  42. package/books/sunan-abi-dawud/bin/index.js +183 -0
  43. package/books/sunan-abi-dawud/data/dawud.json.gz +0 -0
  44. package/books/sunan-abi-dawud/examples/express/server.js +7 -0
  45. package/books/sunan-abi-dawud/examples/node-commonjs/example.js +7 -0
  46. package/books/sunan-abi-dawud/examples/node-esm/example.mjs +6 -0
  47. package/books/sunan-abi-dawud/examples/react/HadithExample.jsx +17 -0
  48. package/books/sunan-abi-dawud/package.json +58 -0
  49. package/books/sunan-abi-dawud/src/index.cjs +52 -0
  50. package/books/sunan-abi-dawud/src/index.js +35 -0
  51. package/books/sunan-abi-dawud/src/index.node.js +18 -0
  52. package/books/sunan-abi-dawud/types/index.d.ts +28 -0
  53. package/books/sunan-ibn-majah/README.md +198 -0
  54. package/books/sunan-ibn-majah/bin/index.js +138 -0
  55. package/books/sunan-ibn-majah/examples/express/server.js +8 -0
  56. package/books/sunan-ibn-majah/examples/node-commonjs/example.js +7 -0
  57. package/books/sunan-ibn-majah/examples/node-esm/example.mjs +6 -0
  58. package/books/sunan-ibn-majah/examples/react/HadithExample.jsx +17 -0
  59. package/books/sunan-ibn-majah/package.json +58 -0
  60. package/books/sunan-ibn-majah/src/index.cjs +52 -0
  61. package/books/sunan-ibn-majah/src/index.js +35 -0
  62. package/books/sunan-ibn-majah/src/index.node.js +18 -0
  63. package/books/sunan-ibn-majah/types/index.d.ts +28 -0
  64. package/package.json +39 -27
  65. /package/{LICENSE โ†’ books/sahih-al-bukhari/LICENSE} +0 -0
package/README.md CHANGED
@@ -1,398 +1,258 @@
1
- <div align="center">
2
-
3
- <h1>๐Ÿ“ฟ Sunnah</h1>
4
-
5
- ![npm version](https://img.shields.io/npm/v/sunnah?style=for-the-badge&logo=npm)
6
- ![npm downloads](https://img.shields.io/npm/dt/sunnah?style=for-the-badge&logo=npm)
7
- ![npm downloads per month](https://img.shields.io/npm/dm/sunnah?style=for-the-badge&logo=npm)
8
- ![license](https://img.shields.io/github/license/SENODROOM/sunnah?style=for-the-badge&logo=gnu)
9
- ![node version](https://img.shields.io/node/v/sunnah?style=for-the-badge&logo=node.js)
10
- ![GitHub stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github)
11
-
12
- **๐Ÿ“š One command. Every major Hadith collection. Interactive CLI installer for the entire Sunnah ecosystem.**
13
-
14
- [![NPM](https://nodei.co/npm/sunnah.png)](https://nodei.co/npm/sunnah/)
15
-
16
- </div>
17
-
18
- ---
19
-
20
- ## ๐ŸŒ™ What is Sunnah?
21
-
22
- `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 UI โ€” with real-time progress bars, keyboard navigation, and zero config.
23
-
24
- ```bash
25
- npm install -g sunnah
26
- sunnah
27
- ```
28
-
29
- That's it. A beautiful full-screen terminal UI opens, showing every available hadith package โ€” select what you want, press enter, watch it install.
30
-
31
- ---
32
-
33
- ## ๐Ÿ“ฆ Available Packages
34
-
35
- | Book | Package | Hadiths | Author | CLI Command |
36
- | -------------------- | ---------------------------------------------------------------- | ------- | ---------------- | ----------- |
37
- | **Sahih al-Bukhari** | [`sahih-al-bukhari`](https://npmjs.com/package/sahih-al-bukhari) | 7,563 | Imam al-Bukhari | `bukhari` |
38
- | **Sahih Muslim** | [`sahih-muslim`](https://npmjs.com/package/sahih-muslim) | 7,470 | Imam Muslim | `muslim` |
39
- | **Sunan Abi Dawud** | [`sunan-abi-dawud`](https://npmjs.com/package/sunan-abi-dawud) | 5,274 | Imam Abu Dawud | `dawud` |
40
- | **Jami al-Tirmidhi** | [`jami-al-tirmidhi`](https://npmjs.com/package/jami-al-tirmidhi) | 3,956 | Imam al-Tirmidhi | `tirmidhi` |
41
- | **Sunan Ibn Majah** | [`sunan-ibn-majah`](https://npmjs.com/package/sunan-ibn-majah) | 4,341 | Imam Ibn Majah | `ibnmajah` |
42
-
43
- ---
44
-
45
- ## ๐Ÿš€ Installation
46
-
47
- ```bash
48
- npm install -g sunnah
49
- ```
50
-
51
- ---
52
-
53
- ## ๐Ÿ–ฅ๏ธ Usage
54
-
55
- ### Interactive UI (default)
56
-
57
- ```bash
58
- sunnah
59
- ```
60
-
61
- Opens a full-screen interactive installer:
62
-
63
- ```
64
- โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
65
- ๐Ÿ“š Sunnah Package Manager v1.1.2
66
- โ†‘โ†“ navigate space select a all i info u uninstall enter install q quit
67
- โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
68
-
69
- โ–ถ [โœ“] Sahih al-Bukhari โ— installed
70
- Imam Muhammad ibn Ismail al-Bukhari
71
- The most authentic collection of hadith...
72
- Hadiths: 7,563 CLI: bukhari --help
73
-
74
- [ ] Sahih Muslim โ—‹ not installed
75
- [ ] Sunan Abi Dawud โ—‹ not installed
76
- [ ] Jami al-Tirmidhi โ—‹ not installed
77
- [ ] Sunan Ibn Majah โ—‹ not installed
78
-
79
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
80
- โ— 1 selected: sahih-al-bukhari
81
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
82
- ```
83
-
84
- ### Keyboard Controls
85
-
86
- | Key | Action |
87
- | ------- | ------------------------------------- |
88
- | `โ†‘` `โ†“` | Navigate packages |
89
- | `space` | Toggle select |
90
- | `a` | Select all / deselect all |
91
- | `i` | Show package info + installed version |
92
- | `u` | Uninstall selected |
93
- | `enter` | Install selected |
94
- | `q` | Quit |
95
-
96
- ### Non-interactive commands
97
-
98
- ```bash
99
- sunnah --list # List all packages with install status
100
- sunnah --update # Check all installed packages for updates
101
- sunnah --help # Show help
102
- sunnah --version # Show version
103
- ```
104
-
105
- ---
106
-
107
- ## ๐Ÿ—‚๏ธ After Installing
108
-
109
- Once you've installed individual packages via `sunnah`, each has its own powerful CLI:
110
-
111
- ```bash
112
- # Read hadiths
113
- bukhari 1 # First hadith
114
- muslim 2345 -b # Hadith #2345 in Arabic + English
115
- tirmidhi 23 34 # 34th hadith of chapter 23
116
- dawud --random # Random hadith
117
- ibnmajah 500 -b # Hadith #500 in Arabic + English
118
-
119
- # Search
120
- bukhari --search "prayer" # Top 5 results with highlighted matches
121
- tirmidhi --search "fasting" --all # All results
122
-
123
- # Browse chapters
124
- muslim --chapter 5 # All hadiths in chapter 5
125
-
126
- # React hook
127
- bukhari --react # Generate useBukhari() hook in your project
128
- ```
129
-
130
- ---
131
-
132
- ## ๐Ÿ”— Individual Package Links
133
-
134
- Each book is also available as a standalone package with full Node.js, React, and Vue support:
135
-
136
- | Package | npm | GitHub |
137
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
138
- | `sahih-al-bukhari` | [![npm](https://img.shields.io/npm/v/sahih-al-bukhari?style=flat-square&logo=npm)](https://npmjs.com/package/sahih-al-bukhari) | [SENODROOM/sahih-al-bukhari](https://github.com/SENODROOM/sahih-al-bukhari) |
139
- | `sahih-muslim` | [![npm](https://img.shields.io/npm/v/sahih-muslim?style=flat-square&logo=npm)](https://npmjs.com/package/sahih-muslim) | [SENODROOM/sahih-muslim](https://github.com/SENODROOM/sahih-muslim) |
140
- | `sunan-abi-dawud` | [![npm](https://img.shields.io/npm/v/sunan-abi-dawud?style=flat-square&logo=npm)](https://npmjs.com/package/sunan-abi-dawud) | [SENODROOM/sunan-abi-dawud](https://github.com/SENODROOM/sunan-abi-dawud) |
141
- | `jami-al-tirmidhi` | [![npm](https://img.shields.io/npm/v/jami-al-tirmidhi?style=flat-square&logo=npm)](https://npmjs.com/package/jami-al-tirmidhi) | [SENODROOM/jami-al-tirmidhi](https://github.com/SENODROOM/jami-al-tirmidhi) |
142
- | `sunan-ibn-majah` | [![npm](https://img.shields.io/npm/v/sunan-ibn-majah?style=flat-square&logo=npm)](https://npmjs.com/package/sunan-ibn-majah) | [SENODROOM/sunan-ibn-majah](https://github.com/SENODROOM/sunan-ibn-majah) |
143
-
144
- ---
145
-
146
- ## ๐Ÿค Contributing
147
-
148
- ### Overview
149
-
150
- This is a **monorepo** managed with **git subtree**. The root repo (`SENODROOM/sunnah`) contains the `sunnah` CLI package manager. Each hadith book lives in `books/<book-name>/` and is simultaneously maintained as its own standalone GitHub repo, linked here as a subtree.
151
-
152
- ```
153
- sunnah/ โ† root repo: the CLI manager
154
- โ”œโ”€โ”€ bin/index.js โ† sunnah interactive UI
155
- โ”œโ”€โ”€ books/
156
- โ”‚ โ”œโ”€โ”€ sahih-al-bukhari/ โ† subtree: SENODROOM/sahih-al-bukhari
157
- โ”‚ โ”œโ”€โ”€ sahih-muslim/ โ† subtree: SENODROOM/sahih-muslim
158
- โ”‚ โ”œโ”€โ”€ sunan-abi-dawud/ โ† subtree: SENODROOM/sunan-abi-dawud
159
- โ”‚ โ”œโ”€โ”€ jami-al-tirmidhi/ โ† subtree: SENODROOM/jami-al-tirmidhi
160
- โ”‚ โ””โ”€โ”€ sunan-ibn-majah/ โ† subtree: SENODROOM/sunan-ibn-majah
161
- โ””โ”€โ”€ package.json
162
- ```
163
-
164
- ---
165
-
166
- ### ๐Ÿ“ฅ Cloning the Repo
167
-
168
- ```bash
169
- git clone https://github.com/SENODROOM/sunnah.git
170
- cd sunnah
171
- npm install
172
- ```
173
-
174
- ---
175
-
176
- ### ๐ŸŒฟ Working with Git Subtrees
177
-
178
- #### What is a subtree?
179
-
180
- Unlike submodules, git subtrees embed the full history of a child repo directly inside the parent. You can push and pull changes between the root monorepo and each book's standalone repo without any special git setup for contributors โ€” it's all plain git.
181
-
182
- #### Adding a new book as a subtree
183
-
184
- When a new hadith book package has been published as its own GitHub repo (e.g. `SENODROOM/sunan-ibn-majah`), add it to the monorepo like this:
185
-
186
- ```bash
187
- # Step 1 โ€” register the remote (one-time)
188
- git remote add sunan-ibn-majah https://github.com/SENODROOM/sunan-ibn-majah.git
189
-
190
- # Step 2 โ€” add the subtree at books/sunan-ibn-majah/
191
- git subtree add --prefix=books/sunan-ibn-majah sunan-ibn-majah main --squash
192
-
193
- # Step 3 โ€” commit message will be auto-generated; push to the monorepo
194
- git push origin main
195
- ```
196
-
197
- #### Pulling updates from a book repo into the monorepo
198
-
199
- If changes have been made directly in the standalone book repo (e.g. a data fix in `SENODROOM/sahih-al-bukhari`), pull them in:
200
-
201
- ```bash
202
- git subtree pull --prefix=books/sahih-al-bukhari sahih-al-bukhari main --squash
203
- ```
204
-
205
- #### Pushing monorepo changes back to a book repo
206
-
207
- If you edited a book's files inside the monorepo and want those changes reflected in the standalone repo:
208
-
209
- ```bash
210
- git subtree push --prefix=books/sahih-al-bukhari sahih-al-bukhari main
211
- ```
212
-
213
- #### Remotes reference table
214
-
215
- | Book folder | Remote name | Repo URL |
216
- | ------------------------ | ------------------ | ------------------------------------------------- |
217
- | `books/sahih-al-bukhari` | `sahih-al-bukhari` | https://github.com/SENODROOM/sahih-al-bukhari.git |
218
- | `books/sahih-muslim` | `sahih-muslim` | https://github.com/SENODROOM/sahih-muslim.git |
219
- | `books/sunan-abi-dawud` | `sunan-abi-dawud` | https://github.com/SENODROOM/sunan-abi-dawud.git |
220
- | `books/jami-al-tirmidhi` | `jami-al-tirmidhi` | https://github.com/SENODROOM/jami-al-tirmidhi.git |
221
- | `books/sunan-ibn-majah` | `sunan-ibn-majah` | https://github.com/SENODROOM/sunan-ibn-majah.git |
222
-
223
- ---
224
-
225
- ### โœ๏ธ Making Changes to the Root CLI (`bin/index.js` or `package.json`)
226
-
227
- These files belong only to the root monorepo โ€” changes here do **not** need to be pushed to any subtree remote.
228
-
229
- ```bash
230
- # Edit bin/index.js or package.json as usual, then:
231
- git add .
232
- git commit -m "feat: add sunan-ibn-majah to PACKAGES list"
233
- git push origin main
234
- ```
235
-
236
- ---
237
-
238
- ### โž• Adding a New Book Package (Pull Request guide)
239
-
240
- To contribute a new hadith book to the ecosystem, follow these steps:
241
-
242
- **1. Create the book repo**
243
-
244
- Create a new GitHub repo at `https://github.com/<your-username>/<book-slug>` following the existing book structure:
245
-
246
- ```
247
- <book-slug>/
248
- โ”œโ”€โ”€ bin/
249
- โ”‚ โ”œโ”€โ”€ index.js โ† CLI entry point
250
- โ”‚ โ””โ”€โ”€ <slug>.json โ† full hadith data (Arabic + English)
251
- โ”œโ”€โ”€ chapters/
252
- โ”‚ โ”œโ”€โ”€ meta.json โ† chapter list
253
- โ”‚ โ”œโ”€โ”€ 1.json โ† hadiths per chapter
254
- โ”‚ โ””โ”€โ”€ ...
255
- โ”œโ”€โ”€ build.mjs
256
- โ”œโ”€โ”€ index.js โ† ESM browser entry
257
- โ”œโ”€โ”€ index.cjs โ† CommonJS entry
258
- โ”œโ”€โ”€ index.node.js โ† Node.js entry
259
- โ”œโ”€โ”€ index.d.ts โ† TypeScript definitions
260
- โ”œโ”€โ”€ package.json
261
- โ”œโ”€โ”€ README.md
262
- โ”œโ”€โ”€ LICENSE โ† AGPL-3.0
263
- โ”œโ”€โ”€ .gitignore
264
- โ””โ”€โ”€ .npmignore
265
- ```
266
-
267
- The `package.json` must follow this shape exactly:
268
-
269
- ```json
270
- {
271
- "name": "<book-slug>",
272
- "version": "1.0.0",
273
- "description": "Complete <Book Name> hadith collection. Tiny package (~3KB), data from CDN. CLI + Node.js + React/Vue/Vite.",
274
- "type": "module",
275
- "main": "./index.cjs",
276
- "module": "./index.browser.js",
277
- "types": "./index.d.ts",
278
- "exports": {
279
- ".": {
280
- "types": "./index.d.ts",
281
- "browser": "./index.browser.js",
282
- "require": "./index.cjs",
283
- "import": "./index.node.js"
284
- },
285
- "./chapters/*": "./chapters/*"
286
- },
287
- "bin": { "<cmd>": "./bin/index.js" },
288
- "scripts": {
289
- "build": "node build.mjs",
290
- "prepublishOnly": "node build.mjs"
291
- },
292
- "keywords": [
293
- "islam",
294
- "hadith",
295
- "<slug>",
296
- "sunnah",
297
- "json",
298
- "arabic",
299
- "english",
300
- "react",
301
- "hook"
302
- ],
303
- "author": "muhammadsaadamin",
304
- "license": "AGPL-3.0",
305
- "repository": {
306
- "type": "git",
307
- "url": "https://github.com/SENODROOM/<book-slug>.git"
308
- },
309
- "files": [
310
- "index.js",
311
- "index.browser.js",
312
- "index.cjs",
313
- "index.node.js",
314
- "index.d.ts",
315
- "bin/index.js",
316
- "bin/<slug>.json",
317
- "chapters/"
318
- ],
319
- "engines": { "node": ">=14.0.0" }
320
- }
321
- ```
322
-
323
- **2. Publish the npm package**
324
-
325
- ```bash
326
- cd <book-slug>
327
- npm publish --access public
328
- ```
329
-
330
- **3. Fork this monorepo and add the subtree**
331
-
332
- ```bash
333
- git clone https://github.com/<your-username>/sunnah.git
334
- cd sunnah
335
- git remote add <book-slug> https://github.com/<your-username>/<book-slug>.git
336
- git subtree add --prefix=books/<book-slug> <book-slug> main --squash
337
- ```
338
-
339
- **4. Register the new package in `bin/index.js`**
340
-
341
- Add an entry to the `PACKAGES` array in `bin/index.js`:
342
-
343
- ```js
344
- {
345
- name: "<book-slug>",
346
- label: "<Book Name>",
347
- author: "Imam <Author Name>",
348
- desc: "<One-sentence description of the collection.>",
349
- hadiths: "<count>",
350
- cmd: "<cmd>",
351
- hook: "use<Hook>",
352
- },
353
- ```
354
-
355
- **5. Open a Pull Request**
356
-
357
- Push your branch and open a PR to `SENODROOM/sunnah` with:
358
-
359
- - Title: `feat: add <book-slug> package`
360
- - Description: Include the npm package link, hadith count, and a short description of the book's authenticity/provenance
361
-
362
- ---
363
-
364
- ### ๐Ÿ› Reporting Issues
365
-
366
- Use the [Issues tab](https://github.com/SENODROOM/sunnah/issues) to:
367
-
368
- - Request a new hadith collection to be added
369
- - Report data errors in any book
370
- - Suggest CLI improvements
371
-
372
- ---
373
-
374
- ## ๐Ÿ“„ License
375
-
376
- Licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** โ€” see [LICENSE](LICENSE) for details.
377
-
378
- ---
379
-
380
- ## ๐Ÿ™ Acknowledgments
381
-
382
- - **๐Ÿ“– Sources** โ€” The authentic hadith collections of Islam
383
- - **๐Ÿ‘จโ€๐Ÿซ Scholars** โ€” Translators and Islamic scholars whose work makes this possible
384
- - **๐Ÿ’š Community** โ€” The Muslim developer community worldwide
385
-
386
- ---
387
-
388
- <div align="center">
389
-
390
- **Made with โค๏ธ for the Muslim community | Seeking knowledge together**
391
-
392
- [![GitHub stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github)](https://github.com/SENODROOM/sunnah)
393
-
394
- [๐Ÿ“ฆ npm](https://npmjs.com/package/sunnah) โ€ข
395
- [๐Ÿ› Issues](https://github.com/SENODROOM/sunnah/issues) โ€ข
396
- [๐Ÿค Contribute](https://github.com/SENODROOM/sunnah/pulls)
397
-
398
- </div>
1
+ <div align="center">
2
+
3
+ <h1>
4
+ <img src="https://em-content.zobj.net/source/apple/391/prayer-beads_1f4ff.png" width="36" />
5
+ &nbsp;sunnah
6
+ </h1>
7
+
8
+ <p align="center">
9
+ <strong>One command. Every major Hadith collection.<br />
10
+ Interactive package manager for the entire Sunnah ecosystem โ€” npm + PyPI.</strong>
11
+ </p>
12
+
13
+ <br />
14
+
15
+ <p>
16
+ <a href="https://www.npmjs.com/package/sunnah">
17
+ <img src="https://img.shields.io/npm/v/sunnah?style=for-the-badge&logo=npm&logoColor=white&color=CB3837&labelColor=1a1a1a" />
18
+ </a>
19
+ &nbsp;
20
+ <a href="https://pypi.org/project/sunnah/">
21
+ <img src="https://img.shields.io/pypi/v/sunnah?style=for-the-badge&logo=pypi&logoColor=white&color=3775A9&labelColor=1a1a1a" />
22
+ </a>
23
+ &nbsp;
24
+ <a href="https://github.com/SENODROOM/sunnah/blob/main/LICENSE">
25
+ <img src="https://img.shields.io/github/license/SENODROOM/sunnah?style=for-the-badge&logo=gnu&logoColor=white&color=A42E2B&labelColor=1a1a1a" />
26
+ </a>
27
+ </p>
28
+
29
+ <p>
30
+ <img src="https://img.shields.io/badge/Node.js-%3E%3D18-339933?style=for-the-badge&logo=node.js&logoColor=white&labelColor=1a1a1a" />
31
+ &nbsp;
32
+ <img src="https://img.shields.io/badge/Python-%3E%3D3.8-3776AB?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a1a" />
33
+ </p>
34
+
35
+ </div>
36
+
37
+ ---
38
+
39
+ ## ๐ŸŒ™ What is Sunnah?
40
+
41
+ `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).
42
+
43
+ ```bash
44
+ npm install -g sunnah # Node.js CLI
45
+ pip install sunnah # Python CLI
46
+ sunnah # open interactive TUI
47
+ ```
48
+
49
+ ---
50
+
51
+ ## ๐Ÿ“ฆ Available Packages
52
+
53
+ | Book | npm | pip | Hadiths | CLI |
54
+ |------|-----|-----|---------|-----|
55
+ | **Sahih al-Bukhari** | `sahih-al-bukhari` | `sahih-al-bukhari` | 7,563 | `bukhari` |
56
+ | **Sahih Muslim** | `sahih-muslim` | `sahih-muslim` | 7,470 | `muslim` |
57
+ | **Sunan Abi Dawud** | `sunan-abi-dawud` | `sunan-abi-dawud` | 5,274 | `dawud` |
58
+ | **Jami al-Tirmidhi** | `jami-al-tirmidhi` | `jami-al-tirmidhi` | 3,956 | `tirmidhi` |
59
+ | **Sunan Ibn Majah** | `sunan-ibn-majah` | `sunan-ibn-majah` | 4,341 | `majah` |
60
+ | **Sunan al-Nasa'i** | `sunan-al-nasai` | `sunan-al-nasai` | 5,768 | `nasai` |
61
+
62
+ ---
63
+
64
+ ## ๐Ÿš€ Installation
65
+
66
+ ```bash
67
+ # JavaScript / Node.js
68
+ npm install -g sunnah
69
+
70
+ # Python
71
+ pip install sunnah
72
+ ```
73
+
74
+ ---
75
+
76
+ ## ๐Ÿ–ฅ๏ธ Interactive TUI
77
+
78
+ ```bash
79
+ sunnah
80
+ ```
81
+
82
+ Opens a full-screen terminal UI. Navigate with `โ†‘โ†“`, toggle with `space`, press `enter` to install.
83
+
84
+ ```
85
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
86
+ ๐Ÿ“ฟ Sunnah Package Manager v1.5.0
87
+ โ†‘โ†“ nav space select a all i info u uninstall U update enter install q quit
88
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
89
+
90
+ โ–ถ [โœ“] Sahih al-Bukhari โ— npm (up to date)
91
+ Imam Muhammad ibn Ismail al-Bukhari
92
+ Most authentic hadith collection, second only to the Quran.
93
+ Hadiths: 7,563 CLI: bukhari --help npm: sahih-al-bukhari pip: sahih-al-bukhari
94
+
95
+ [ ] Sahih Muslim โ—‹ not installed
96
+ [ ] Sunan Abi Dawud โ—‹ not installed
97
+ ...
98
+ ```
99
+
100
+ ### Keyboard Controls
101
+
102
+ | Key | Action |
103
+ |-----|--------|
104
+ | `โ†‘` `โ†“` | Navigate |
105
+ | `space` | Toggle select |
106
+ | `a` | Select all / deselect all |
107
+ | `i` | Show package info |
108
+ | `u` | Uninstall selected |
109
+ | `U` | Update selected |
110
+ | `enter` | Install selected |
111
+ | `q` | Quit |
112
+
113
+ ---
114
+
115
+ ## โšก Commands
116
+
117
+ ### npm packages
118
+
119
+ ```bash
120
+ sunnah list # all packages + npm/pip status
121
+ sunnah install bukhari # npm install -g sahih-al-bukhari
122
+ sunnah install bukhari nasai majah # install multiple at once
123
+ sunnah uninstall dawud # uninstall
124
+ sunnah update # check for updates
125
+ sunnah update --install # auto-install all updates
126
+ ```
127
+
128
+ ### Python (pip) packages
129
+
130
+ ```bash
131
+ sunnah pip install bukhari # pip install sahih-al-bukhari
132
+ sunnah pip install bukhari nasai # install multiple
133
+ sunnah pip uninstall dawud # uninstall
134
+ sunnah pip list # show Python package status
135
+ sunnah pip update # check for pip updates
136
+ sunnah pip update --install # auto-install pip updates
137
+ ```
138
+
139
+ ### ๐Ÿ” NEW: Cross-book search
140
+
141
+ ```bash
142
+ sunnah search "prayer" # search all installed books (top 3 each)
143
+ sunnah search "fasting" --all # show all results
144
+ ```
145
+
146
+ ### ๐ŸŽฒ NEW: Random hadith
147
+
148
+ ```bash
149
+ sunnah random # random hadith from a random installed book
150
+ sunnah random bukhari # random hadith specifically from Bukhari
151
+ ```
152
+
153
+ ### โ„น๏ธ NEW: Book info
154
+
155
+ ```bash
156
+ sunnah info nasai # detailed info: versions, CLI, Python import
157
+ sunnah info jami-al-tirmidhi # works with full npm name too
158
+ ```
159
+
160
+ ### โš›๏ธ React hook generator
161
+
162
+ ```bash
163
+ sunnah --react # generate useSunnah() for all installed books
164
+ sunnah --react bukhari muslim # specific books only
165
+ ```
166
+
167
+ ---
168
+
169
+ ## ๐Ÿ Python API
170
+
171
+ After `pip install sunnah`, you also get the individual book packages:
172
+
173
+ ```bash
174
+ sunnah pip install bukhari muslim nasai
175
+ ```
176
+
177
+ ```python
178
+ from sahih_al_bukhari import Bukhari
179
+ from sahih_muslim import Muslim
180
+ from sunan_al_nasai import Nasai
181
+
182
+ bukhari = Bukhari()
183
+ bukhari.get(1)
184
+ bukhari.search("prayer", limit=5)
185
+ bukhari.getRandom()
186
+ bukhari.getByChapter(1)
187
+ ```
188
+
189
+ ---
190
+
191
+ ## ๐ŸŸจ JavaScript / Node.js
192
+
193
+ ```bash
194
+ sunnah install bukhari muslim
195
+ ```
196
+
197
+ ```javascript
198
+ import bukhari from 'sahih-al-bukhari';
199
+ import muslim from 'sahih-muslim';
200
+
201
+ bukhari.get(1).english.text
202
+ muslim.search('prayer', 5)
203
+ ```
204
+
205
+ ---
206
+
207
+ ## ๐Ÿ“Š Version Stats
208
+
209
+ ```bash
210
+ sunnah --version
211
+ ```
212
+
213
+ ```
214
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
215
+ ๐Ÿ“ฟ sunnah v1.5.0
216
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
217
+ Available : 6
218
+ npm inst. : 4 / 6
219
+ pip inst. : 3 / 6
220
+ Collection : Sahih al-Bukhari, Sahih Muslim, Sunan al-Nasa'i, Jami al-Tirmidhi
221
+ Hadiths : 24,257
222
+ ```
223
+
224
+ ---
225
+
226
+ ## ๐Ÿ—‚๏ธ Monorepo Structure
227
+
228
+ ```
229
+ sunnah/
230
+ โ”œโ”€โ”€ bin/index.js โ† npm CLI (interactive TUI + all commands)
231
+ โ”œโ”€โ”€ python/sunnah_cli/ โ† Python CLI (mirrors npm CLI exactly)
232
+ โ”‚ โ”œโ”€โ”€ __init__.py
233
+ โ”‚ โ”œโ”€โ”€ cli.py โ† main Python CLI entry
234
+ โ”‚ โ”œโ”€โ”€ packages.py โ† package registry (single source of truth)
235
+ โ”‚ โ”œโ”€โ”€ npm_utils.py โ† npm helpers
236
+ โ”‚ โ””โ”€โ”€ pip_utils.py โ† pip helpers
237
+ โ”œโ”€โ”€ package.json
238
+ โ”œโ”€โ”€ pyproject.toml
239
+ โ””โ”€โ”€ .github/workflows/ โ† auto-publish to npm + PyPI on release
240
+ ```
241
+
242
+ ---
243
+
244
+ ## ๐Ÿ“„ License
245
+
246
+ GNU Affero General Public License v3.0 (AGPL-3.0)
247
+
248
+ ---
249
+
250
+ <div align="center">
251
+
252
+ **Made with โค๏ธ for the Muslim community ยท Seeking knowledge together**
253
+
254
+ [![Stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github&logoColor=white&color=f0c040&labelColor=1a1a1a)](https://github.com/SENODROOM/sunnah)
255
+
256
+ [๐Ÿ“ฆ npm](https://npmjs.com/package/sunnah) โ€ข [๐Ÿ PyPI](https://pypi.org/project/sunnah/) โ€ข [๐Ÿ› Issues](https://github.com/SENODROOM/sunnah/issues)
257
+
258
+ </div>