next-ai-wiki
v1.0.1
Published
A CLI tool that watches your Next.js source files and auto-generates Markdown documentation using Google's ADK (Agent Development Kit) and Gemini AI.
Maintainers
Readme
next-ai-wiki
A CLI tool that scans your entire project holistically and auto-generates structured, wiki-style documentation using your choice of AI provider — Google Gemini, OpenAI, or Anthropic Claude.
Built for Next.js projects. Creates a self-contained wiki at /wiki in your app directory — inspired by Google CodeWiki.
✨ Features
- 🧠 Holistic Analysis — AI reads your entire codebase in one pass, not file-by-file
- 🤖 Multi-Provider — Choose between Gemini, OpenAI, or Anthropic Claude
- 📂 Smart Grouping — Docs organized into logical categories & sections
- 🏠 AI Welcome Page — Generates a project overview with tech stack, features, and getting started
- 📚 Zero-Config Wiki — Scaffolds a full wiki system at
/wikiwith sidebar navigation - ⚡ Smart Watcher — File changes trigger only the affected section to regenerate
- 🌙 Dark Mode — Built-in dark mode support
- ⚙️ Configurable — Whitelist folders, customize ignores, choose your model
🚀 Quick Start
1. Install
npm install -g next-ai-wiki2. Configure (Required)
next-ai-wiki configThis creates next-ai-wiki.config.ts where you set your provider and API key.
3. Initialize
next-ai-wiki initThis will:
- Detect your
app/directory - Install markdown rendering packages
- Scaffold the wiki at
app/wiki/ - Analyze your entire project with AI
- Generate a Welcome Page + categorized documentation sections
4. Watch for Changes
next-ai-wiki watchAny source code change will re-analyze only the affected section.
5. View Your Wiki
npm run devVisit http://localhost:3000/wiki.
🤖 AI Providers
| Provider | Default Model | Free Tier | Env Var |
|----------|--------------|-----------|---------|
| gemini (default) | gemini-3-flash-preview | ✅ Yes | GOOGLE_API_KEY |
| openai | gpt-5.1 | ✅ Check pricing | OPENAI_API_KEY |
| anthropic | claude-haiku-4-5 | ⚠️ Prepaid | ANTHROPIC_API_KEY |
Get your API keys:
- Gemini (free): aistudio.google.com/apikey
- OpenAI: platform.openai.com/api-keys
- Anthropic: console.anthropic.com
⚙️ Configuration
Example: next-ai-wiki.config.ts
import type { WikiConfig } from 'next-ai-wiki';
const config: WikiConfig = {
// AI Provider: 'gemini' | 'openai' | 'anthropic'
provider: 'gemini',
// API Key — prefer environment variables for security
apiKey: process.env.GOOGLE_API_KEY,
// Model (optional — defaults are set per provider)
model: 'gemini-3-flash-preview',
// Whitelist specific folders (leave empty to scan everything)
include: ['src/components'],
// Additional folders to ignore
ignore: ['scripts', 'cypress'],
};
export default config;Switching to OpenAI:
const config: WikiConfig = {
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-5.1', // or 'gpt-4o'
};Switching to Anthropic:
const config: WikiConfig = {
provider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-haiku-4-5', // or 'claude-sonnet-4-5'
};Ignored by default: node_modules, .next, dist, .git, public, config files, lock files.
📁 Output Structure
app/wiki/
├── layout.tsx ← Wiki shell (Sidebar + Main)
├── page.tsx ← Welcome page (renders welcome.md)
├── wiki.css ← Styles (Dark mode supported)
├── lib.ts ← Navigation tree helper
├── structure.json ← Sidebar structure (grouped categories)
├── [...slug]/
│ └── page.tsx ← Renders section .md files
└── docs/
├── welcome.md ← AI-generated project overview
├── api-routes.md ← Grouped documentation sections
├── ui-components.md
└── authentication.mdSidebar example:
📚 Documentation
🏠 Welcome
▼ UI Components
Blog Components
Navigation
▼ Backend
API Routes
Authentication
▼ Configuration
Environment & Config🤝 Contributing
Contributions are welcome!
- Fork & Clone
- Create branch
- Commit changes
- Push & PR
📄 License
MIT License.
👤 Author
Muhammad Asim
- GitHub: @iammuhammadasimofficial
- Email: [email protected]
