@malikasadjaved/readme-ai 1.1.0 → 1.2.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 (96) hide show
  1. package/README.md +406 -316
  2. package/dist/analyzers/badge-generator.js +27 -27
  3. package/dist/analyzers/badge-generator.js.map +1 -1
  4. package/dist/analyzers/code-analyzer.js +37 -2
  5. package/dist/analyzers/code-analyzer.js.map +1 -1
  6. package/dist/analyzers/dependency-analyzer.d.ts.map +1 -1
  7. package/dist/analyzers/dependency-analyzer.js +203 -26
  8. package/dist/analyzers/dependency-analyzer.js.map +1 -1
  9. package/dist/analyzers/diagram-builder.js +19 -18
  10. package/dist/analyzers/diagram-builder.js.map +1 -1
  11. package/dist/analyzers/file-scanner.d.ts.map +1 -1
  12. package/dist/analyzers/file-scanner.js +13 -13
  13. package/dist/analyzers/file-scanner.js.map +1 -1
  14. package/dist/analyzers/index.d.ts +1 -1
  15. package/dist/analyzers/index.d.ts.map +1 -1
  16. package/dist/analyzers/index.js +1 -1
  17. package/dist/analyzers/index.js.map +1 -1
  18. package/dist/analyzers/repo-fetcher.d.ts.map +1 -1
  19. package/dist/analyzers/repo-fetcher.js +40 -13
  20. package/dist/analyzers/repo-fetcher.js.map +1 -1
  21. package/dist/cli.js +1 -1
  22. package/dist/cli.js.map +1 -1
  23. package/dist/commands/generate.d.ts.map +1 -1
  24. package/dist/commands/generate.js +58 -6
  25. package/dist/commands/generate.js.map +1 -1
  26. package/dist/config.d.ts +14 -0
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js +24 -0
  29. package/dist/config.js.map +1 -1
  30. package/dist/generators/contributing.js +3 -3
  31. package/dist/generators/contributing.js.map +1 -1
  32. package/dist/generators/index.d.ts +1 -1
  33. package/dist/generators/index.d.ts.map +1 -1
  34. package/dist/generators/index.js +1 -1
  35. package/dist/generators/index.js.map +1 -1
  36. package/dist/generators/install.d.ts.map +1 -1
  37. package/dist/generators/install.js.map +1 -1
  38. package/dist/generators/overview.d.ts.map +1 -1
  39. package/dist/generators/overview.js +12 -5
  40. package/dist/generators/overview.js.map +1 -1
  41. package/dist/generators/usage.d.ts.map +1 -1
  42. package/dist/generators/usage.js +15 -9
  43. package/dist/generators/usage.js.map +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/plugins/index.d.ts +49 -0
  46. package/dist/plugins/index.d.ts.map +1 -0
  47. package/dist/plugins/index.js +113 -0
  48. package/dist/plugins/index.js.map +1 -0
  49. package/dist/providers/anthropic.d.ts.map +1 -1
  50. package/dist/providers/anthropic.js +4 -1
  51. package/dist/providers/anthropic.js.map +1 -1
  52. package/dist/providers/gemini.d.ts.map +1 -1
  53. package/dist/providers/gemini.js +5 -1
  54. package/dist/providers/gemini.js.map +1 -1
  55. package/dist/providers/index.d.ts +1 -0
  56. package/dist/providers/index.d.ts.map +1 -1
  57. package/dist/providers/index.js +31 -2
  58. package/dist/providers/index.js.map +1 -1
  59. package/dist/providers/ollama.d.ts.map +1 -1
  60. package/dist/providers/ollama.js +6 -3
  61. package/dist/providers/ollama.js.map +1 -1
  62. package/dist/providers/openai.d.ts.map +1 -1
  63. package/dist/providers/openai.js.map +1 -1
  64. package/dist/themes/academic.js +2 -2
  65. package/dist/themes/academic.js.map +1 -1
  66. package/dist/themes/default.js +2 -2
  67. package/dist/themes/default.js.map +1 -1
  68. package/dist/themes/hacker.js +4 -4
  69. package/dist/themes/hacker.js.map +1 -1
  70. package/dist/themes/index.d.ts.map +1 -1
  71. package/dist/themes/index.js +7 -2
  72. package/dist/themes/index.js.map +1 -1
  73. package/dist/themes/minimal.js +3 -3
  74. package/dist/themes/minimal.js.map +1 -1
  75. package/dist/themes/modern.js +2 -2
  76. package/dist/themes/modern.js.map +1 -1
  77. package/dist/utils/cache.d.ts +4 -0
  78. package/dist/utils/cache.d.ts.map +1 -0
  79. package/dist/utils/cache.js +48 -0
  80. package/dist/utils/cache.js.map +1 -0
  81. package/dist/utils/file-utils.d.ts.map +1 -1
  82. package/dist/utils/file-utils.js +45 -13
  83. package/dist/utils/file-utils.js.map +1 -1
  84. package/dist/utils/github-api.d.ts.map +1 -1
  85. package/dist/utils/github-api.js +2 -2
  86. package/dist/utils/github-api.js.map +1 -1
  87. package/dist/utils/language-detector.d.ts.map +1 -1
  88. package/dist/utils/language-detector.js +56 -30
  89. package/dist/utils/language-detector.js.map +1 -1
  90. package/dist/utils/markdown-writer.d.ts.map +1 -1
  91. package/dist/utils/markdown-writer.js +1 -3
  92. package/dist/utils/markdown-writer.js.map +1 -1
  93. package/dist/utils/template-engine.d.ts.map +1 -1
  94. package/dist/utils/template-engine.js +6 -3
  95. package/dist/utils/template-engine.js.map +1 -1
  96. package/package.json +128 -60
