Package Exports
- codeinsight-ai
- codeinsight-ai/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (codeinsight-ai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CodeInsight AI
A comprehensive CLI tool for AI researchers that analyzes repositories, generates documentation, and integrates with OpenAI API.
Features
- Repository Analysis: Extract and analyze code from a directory
- OpenAI Integration: Generate AI-powered documentation about repository architecture
- Multiple Documentation Types: Generate architecture docs, user stories, code stories, or custom analysis
- Markdown Output: All documentation is generated in markdown format for easy viewing and sharing
- Terminal Rendering: View documentation directly in your terminal with proper formatting
Installation
Global Installation
npm install -g codeinsight-ai
Local Installation
npm install codeinsight-ai
Usage
Analyze Repository
Extract and analyze code from a repository:
codeinsight analyze [directory] --output analysis.md --exclude dist,build
Options:
--output, -o
: Output file name (default: "repo_analysis.txt")--exclude, -x
: Additional exclusion pattern(s) (e.g., "dist,build")--max-size, -s
: Maximum file size in bytes to include--save
: Save analysis to server for future reference
Generate Documentation
Generate documentation from repository code using OpenAI:
# Generate architectural documentation
codeinsight generate-docs <repository_id> --type architecture
# Generate narrative code story with moderate complexity
codeinsight generate-docs <repository_id> --type code_story --complexity moderate
Options:
--type
: Type of documentation to generate (architecture, user_stories, code_story, custom)--complexity
: Complexity level for code stories (simple, moderate, detailed) - only used with type=code_story--prompt
: Custom prompt for documentation generation (required if type=custom)--api-key
: OpenAI API key (will use OPENAI_API_KEY environment variable if not provided)
List Repositories
List all analyzed repositories:
codeinsight list-repos
List Documentation
List all documentation generated for a repository:
codeinsight list-docs <repository_id>
View Document
View a specific document in the terminal or save as markdown:
codeinsight view-doc <document_id> --format terminal
Options:
--format
: Output format: "terminal" or "markdown" (default: "terminal")
Code Story Feature
The Code Story feature transforms complex code structures into narrative explanations using OpenAI's language models. It helps developers and researchers understand intricate code by creating engaging stories that explain:
- Design Decisions: Why code is structured a certain way
- Logic Flow: How data and control flow through the system
- Complex Algorithms: Detailed explanations using metaphors and analogies
- Architecture Patterns: The reasoning behind architectural choices
Choose from three complexity levels:
- Simple: Beginner-friendly explanations focusing on high-level concepts
- Moderate: Balanced technical details with narrative storytelling
- Detailed: In-depth explanations for experienced developers
Example usage:
codeinsight generate-docs 1 --type code_story --complexity simple
Environment Variables
OPENAI_API_KEY
: Your OpenAI API key
License
MIT