An intelligent development assistant that helps with daily development tasks through AI-powered analysis and automation.
The core component that scans and indexes your project structure, providing comprehensive metadata for all other services.
Key Capabilities:
- Multi-language Support: Detects 20+ programming languages
- Smart File Filtering: Respects
.gitignorerules and common ignore patterns - Dependency Detection: Automatically parses
requirements.txt,pyproject.toml,package.json, andpubspec.yaml - Framework Detection: Identifies Django, Flask, FastAPI, React, Next.js, Flutter, and more
- Git Integration: Captures recent commits, current branch, and remote URL
- AI Context Generation: Optional LLM-generated context for each file (using Ollama)
- Index Validation: Automatically detects when indexes become stale
- Progress Tracking: Visual progress bars for large indexing operations
- Code Review: AI-powered code analysis and suggestions
- Commit Generator: Intelligent commit message generation
- Test Generator: Automated test case generation
- Documentation Generator: AI-generated documentation
- Clone the repository:
git clone <repository-url>
cd AI_Dev_Mate- Install dependencies:
pip install -r requirements.txt- Set up environment variables (optional):
cp .env.example .env
# Edit .env with your configuration# List all available tasks
python -m src.main --list
# Index a repository
python -m src.main --index /path/to/repo
# Index with AI context generation (slower but more detailed)
python -m src.main --index /path/to/repo --with-context
# Run a specific task
python -m src.main --run code_review
python -m src.main --run commit_generator
python -m src.main --run test_generator
python -m src.main --run doc_generator# Check if index exists and is valid
python -m src.main --check-index /path/to/repo
# Force refresh stale indexes when running tasks
python -m src.main --run code_review --force-refresh
# Disable progress bars (useful for CI/CD)
python -m src.main --index /path/to/repo --no-progressThe system automatically detects when indexes become stale by:
- Checking file modification times against index creation time
- Validating index format version compatibility
- Detecting when files are added or removed
When an index is stale, you'll see a warning like:
WARNING: Index is stale (created: 2024-01-15 10:30:00). Use --force-refresh to update it.
Create a .env file in the project root:
# Ollama Configuration
OLLAMA_MODEL=codellama:7b
OLLAMA_HOST=http://localhost:11434
OLLAMA_TIMEOUT=120
# AI Generation Settings
MAX_TOKENS=1000
TEMPERATURE=0.3
# Git Settings
GIT_DEFAULT_BRANCH=main
# Logging
LOG_LEVEL=INFOIndexes are stored in .aidm_index/index.json within each repository. This location is:
- Automatically ignored by git (via
.gitignorepatterns) - Portable across different machines
- Version-controlled for index format compatibility
BaseTask: Abstract base class for all AI Dev Mate tasksRepoIndexer: Core indexing service with comprehensive project analysisFileService: Enhanced file operations with robust error handlingGitService: Git integration with timeout and error handlingOllamaService: AI model integration for context generation
The system includes comprehensive error handling with custom exceptions:
FileServiceError: File operation failuresGitServiceError: Git command failuresIndexError: Indexing operation failuresOllamaServiceError: AI service failuresTaskError: General task execution failures
- Progress Indicators: Visual feedback for long-running operations
- Parallel Processing: Efficient file scanning and processing
- Smart Caching: Index validation prevents unnecessary re-indexing
- Size Limits: Prevents indexing of extremely large files
- Timeout Handling: Prevents hanging on slow operations
# Run the improvement test suite
python test_improvements.py
# Run specific tests
python -m pytest tests/- Create a new task class inheriting from
BaseTask - Implement
run()andsummarize()methods - Register the task in
src/main.py - Add appropriate error handling and progress indicators
- Fork the repository
- Create a feature branch
- Make your changes with proper error handling
- Add tests for new functionality
- Submit a pull request
"No index found" error:
# Create an index first
python -m src.main --index ."Index is stale" warning:
# Refresh the index
python -m src.main --run your_task --force-refreshGit errors:
- Ensure git is installed and accessible
- Check that the directory is a valid git repository
- Verify git permissions
Ollama connection issues:
- Ensure Ollama is running:
ollama serve - Check the
OLLAMA_HOSTenvironment variable - Verify the model is available:
ollama list
- Use
--no-progressin CI/CD environments - Avoid
--with-contextfor large repositories unless needed - Use
--force-refreshsparingly; the system auto-detects stale indexes - Consider indexing only specific subdirectories for very large projects
[Add your license information here]
- β Enhanced error handling with custom exceptions
- β Index validation and refresh mechanisms
- β Progress indicators for better UX
- β Force refresh capabilities
- β Comprehensive CLI improvements
- β Better git integration with timeout handling
- β Robust file service with proper error handling
- β Index format versioning for compatibility