package/README.md CHANGED
@@ -1,316 +1,406 @@
1
- <div align="center">
2
-
3
- # readme-ai
4
-
5
- > Generate stunning, production-quality READMEs from any codebase in seconds
6
-
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.5-3178C6?style=flat-square&logo=typescript)](#)
8
- [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A518-5FA04E?style=flat-square&logo=nodedotjs)](#)
9
- [![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](#license)
10
- [![npm](https://img.shields.io/npm/v/@malikasadjaved/readme-ai?style=flat-square&logo=npm)](https://www.npmjs.com/package/@malikasadjaved/readme-ai)
11
-
12
- **One command. Zero install. Beautiful READMEs.**
13
-
14
- [Quick Start](#-quick-start) · [Themes](#-themes) · [Providers](#-ai-providers) · [CLI Options](#-cli-options) · [GitHub Action](#-github-action)
15
-
16
- </div>
17
-
18
- ---
19
-
20
- ## Overview
21
-
22
- **readme-ai** reads your actual source code — not just directory names — and generates a complete, polished README with architecture diagrams, badges, install instructions, usage examples, and API docs. Point it at any local project or public GitHub repo and get a production-ready README in seconds.
23
-
24
- Unlike existing tools, readme-ai goes deep: it parses dependencies, detects frameworks, extracts API endpoints and CLI commands, and builds Mermaid architecture diagrams automatically. It supports 5 visual themes and 4 AI providers (including fully local generation via Ollama).
25
-
26
- ## Key Features
27
-
28
- - **npx-first** — zero install, works instantly: `npx @malikasadjaved/readme-ai`
29
- - **Deep code analysis** reads actual source files, extracts functions, endpoints, and CLI commands
30
- - **Auto Mermaid diagrams** — generates architecture diagrams from your code structure
31
- - **5 beautiful themes** — Default, Modern, Hacker, Minimal, Academic
32
- - **4 AI providers** — Claude, GPT-4o, Gemini, Ollama (free & local)
33
- - **Smart badge generation** auto-detects language, frameworks, CI, Docker, license
34
- - **GitHub URL support** — `npx @malikasadjaved/readme-ai github:user/repo` analyzes any public repo
35
- - **GitHub Action included** auto-regenerate your README on every push
36
-
37
- ## Quick Start
38
-
39
- ```bash
40
- # Generate README for current directory
41
- npx @malikasadjaved/readme-ai
42
-
43
- # Point at a local project
44
- npx @malikasadjaved/readme-ai ./my-project
45
-
46
- # Point at a GitHub repo
47
- npx @malikasadjaved/readme-ai github:expressjs/express
48
-
49
- # Interactive mode (guided prompts)
50
- npx @malikasadjaved/readme-ai --interactive
51
- ```
52
-
53
- ## Demo
54
-
55
- <div align="center">
56
- <img src="demo/demo.gif" alt="readme-ai demo" width="800">
57
- <p><em>Generating a full README in seconds with architecture diagrams, badges, and more.</em></p>
58
- </div>
59
-
60
- ## Comparison
61
-
62
- | Feature | readme-ai | eli64s/readme-ai | readmeX |
63
- |---------|:---------:|:----------------:|:-------:|
64
- | npx support (zero install) | **Yes** | No | No |
65
- | Mermaid architecture diagrams | **Yes** | No | No |
66
- | GitHub URL analysis | **Yes** | Yes | Yes |
67
- | Multiple themes | **5** | 3 | No |
68
- | GitHub Action template | **Yes** | No | No |
69
- | API docs from code | **Yes** | No | No |
70
- | Badge auto-generation | **Yes** | Yes | Partial |
71
- | Local AI (Ollama) | **Yes** | No | No |
72
-
73
- ## Themes
74
-
75
- ### Default Clean & Professional
76
- The standard theme with a centered header, emoji section headers, and shields.io badges.
77
-
78
- ### Modern — Emoji-rich & Colorful
79
- Heavy use of emojis, colorful badge rows, and visual separators for maximum impact.
80
-
81
- ### Hacker — Terminal Aesthetic
82
- ASCII art header, monospace styling, `>` prefixed descriptions — for the terminal lovers.
83
-
84
- ### Minimal — Pure Markdown
85
- No emojis, no badges, no frills. Just clean, readable markdown.
86
-
87
- ### Academic — Formal & Structured
88
- Numbered sections, citation-style references, formal language. Great for research projects.
89
-
90
- ```bash
91
- # Use a specific theme
92
- npx @malikasadjaved/readme-ai --theme modern
93
- npx @malikasadjaved/readme-ai --theme hacker
94
- npx @malikasadjaved/readme-ai --theme minimal
95
- npx @malikasadjaved/readme-ai --theme academic
96
- ```
97
-
98
- ## AI Providers
99
-
100
- ### Claude (Anthropic) Default
101
-
102
- ```bash
103
- export ANTHROPIC_API_KEY=sk-ant-...
104
- npx @malikasadjaved/readme-ai
105
- ```
106
-
107
- ### GPT-4o-mini (OpenAI)
108
-
109
- ```bash
110
- export OPENAI_API_KEY=sk-...
111
- npx @malikasadjaved/readme-ai --provider openai
112
- ```
113
-
114
- ### Gemini Flash (Google)
115
-
116
- ```bash
117
- export GEMINI_API_KEY=...
118
- npx @malikasadjaved/readme-ai --provider gemini
119
- ```
120
-
121
- ### Ollama (Local, Free)
122
-
123
- ```bash
124
- # Make sure Ollama is running locally
125
- npx @malikasadjaved/readme-ai --provider ollama
126
- npx @malikasadjaved/readme-ai --provider ollama --model llama3.1
127
- ```
128
-
129
- ## CLI Options
130
-
131
- ```
132
- Usage: readme-ai [repo] [options]
133
-
134
- Arguments:
135
- repo Local path or GitHub URL (github:user/repo)
136
-
137
- Options:
138
- -V, --version Output the version number
139
- -o, --output <file> Output file path (default: "README.md")
140
- -p, --provider <name> AI provider: anthropic | openai | gemini | ollama (default: "anthropic")
141
- -m, --model <name> Model name (depends on provider)
142
- -t, --theme <name> Theme: default | minimal | hacker | modern | academic (default: "default")
143
- --no-diagram Skip Mermaid architecture diagram
144
- --no-badges Skip badge generation
145
- --no-api-docs Skip API documentation section
146
- --interactive Run in interactive mode
147
- --action Generate a GitHub Action for auto-updating README
148
- --overwrite Overwrite existing README without asking
149
- --dry-run Print README to stdout instead of writing to file
150
- -h, --help Display help for command
151
- ```
152
-
153
- ### Examples
154
-
155
- ```bash
156
- # Generate with Modern theme using OpenAI
157
- npx @malikasadjaved/readme-ai ./my-app --provider openai --theme modern
158
-
159
- # Dry run (preview without writing)
160
- npx @malikasadjaved/readme-ai --dry-run
161
-
162
- # Generate without diagram and badges
163
- npx @malikasadjaved/readme-ai --no-diagram --no-badges
164
-
165
- # Overwrite existing README and generate GitHub Action
166
- npx @malikasadjaved/readme-ai --overwrite --action
167
-
168
- # Analyze a remote GitHub repository
169
- npx @malikasadjaved/readme-ai github:tiangolo/fastapi --theme academic
170
- ```
171
-
172
- ## GitHub Action
173
-
174
- Auto-regenerate your README on every push to main:
175
-
176
- ```bash
177
- # Generate the action file automatically
178
- npx @malikasadjaved/readme-ai --action
179
- ```
180
-
181
- Or manually create `.github/workflows/readme-update.yml`:
182
-
183
- ```yaml
184
- name: Update README
185
-
186
- on:
187
- push:
188
- branches: [main, master]
189
- paths-ignore:
190
- - 'README.md'
191
-
192
- jobs:
193
- update-readme:
194
- runs-on: ubuntu-latest
195
- permissions:
196
- contents: write
197
-
198
- steps:
199
- - uses: actions/checkout@v4
200
-
201
- - uses: actions/setup-node@v4
202
- with:
203
- node-version: '20'
204
-
205
- - name: Generate README
206
- run: npx @malikasadjaved/readme-ai@latest --overwrite --no-interactive
207
- env:
208
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
209
-
210
- - name: Commit updated README
211
- uses: stefanzweifel/git-auto-commit-action@v5
212
- with:
213
- commit_message: 'docs: auto-update README [skip ci]'
214
- file_pattern: README.md
215
- ```
216
-
217
- ## Architecture
218
-
219
- ```mermaid
220
- graph TD
221
- A[CLI Input] --> B[Command Parser]
222
- B --> C[Repo Fetcher]
223
- C -->|Local Path| D[File Scanner]
224
- C -->|GitHub URL| E[GitHub API]
225
- E --> D
226
- D --> F[Code Analyzer]
227
- D --> G[Dependency Analyzer]
228
- F --> H[AI Provider]
229
- G --> H
230
- H --> I[Section Generators]
231
- I --> J[Theme Engine]
232
- J --> K[Markdown Writer]
233
- K --> L[README.md]
234
- ```
235
-
236
- ## Project Structure
237
-
238
- ```
239
- readme-ai/
240
- ├── src/
241
- │ ├── index.ts # CLI entry point
242
- │ ├── cli.ts # Interactive mode
243
- │ ├── config.ts # Configuration management
244
- │ ├── commands/
245
- │ │ └── generate.ts # Main generation pipeline
246
- │ ├── analyzers/
247
- │ │ ├── repo-fetcher.ts # Fetch from local or GitHub
248
- │ │ ├── file-scanner.ts # Scan and categorize files
249
- │ │ ├── code-analyzer.ts # Extract functions, endpoints, exports
250
- │ │ ├── dependency-analyzer.ts
251
- │ │ ├── badge-generator.ts
252
- │ │ └── diagram-builder.ts
253
- │ ├── generators/
254
- │ │ ├── overview.ts # Project summary + features
255
- │ │ ├── install.ts # Install instructions
256
- │ │ ├── usage.ts # Usage examples + API docs
257
- │ │ ├── contributing.ts # Contributing guide
258
- │ │ └── changelog.ts # Changelog section
259
- │ ├── providers/
260
- │ │ ├── anthropic.ts # Claude
261
- │ │ ├── openai.ts # GPT-4o
262
- │ │ ├── gemini.ts # Gemini Flash
263
- │ │ └── ollama.ts # Local Ollama
264
- │ ├── themes/
265
- │ │ ├── default.ts
266
- │ │ ├── modern.ts
267
- │ │ ├── hacker.ts
268
- │ │ ├── minimal.ts
269
- │ │ └── academic.ts
270
- │ └── utils/
271
- │ ├── file-utils.ts
272
- │ ├── github-api.ts
273
- │ ├── language-detector.ts
274
- │ ├── markdown-writer.ts
275
- │ └── template-engine.ts
276
- ├── templates/
277
- │ ├── github-action.yml
278
- │ └── .readmeaiignore.example
279
- └── tests/
280
- ├── analyzers/
281
- └── generators/
282
- ```
283
-
284
- ## Contributing
285
-
286
- Contributions are welcome! Here's how to get started:
287
-
288
- ```bash
289
- # Clone the repo
290
- git clone https://github.com/malikasadjaved/readme-ai.git
291
- cd readme-ai
292
-
293
- # Install dependencies
294
- npm install
295
-
296
- # Run in development mode
297
- npm run dev
298
-
299
- # Run tests
300
- npm test
301
-
302
- # Build
303
- npm run build
304
- ```
305
-
306
- ## License
307
-
308
- [MIT](LICENSE)
309
-
310
- ---
311
-
312
- <div align="center">
313
-
314
- Built with readme-ai
315
-
316
- </div>
1
+ <div align="center">
2
+
3
+ # readme-ai
4
+
5
+ ### The #1 AI-Powered README Generator for Developers
6
+
7
+ > Generate stunning, production-quality READMEs from any codebase in seconds — powered by Claude, GPT-4o, Gemini, or Ollama
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@malikasadjaved/readme-ai?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@malikasadjaved/readme-ai)
10
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.5-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](#)
11
+ [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A518-5FA04E?style=for-the-badge&logo=nodedotjs&logoColor=white)](#)
12
+ [![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](#license)
13
+ [![Tests](https://img.shields.io/badge/Tests-186%20passing-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)](#)
14
+ [![Coverage](https://img.shields.io/badge/Coverage-76%25-yellow?style=for-the-badge)](#)
15
+ [![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen?style=for-the-badge)](#contributing)
16
+
17
+ **One command. Zero install. Beautiful READMEs.**
18
+
19
+ ```bash
20
+ npx @malikasadjaved/readme-ai
21
+ ```
22
+
23
+ [Quick Start](#-quick-start) · [Themes](#-themes) · [AI Providers](#-ai-providers) · [Plugins](#-plugins) · [CLI Options](#-cli-options) · [GitHub Action](#-github-action) · [Contributing](#-contributing)
24
+
25
+ </div>
26
+
27
+ ---
28
+
29
+ <!-- SEO: readme generator, ai readme, auto documentation, markdown generator, github readme, readme template, ai documentation tool, code documentation, auto readme, readme maker, project documentation, npx readme, readme-ai, claude readme, gpt readme, gemini readme, ollama readme, mermaid diagram generator, badge generator, open source documentation, developer tools 2026, best readme generator, ai developer tools, LLM documentation, automated documentation -->
30
+
31
+ ## Overview
32
+
33
+ **readme-ai** is the most powerful open-source AI README generator available. It reads your actual source code — not just directory names — and generates a complete, polished README with architecture diagrams, badges, install instructions, usage examples, and API docs.
34
+
35
+ Point it at any local project or public GitHub repo and get a production-ready README in seconds.
36
+
37
+ ### Why readme-ai?
38
+
39
+ - **Deep code analysis** — parses actual source files, not just file trees
40
+ - **10+ languages supported** Node.js, Python, Rust, Go, Java (Gradle/Maven), Ruby, Swift, Dart/Flutter, and more
41
+ - **Mermaid architecture diagrams** — auto-generated from your code structure
42
+ - **Plugin system** — extend with custom analyzers and themes
43
+ - **Works with any AI** — Claude, GPT-4o, Gemini, or fully local with Ollama (free)
44
+ - **186 tests passing** — battle-tested and reliable
45
+
46
+ ## Key Features
47
+
48
+ | Feature | Description |
49
+ |---------|-------------|
50
+ | **Zero Install** | `npx @malikasadjaved/readme-ai` — works instantly, no setup |
51
+ | **Deep Code Analysis** | Extracts functions, API endpoints, CLI commands, exports |
52
+ | **Auto Mermaid Diagrams** | Architecture diagrams generated from code structure |
53
+ | **5 Themes** | Default, Modern, Hacker, Minimal, Academic |
54
+ | **4 AI Providers** | Claude, GPT-4o, Gemini Flash, Ollama (local/free) |
55
+ | **Smart Badges** | Auto-detects language, frameworks, CI, Docker, license |
56
+ | **GitHub URL Support** | Analyze any public repo: `github:user/repo` |
57
+ | **GitHub Action** | Auto-regenerate README on every push |
58
+ | **Plugin System** | Custom analyzers and themes via plugins |
59
+ | **10+ Languages** | Node.js, Python, Rust, Go, Java, Ruby, Swift, Dart, and more |
60
+ | **Project Config** | `.readmeairc.json` or `readme-ai.config.js` |
61
+ | **API Docs** | Auto-generated from exported functions and classes |
62
+
63
+ ## Quick Start
64
+
65
+ ```bash
66
+ # Generate README for current directory
67
+ npx @malikasadjaved/readme-ai
68
+
69
+ # Point at a local project
70
+ npx @malikasadjaved/readme-ai ./my-project
71
+
72
+ # Point at a GitHub repo
73
+ npx @malikasadjaved/readme-ai github:expressjs/express
74
+
75
+ # Interactive mode (guided prompts)
76
+ npx @malikasadjaved/readme-ai --interactive
77
+ ```
78
+
79
+ ### Install globally (optional)
80
+
81
+ ```bash
82
+ npm install -g @malikasadjaved/readme-ai
83
+ readme-ai ./my-project
84
+ ```
85
+
86
+ ## Demo
87
+
88
+ <div align="center">
89
+ <img src="demo/demo.gif" alt="readme-ai demo — AI README generator in action" width="800">
90
+ <p><em>Generating a full README in seconds — with architecture diagrams, badges, and more.</em></p>
91
+ </div>
92
+
93
+ ## Comparison
94
+
95
+ | Feature | readme-ai | eli64s/readme-ai | readmeX |
96
+ |---------|:---------:|:----------------:|:-------:|
97
+ | npx support (zero install) | **Yes** | No | No |
98
+ | Mermaid architecture diagrams | **Yes** | No | No |
99
+ | Plugin system | **Yes** | No | No |
100
+ | GitHub URL analysis | **Yes** | Yes | Yes |
101
+ | Multiple themes | **5** | 3 | No |
102
+ | GitHub Action template | **Yes** | No | No |
103
+ | API docs from code | **Yes** | No | No |
104
+ | Badge auto-generation | **Yes** | Yes | Partial |
105
+ | Local AI (Ollama) | **Yes** | No | No |
106
+ | 10+ language support | **Yes** | Partial | No |
107
+ | Pre-commit hooks | **Yes** | No | No |
108
+
109
+ ## Themes
110
+
111
+ ### Default Clean & Professional
112
+ The standard theme with a centered header, emoji section headers, and shields.io badges.
113
+
114
+ ### Modern Emoji-rich & Colorful
115
+ Heavy use of emojis, colorful badge rows, and visual separators for maximum impact.
116
+
117
+ ### Hacker — Terminal Aesthetic
118
+ ASCII art header, monospace styling, `>` prefixed descriptions — for the terminal lovers.
119
+
120
+ ### Minimal — Pure Markdown
121
+ No emojis, no badges, no frills. Just clean, readable markdown.
122
+
123
+ ### Academic — Formal & Structured
124
+ Numbered sections, citation-style references, formal language. Great for research projects.
125
+
126
+ ```bash
127
+ # Use a specific theme
128
+ npx @malikasadjaved/readme-ai --theme modern
129
+ npx @malikasadjaved/readme-ai --theme hacker
130
+ npx @malikasadjaved/readme-ai --theme minimal
131
+ npx @malikasadjaved/readme-ai --theme academic
132
+ ```
133
+
134
+ > Want a custom theme? Use the [plugin system](#-plugins) to create your own!
135
+
136
+ ## AI Providers
137
+
138
+ ### Claude (Anthropic) Default
139
+
140
+ ```bash
141
+ export ANTHROPIC_API_KEY=sk-ant-...
142
+ npx @malikasadjaved/readme-ai
143
+ ```
144
+
145
+ ### GPT-4o-mini (OpenAI)
146
+
147
+ ```bash
148
+ export OPENAI_API_KEY=sk-...
149
+ npx @malikasadjaved/readme-ai --provider openai
150
+ ```
151
+
152
+ ### Gemini Flash (Google)
153
+
154
+ ```bash
155
+ export GEMINI_API_KEY=...
156
+ npx @malikasadjaved/readme-ai --provider gemini
157
+ ```
158
+
159
+ ### Ollama (Local, Free, Private)
160
+
161
+ ```bash
162
+ # Make sure Ollama is running locally
163
+ npx @malikasadjaved/readme-ai --provider ollama
164
+ npx @malikasadjaved/readme-ai --provider ollama --model llama3.1
165
+ ```
166
+
167
+ ## CLI Options
168
+
169
+ ```
170
+ Usage: readme-ai [repo] [options]
171
+
172
+ Arguments:
173
+ repo Local path or GitHub URL (github:user/repo)
174
+
175
+ Options:
176
+ -V, --version Output the version number
177
+ -o, --output <file> Output file path (default: "README.md")
178
+ -p, --provider <name> AI provider: anthropic | openai | gemini | ollama (default: "anthropic")
179
+ -m, --model <name> Model name (depends on provider)
180
+ -t, --theme <name> Theme: default | minimal | hacker | modern | academic (default: "default")
181
+ --no-diagram Skip Mermaid architecture diagram
182
+ --no-badges Skip badge generation
183
+ --no-api-docs Skip API documentation section
184
+ --interactive Run in interactive mode
185
+ --action Generate a GitHub Action for auto-updating README
186
+ --overwrite Overwrite existing README without asking
187
+ --dry-run Print README to stdout instead of writing to file
188
+ -h, --help Display help for command
189
+ ```
190
+
191
+ ### Examples
192
+
193
+ ```bash
194
+ # Generate with Modern theme using OpenAI
195
+ npx @malikasadjaved/readme-ai ./my-app --provider openai --theme modern
196
+
197
+ # Dry run (preview without writing)
198
+ npx @malikasadjaved/readme-ai --dry-run
199
+
200
+ # Generate without diagram and badges
201
+ npx @malikasadjaved/readme-ai --no-diagram --no-badges
202
+
203
+ # Overwrite existing README and generate GitHub Action
204
+ npx @malikasadjaved/readme-ai --overwrite --action
205
+
206
+ # Analyze a remote GitHub repository
207
+ npx @malikasadjaved/readme-ai github:tiangolo/fastapi --theme academic
208
+ ```
209
+
210
+ ## Plugins
211
+
212
+ readme-ai supports a **plugin system** for custom analyzers and themes. Plugins can add extra README sections, badges, or entirely new visual themes.
213
+
214
+ ```js
215
+ // readme-ai.config.js
216
+ export default {
217
+ plugins: [
218
+ './my-local-plugin.js', // local plugin file
219
+ 'readme-ai-plugin-example', // npm package
220
+ ],
221
+ };
222
+ ```
223
+
224
+ Packages named `readme-ai-plugin-*` in `node_modules` are auto-discovered. See [CONTRIBUTING.md](CONTRIBUTING.md#writing-plugins) for the full plugin authoring guide.
225
+
226
+ ### Plugin Example
227
+
228
+ ```ts
229
+ const myPlugin = {
230
+ name: 'my-plugin',
231
+ analyzers: [{
232
+ name: 'security-scanner',
233
+ analyze: async ({ scan, codeAnalysis, deps }) => ({
234
+ sections: { 'Security': 'No vulnerabilities found.' },
235
+ badges: [{ label: 'security', message: 'passing', color: 'green' }],
236
+ }),
237
+ }],
238
+ themes: [{
239
+ name: 'corporate',
240
+ render: (data) => `# ${data.projectName}\n\n${data.description}`,
241
+ }],
242
+ };
243
+ export default myPlugin;
244
+ ```
245
+
246
+ ## GitHub Action
247
+
248
+ Auto-regenerate your README on every push to main:
249
+
250
+ ```bash
251
+ # Generate the action file automatically
252
+ npx @malikasadjaved/readme-ai --action
253
+ ```
254
+
255
+ Or manually create `.github/workflows/readme-update.yml`:
256
+
257
+ ```yaml
258
+ name: Update README
259
+
260
+ on:
261
+ push:
262
+ branches: [main, master]
263
+ paths-ignore:
264
+ - 'README.md'
265
+
266
+ jobs:
267
+ update-readme:
268
+ runs-on: ubuntu-latest
269
+ permissions:
270
+ contents: write
271
+
272
+ steps:
273
+ - uses: actions/checkout@v4
274
+
275
+ - uses: actions/setup-node@v4
276
+ with:
277
+ node-version: '20'
278
+
279
+ - name: Generate README
280
+ run: npx @malikasadjaved/readme-ai@latest --overwrite --no-interactive
281
+ env:
282
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
283
+
284
+ - name: Commit updated README
285
+ uses: stefanzweifel/git-auto-commit-action@v5
286
+ with:
287
+ commit_message: 'docs: auto-update README [skip ci]'
288
+ file_pattern: README.md
289
+ ```
290
+
291
+ ## Supported Languages
292
+
293
+ | Language | Package Manager | Install | Build | Test |
294
+ |----------|----------------|---------|-------|------|
295
+ | **Node.js** | npm / yarn / pnpm | `npm install` | `npm run build` | `npm test` |
296
+ | **Python** | pip / pyproject | `pip install -r requirements.txt` | — | `pytest` |
297
+ | **Rust** | cargo | `cargo build --release` | `cargo build` | `cargo test` |
298
+ | **Go** | go modules | `go mod download` | `go build` | `go test ./...` |
299
+ | **Java (Gradle)** | gradle | `gradle build` | `gradle build` | `gradle test` |
300
+ | **Java (Maven)** | maven | `mvn install` | `mvn package` | `mvn test` |
301
+ | **Ruby** | bundler | `bundle install` | — | `bundle exec rspec` |
302
+ | **Swift** | Swift PM | `swift package resolve` | `swift build` | `swift test` |
303
+ | **Dart/Flutter** | pub | `dart pub get` | `dart compile` | `dart test` |
304
+
305
+ ## Architecture
306
+
307
+ ```mermaid
308
+ graph TD
309
+ A[CLI Input] --> B[Command Parser]
310
+ B --> C[Repo Fetcher]
311
+ C -->|Local Path| D[File Scanner]
312
+ C -->|GitHub URL| E[GitHub API]
313
+ E --> D
314
+ D --> F[Code Analyzer]
315
+ D --> G[Dependency Analyzer]
316
+ F --> H[AI Provider]
317
+ G --> H
318
+ H --> I[Section Generators]
319
+ I --> J[Theme Engine]
320
+ J --> K[Plugin System]
321
+ K --> L[Markdown Writer]
322
+ L --> M[README.md]
323
+ ```
324
+
325
+ ## Project Structure
326
+
327
+ ```
328
+ readme-ai/
329
+ ├── src/
330
+ │ ├── index.ts # CLI entry point
331
+ │ ├── cli.ts # Interactive mode
332
+ │ ├── config.ts # Configuration management
333
+ │ ├── commands/
334
+ │ │ └── generate.ts # Main generation pipeline
335
+ │ ├── analyzers/
336
+ │ │ ├── repo-fetcher.ts # Fetch from local or GitHub
337
+ │ │ ├── file-scanner.ts # Scan and categorize files
338
+ │ │ ├── code-analyzer.ts # Extract functions, endpoints, exports
339
+ │ │ ├── dependency-analyzer.ts # 10+ language support
340
+ │ │ ├── badge-generator.ts
341
+ │ │ └── diagram-builder.ts
342
+ │ ├── generators/
343
+ │ │ ├── overview.ts # Project summary + features
344
+ │ │ ├── install.ts # Install instructions
345
+ │ │ ├── usage.ts # Usage examples + API docs
346
+ │ │ ├── contributing.ts # Contributing guide
347
+ │ │ └── changelog.ts # Changelog section
348
+ │ ├── plugins/
349
+ │ │ └── index.ts # Plugin loader and registry
350
+ │ ├── providers/
351
+ │ │ ├── anthropic.ts # Claude
352
+ │ │ ├── openai.ts # GPT-4o
353
+ │ │ ├── gemini.ts # Gemini Flash
354
+ │ │ └── ollama.ts # Local Ollama
355
+ │ ├── themes/
356
+ │ │ ├── default.ts
357
+ │ │ ├── modern.ts
358
+ │ │ ├── hacker.ts
359
+ │ │ ├── minimal.ts
360
+ │ │ └── academic.ts
361
+ │ └── utils/
362
+ │ ├── file-utils.ts
363
+ │ ├── github-api.ts
364
+ │ ├── language-detector.ts
365
+ │ ├── markdown-writer.ts
366
+ │ ├── template-engine.ts
367
+ │ └── cache.ts
368
+ ├── tests/ # 186 tests (Vitest)
369
+ ├── CONTRIBUTING.md # Full contributor guide
370
+ ├── CHANGELOG.md
371
+ └── LICENSE
372
+ ```
373
+
374
+ ## Contributing
375
+
376
+ Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.
377
+
378
+ ```bash
379
+ git clone https://github.com/malikasadjaved/readme-ai.git
380
+ cd readme-ai
381
+ npm install
382
+ npm test # 186 tests
383
+ npm run dev # development mode
384
+ ```
385
+
386
+ Pre-commit hooks with Husky + lint-staged ensure code quality on every commit.
387
+
388
+ ## Star History
389
+
390
+ If you find readme-ai useful, please give it a star! It helps others discover the project.
391
+
392
+ ## License
393
+
394
+ [MIT](LICENSE) — use it freely in personal and commercial projects.
395
+
396
+ ---
397
+
398
+ <div align="center">
399
+
400
+ **Built by [Malik Asad Javed](https://github.com/malikasadjaved)**
401
+
402
+ **[readme-ai](https://github.com/malikasadjaved/readme-ai)** — the best AI README generator for developers
403
+
404
+ <sub>readme generator | ai documentation | markdown generator | github readme | developer tools | claude | openai | gemini | ollama | mermaid diagrams | open source</sub>
405
+
406
+ </div>