codeplot
v3.1.0
Published
Interactive CLI tool for feature planning and ADR generation using Gemini 2.5 Pro
Maintainers
Readme
Codeplot
🧠 Plot your features with AI-powered planning and architecture decisions
An interactive CLI tool that uses Google Gemini AI to help you plan features and generate Architecture Decision Records (ADRs) for your projects. Get AI-powered technical guidance, implementation plans, and properly structured ADRs without leaving your terminal.
Features
- 📦 Repository Analysis: Uses repomix to pack your codebase for AI analysis
- 🤖 Interactive Planning: AI-driven conversation to gather feature requirements
- 📝 ADR Generation: Automatically creates Architecture Decision Records
- 🎯 One Question at a Time: Focused, clarifying questions with options and recommendations
- 🏗️ Implementation Plans: Step-by-step technical implementation guidance
- 💾 Session Management: Save, resume, and modify planning sessions with persistent state
- ⚡ Real-time Streaming: Watch AI responses appear in real-time with configurable typing speeds
- 🎨 Enhanced UX: Beautiful visual indicators and smooth typing animations
Prerequisites
- Node.js (>=20.0.0) - This project uses Volta for Node.js version management
- Gemini API Key - Get one from Google AI Studio
- repomix (optional - will be installed automatically if missing)
- adr-tools (optional - for proper ADR management)
- Volta (recommended) - For automatic Node.js version management
Installation
Global Installation (Recommended)
Install Codeplot globally using npm:
npm install -g codeplotUsing npx (No Installation Required)
Run Codeplot without installing:
npx codeplot init
npx codeplot plan --project-path /path/to/your/projectAPI Key Setup
Set your Gemini API key as an environment variable:
export GEMINI_API_KEY="your_api_key_here"
# Or add to your shell profile for persistence
echo 'export GEMINI_API_KEY="your_api_key_here"' >> ~/.bashrc
# or ~/.zshrc for zsh usersDependencies
Codeplot will automatically install missing dependencies:
- repomix: For repository analysis (installed automatically if missing)
- adr-tools: For proper ADR management (optional, see installation guide)
# Optional: Install adr-tools for enhanced ADR management
npm install -g adr-tools
# or on macOS with Homebrew
brew install adr-toolsUsage
Initialize the CLI
codeplot initPlan a Feature
# Default with streaming enabled (uses gemini-2.5-pro)
codeplot plan --project-path /path/to/your/project
# Use a different model
codeplot plan --model gemini-2.0-flash-exp
# Fast typing speed
codeplot plan --typing-speed fast
# Disable streaming (instant responses)
codeplot plan --no-streaming
# Slow typing speed for presentation mode
codeplot plan --typing-speed slowSession Management
Codeplot automatically saves your planning sessions and allows you to resume or modify them:
# Sessions are automatically saved during planning
codeplot plan
# When you have completed sessions, you'll be prompted with options:
# 1. Start a new planning session
# 2. Review current ADR
# 3. Modify/refine current ADR
# 4. ExitSession Features:
- Auto-save: Every interaction is automatically saved
- Resume: Continue where you left off if interrupted
- Modify: Refine existing ADRs through additional conversations
- Review: Read completed ADRs before making changes
- Interactive Loop: Seamlessly transition between reviewing and modifying
Options
-p, --project-path <path>: Path to your project repository (default: current directory)-k, --api-key <key>: Gemini API key (or set GEMINI_API_KEY env var)-m, --model <model>: Gemini model to use (default: gemini-2.5-pro, or set GEMINI_MODEL env var)-o, --output-dir <dir>: Output directory for ADRs (default: ./doc/adr)--no-streaming: Disable streaming responses (show all at once)--typing-speed <speed>: Typing speed for streaming:fast,normal,slow(default: normal)
Available Models
You can specify different Gemini models based on your needs:
gemini-2.5-pro(default) - Latest and most capable model, best for complex planninggemini-2.0-flash-exp- Faster experimental model, good for quick interactionsgemini-1.5-pro- Previous generation, reliable and well-testedgemini-1.5-flash- Optimized for speed and efficiency
# Use via CLI flag
codeplot plan --model gemini-2.0-flash-exp
# Or set environment variable
export GEMINI_MODEL="gemini-2.0-flash-exp"
codeplot planHow It Works
- Repository Packing: The tool uses repomix to create a comprehensive view of your codebase
- AI Analysis: Gemini 2.5 Pro analyzes your codebase structure and technologies
- Interactive Planning: The AI asks focused questions to understand your feature requirements
- ADR Generation: Creates a structured Architecture Decision Record with implementation plan
Example Session
$ codeplot plan
📊 Codeplot
AI-powered feature planning and architecture decisions
📦 Step 1: Packing repository with repomix...
✅ Repository packed successfully
🤖 Step 2: Initializing AI with codebase analysis...
✅ AI initialized and ready
🤖 AI Analysis:
I can see this is a Node.js project using Express.js with a typical MVC structure...
💬 Step 3: Interactive feature planning session
? What feature would you like to build? User authentication system
🤖 AI:
I understand you want to build a user authentication system. Let me ask some clarifying questions:
What type of authentication would you prefer?
1. JWT-based authentication (recommended for APIs)
2. Session-based authentication (traditional web apps)
3. OAuth integration (Google, GitHub, etc.)
My recommendation: JWT-based authentication as it fits well with your existing API structure.
? Your response: JWT-based authentication
🤖 AI:
Great choice! Now, what user information do you need to store?
1. Basic (email, password)
2. Profile data (name, avatar, preferences)
3. Role-based access control
? Your response: Basic email and password with role-based access
...
📝 Step 4: Generating Architecture Decision Record...
✅ ADR generated successfully
🎉 Feature planning completed!
ADR saved to: ./docs/adrs/2025-06-27-user-authentication-system.mdSystem Prompt
The AI uses a carefully crafted system prompt that focuses on:
- Software architecture and technical implementation
- One clarifying question at a time
- Providing options with recommendations
- Generating comprehensive ADRs with implementation plans
- Identifying trade-offs in implementation choices
Output Structure
Generated ADRs follow this structure:
- Status: Proposed/Accepted/Rejected
- Context: Background and motivation
- Decision: The architectural choice made
- Consequences: Trade-offs and implications
- Implementation Plan: Step-by-step technical plan
- Alternatives Considered: Other options and why they were rejected
Development
With Volta (Recommended)
This project uses Volta to pin Node.js and npm versions. When you enter the project directory, Volta will automatically switch to the correct versions (Node.js 22.17.0 LTS, npm 10.9.2).
Running in Development Mode
npm run devAvailable Scripts
npm run dev- Run with file watchingnpm run test- Run testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coveragenpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run validate- Run all checks (lint, format, test)
Troubleshooting
repomix not found
The tool will automatically install repomix if it's missing. If you encounter issues:
npm install -g repomixadr-tools not found
ADRs will still be generated without adr-tools, but for proper ADR management:
# npm
npm install -g adr-tools
# or macOS with Homebrew
brew install adr-toolsAPI Rate Limits
If you hit Gemini API rate limits, the tool will show appropriate error messages. Consider:
- Using shorter sessions
- Spreading usage over time
- Checking your API quota
License
MIT
