AI-powered documentation that stays current with your code
Automatically generates and maintains comprehensive documentation for your codebase using Pi's AI capabilities.
Based on OpenWiki by LangChain - adapted as a Pi coding agent extension.
# Install from npm
pi install npm:pi-openwiki
# Generate docs
cd your-project
pi
/openwiki:init
# Update after code changes
/openwiki:update
# Ask questions
/openwiki:chat How does authentication work?After running /openwiki:init:
openwiki/
├── quickstart.md # Start here
├── architecture/ # System design
├── workflows/ # Development processes
├── domain/ # Business logic
├── operations/ # Deployment
└── testing/ # Test strategies
- 🤖 AI-Generated - Leverages your Pi model to understand your codebase
- 🔄 Git-Aware - Updates only what changed
- 🎯 Agent-Optimized - Works for humans and AI agents
- ⚡ Smart - Prevents redundant regeneration
Generate initial documentation for your repository.
Update docs based on git changes since last run.
Ask questions about your codebase without modifying docs.
# Global (use everywhere)
pi install npm:pi-openwiki
# Project-specific
pi install -l npm:pi-openwiki
# From GitHub
pi install git:github.com/barvhaim/pi-openwiki
# Temporary (this session only)
pi -e git:github.com/barvhaim/pi-openwiki
# Local development
pi -e /path/to/pi-openwiki- Discovery - Explores your repository structure and git history
- Analysis - Understands the "why" behind your code
- Generation - Creates structured markdown documentation
- Tracking - Saves metadata for smart incremental updates
- Integration - Updates
AGENTS.md/CLAUDE.mdautomatically
- Pi >= 0.80.0
- Git repository
- Node.js with TypeScript
This package is prepared for the Pi package gallery. It is ready to publish as pi-openwiki and declares the required Pi package metadata:
{
"keywords": ["pi-package"],
"pi": {
"extensions": ["./extensions"]
}
}After publishing to npm, the package can be installed with:
pi install npm:pi-openwiki# Clone and install dependencies
git clone https://github.com/barvhaim/pi-openwiki.git
cd pi-openwiki
npm install
# Test locally
pi -e .
# Make changes and reload
/reloadModular design for maintainability:
extensions/openwiki/
├── commands.ts # Command handlers
├── tools.ts # AI tools
├── events.ts # Event handlers
├── git-utils.ts # Git operations
├── metadata.ts # Metadata management
├── prompts.ts # System prompts
└── constants.ts # Constants & types
See extensions/openwiki/README.md for details.
"Not in a git repository!"
Initialize git: git init && git add . && git commit -m "init"
Commands not showing up?
Reload Pi: /reload
"No changes detected"
Normal - means your code hasn't changed since last update.
MIT
This Pi extension is based on OpenWiki by LangChain AI, adapted for the Pi coding agent ecosystem.
Issues and PRs welcome at github.com/barvhaim/pi-openwiki