A CLI tool for quick summarization of JavaScript/TypeScript codebases. Get an instant overview of all files and their exported symbols.
☢️ This codebase was almost entirely generated by LLM agent. I expect there is may be some issues. This is more or less poor man's quick and hacky solution to code summarization.
# Analyze current directory
npx codebase-index .
# Analyze specific directory
npx codebase-index my-project
# Use the simplified command
npx mindex .
Example output:
🔍 Mini-Index: Analyzing /Users/jin/dev/mini-index/test-samples
- advanced_python.py: VERSION, DEBUG, CONFIG_PATH, StatusEnum, UserData, authenticate_user, get_user_profile, async_fetch_data, DatabaseManager, static_utility_function, process_data, outer_function, result
- api/
- route.ts: POST, GET
- components.jsx: ChatInterface, ErrorBoundary, Footer
- django_app.py: DEBUG, ALLOWED_HOSTS, DATABASE_URL, UserViewSet, ProductManager, dashboard_view, async_data_processor, calculate_price, format_currency
- sample.py: API_VERSION, DEBUG_MODE, get_user_data, process_payment, UserManager, PaymentProcessor
- types.ts: User, Message, DEFAULT_CONFIG, ChatState
- user.js: generateUserId, getCurrentUser, createUser, updateUserActivity
# Global installation
npm install -g codebase-index
# Or use directly with npx
npx codebase-index .
- 📁 Directory Analysis: Recursively scans JavaScript/TypeScript projects
- 🔍 Symbol Extraction: Finds all exported functions, classes, types, and interfaces
- 🎯 Multi-Format Support: JavaScript (ES6/CommonJS), TypeScript, JSX/React
- 🌳 Tree Output: Clean, readable file structure with exported symbols
- ⚡ Fast & Lightweight: Quick analysis of entire codebases
- 🛡️ Error Handling: Graceful handling of parsing errors
- Code Reviews: Get a quick overview of what a project exports
- Documentation: Generate file structure for documentation
- Onboarding: Help new developers understand codebase structure
- Refactoring: Identify unused exports and dependencies
- Architecture: Visualize project organization
🔍 Mini-Index: Analyzing /path/to/project
- api/
- route.ts: POST, GET
- components/
- ChatInterface.jsx: ChatInterface, ErrorBoundary
- Footer.jsx: Footer
- lib/
- types.ts: User, Message, ChatState
- utils.js: generateId, formatDate
- models/
- user.py: UserManager, get_user_data, authenticate_user
- user.js: getCurrentUser, createUser, updateUser
Format | Support Level | Features |
---|---|---|
JavaScript (ES6) | ✅ Full | Named/default exports, arrow functions |
JavaScript (CommonJS) | ✅ Full | module.exports, exports.* |
TypeScript | ✅ Enhanced | Interfaces, types, classes, functions |
JSX/React | ✅ Enhanced | Components, props detection |
Python | ✅ Enhanced | Functions, classes, variables (AST-based) |
JSON | ✅ Basic | File listing |
# Main commands
npx codebase-index [directory] # Full analysis
npx mindex [directory] # Simplified command
# Examples
npx mindex . # Current directory
npx mindex src # Src folder only
npx mindex ../other-project # Different project
const { EnhancedAnalyzer } = require('codebase-index');
const analyzer = new EnhancedAnalyzer();
const result = analyzer.analyzeProject('./my-project');
console.log(result);
Mini-index automatically skips common directories:
node_modules/
.git/
.next/
dist/
build/
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
MIT License - see LICENSE file for details.
Perfect for:
- Tech Leads reviewing code structure
- Developers exploring new codebases
- Documentation teams generating overviews
- Architects understanding project organization
- Anyone who needs a quick "what does this export?" answer
Get started in seconds: npx mindex .