An AI-powered CLI & Web tool that automatically explains codebases in plain English.
CodeNarrator aims to bridge the gap between complex code and developer understanding. Whether you're a beginner exploring a new open-source repo, a maintainer reviewing a PR, or an engineer returning to your own old code — CodeNarrator helps you understand any codebase faster and with less effort.
We believe every developer deserves a tool that makes codebases more readable and approachable.
- Explain entire codebases using AI
- CLI tool for use in terminal
- Recursive file scanner for JavaScript, TypeScript, Python, and more
- Outputs structured Markdown documentation
- Powered by Gemini or GPT-based AI models
- Planned GitHub PR integration to summarize changes
- VS Code plugin (planned)
| Layer | Technologies Used |
|---|---|
| CLI Tool | Node.js, Commander.js, Chalk |
| AI Integration | Gemini API (via Google SDK) |
| File Scanning | fs, glob |
| Markdown Generation | Markdown, fs-extra |
| Web UI (Planned) | React.js, Tailwind CSS |
| Automation (Planned) | GitHub Actions, Pre-push Hooks |
CodeNarrator/
├── bin/
│ └── cli.js # CLI entry point
├── src/
│ ├── analyzer.js # Scans code and sends to AI
│ ├── aiEngine.js # Communicates with AI API
│ ├── writer.js # Saves generated Markdown
├── test-models.js # Test script
├── .codenarratorrc.json # Optional config
├── .env # (Optional) Your Gemini API key
├── README.md
├── package.json
git clone https://github.com/your-username/CodeNarrator.git
cd CodeNarratornpm installecho "GEMINI_API_KEY=your-key" > .envNote: If no .env is found, CodeNarrator uses a built-in fallback key.
npm linkcodenarrator ./src --output ./docs --model=geminiA sample generated file (docs/utils-logger.md) might look like this:
File: utils/logger.js
Overview:
This file provides logging utilities for the application.
Functions:
- logInfo(msg): Logs informational messages
- logError(err): Logs errors with stack trace
Notes:
Uses 'chalk' for styled terminal output.
- Understand unfamiliar open-source projects
- Speed up PR reviews with inline documentation
- Assist students in grasping legacy or complex code
- Help new team members onboard quickly
| Version | Feature |
|---|---|
| 1.0 | CLI with basic AI documentation output |
| 1.1 | GitHub PR summarizer integration (planned) |
| 1.2 | Multi-language support: JS, Python, etc. (planned) |
| 1.3 | Web UI for drag-and-drop code analysis (planned) |
| 2.0 | VS Code extension with inline explanations |
| 2.1 | Team dashboard, history, authentication (planned) |
- Your code is sent to Gemini servers for analysis unless self-hosted.
- Avoid analyzing confidential or proprietary files.
- Configuration files like
.envare excluded from analysis.
We welcome contributions from all developers.
- Open issues and feature suggestions
- Participate in GitHub Discussions
- Look for
good first issuetags to get started
git checkout -b your-feature-branch
npm run dev
git commit -m "Add: your feature"CodeNarrator is licensed under the MIT License. You are free to use, modify, and distribute it.