Auto-generate documentation from git changes using AI.
Shadow Docs watches your git repository and automatically generates documentation summaries whenever you make commits. It uses Google's Gemini AI to analyze code changes and create concise summaries.
- Initial Sync: Creates a baseline snapshot of your project state
- On Changes: Detects new commits and extracts the diff
- AI Analysis: Sends project structure + existing docs + new changes to Gemini
- Documentation: Generates and updates documentation based on changes
- State Tracking: Saves the current state for next sync
# Install dependencies
npm install
# Create .env file with your Gemini API key
echo "GOOGLE_GEMINI_API_KEY=your_key_here" > .env#
npm run build # Compile TypeScript
#To create strucutre run this command
npx tsx src/index.ts sync❌ Don't run sync with uncommitted changes - the tool will exit with an error
❌ Don't forget to set GOOGLE_GEMINI_API_KEY in .env
❌ Don't modify .shadow-lock file manually
❌ Don't run on non-git repositories
❌ Don't use without committing changes first
src/lib/ai.ts- Gemini API integration and prompt handlingsrc/lib/git.ts- Git command wrapper for diffs and project structuresrc/commands/sync.ts- Main sync logicsrc/utils/store.ts- Persistent state managementdocs/- Generated documentation
- ✅ Automatic documentation generation
- ✅ Maintains documentation history
- ✅ Lightweight state tracking
- ✅ Excludes node_modules and lock files
- ✅ Colored console output