Skip to main content

Advanced AI Coding Assistant with Terminal Integration

Project description

AI Coder - Advanced AI Coding Assistant

PyPI version Python Version License: MIT

GitHub Repository GitHub Issues GitHub Stars GitHub Forks

โœจ Currently available on TestPyPI - Production PyPI release coming soon! โœจ


๐Ÿš€ CodeDev is an advanced open-source AI-powered coding assistant with terminal integration, personally crafted with โค๏ธ by Ashok Kumar.

โœจ Features

  • Conversational AI Interface: Natural language interaction with your codebase
  • Workspace Context: Automatically understands your project structure
  • File Operations: Read, write, and edit files with AI assistance
  • Code Analysis: Comprehensive codebase analysis and optimization suggestions
  • Shell Integration: Execute commands and see results in context
  • Real-time Streaming: Live AI responses as they're generated
  • MCP Server Mode: JSON-over-stdio protocol for integration with other tools

๐Ÿ› ๏ธ Prerequisites

  1. Ollama installed and running
  2. DeepSeek R1 8B model downloaded

Quick Setup

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Start Ollama and get DeepSeek model  
ollama serve
ollama pull deepseek-r1:8b

2. Install Dependencies

pip install httpx

3. Run CodeDev

# Easy way
./start.sh

# Or directly
python3 codedev.py

# Test everything works
python3 test.py

๐Ÿ’ก Usage Examples

๐Ÿš€ codedev> help                               # Show all commands
๐Ÿš€ codedev> analyze                            # Analyze your codebase
๐Ÿš€ codedev> files                              # List files
๐Ÿš€ codedev> read main.py                       # Read file
๐Ÿš€ codedev> ask "How can I optimize this?"     # Ask AI questions
๐Ÿš€ codedev> run python test.py                # Execute commands
๐Ÿš€ codedev> create hello.py                   # Create new file

๐ŸŽฏ What It Can Do

  • Code Analysis: Understand your entire codebase
  • AI Chat: Ask questions about your code naturally
  • File Operations: Read, create, edit files with AI help
  • Bug Detection: Find and fix issues automatically
  • Code Review: Get optimization suggestions
  • Shell Integration: Run commands with AI context

๐Ÿ”ง Available Commands

Command Description
help Show all commands
analyze Analyze entire codebase
files [dir] List files in directory
read <file> Read and display file
create <file> Create new file interactively
run <command> Execute shell command
ask "<question>" Ask AI anything
exit Exit CodeDev

๐Ÿค– AI Examples

๐Ÿš€ codedev> ask "Find security vulnerabilities in my code"
๐Ÿš€ codedev> ask "Write unit tests for the User class"  
๐Ÿš€ codedev> ask "Explain how this algorithm works"
๐Ÿš€ codedev> ask "Optimize this database query"
๐Ÿš€ codedev> ask "Add error handling to this function"

๐Ÿ”Œ MCP Server Mode

For integration with other tools:

python3 server.py

# Send JSON commands:
{"id":"1","tool":"fs.list","input":{"dir":"."}}
{"id":"2","tool":"ollama.chat","input":{"prompt":"Hello","model":"deepseek-r1:8b"}}

๐Ÿ’– Support My Work

If you find CodeDev helpful and want to support my open-source journey, consider buying me a coffee! Your support helps me continue developing amazing tools for the developer community.

Buy Me A Coffee Support via Razorpay

๐ŸŒŸ Every contribution, no matter how small, means the world to me and keeps this project alive!

๐Ÿ”— Links & Resources

๐ŸŽฏ Open Source & Community

CodeDev is completely open source and free to use! This project is my passion and I've put countless hours into making it the best AI coding assistant for developers like you.

๐Ÿค How You Can Help

  • โญ Star us on GitHub: github.com/ashokumar06/codedev - It really motivates me!
  • ๐Ÿด Fork the project: Create your own improvements and innovations
  • ๐Ÿ› Report bugs: Help me improve the software quality
  • ๐Ÿ’ก Suggest features: Share your brilliant ideas with me
  • ๐Ÿค Contribute code: Submit pull requests and be part of the journey
  • ๐Ÿ’– Support financially: Buy me a coffee or support via Razorpay

Personal Note: As an indie developer, your support and feedback mean everything to me. Every star, contribution, and coffee helps me dedicate more time to making CodeDev better! ๐Ÿš€


๐Ÿš€ Installation Options

Option 1: Install from PyPI (Recommended)

# Install the latest stable version
pip install codedev

# Use the commands
codedev --version
cdev --version

# Start using
codedev

Option 2: Install from GitHub (Latest)

# Install directly from GitHub
pip install git+https://github.com/ashokumar06/codedev.git

# Or clone and install
git clone https://github.com/ashokumar06/codedev.git
cd codedev
pip install .

Option 3: Build from Source (Development)

# Clone the repository
git clone https://github.com/ashokumar06/codedev.git
cd codedev

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

# Test installation
codedev --version
cdev --version

Option 4: Direct Build and Install

# Clone and build wheel
git clone https://github.com/ashokumar06/codedev.git
cd codedev

# Install build tools
pip install build

# Build the package
python -m build

# Install the wheel
pip install dist/codedev-*.whl

โœจ Key Features

๐Ÿš€ Smart Initialization

  • Automatic Ollama Detection: Checks for Ollama installation on startup
  • One-Click Linux Installation: Auto-installs Ollama using curl -fsSL https://ollama.com/install.sh | sh
  • Cross-Platform Support: Detects Linux, macOS, and Windows with appropriate instructions
  • Model Auto-Selection: Automatically selects the best available coding model
  • Health Checks: Verifies AI service connectivity before starting

๐Ÿง  AI-Powered Development

  • Natural Language Interface: Talk naturally - "create a web server", "fix this error"
  • Context-Aware Responses: Understands your project structure and coding patterns
  • Multiple AI Models: Support for DeepSeek, Codellama, Qwen2.5-Coder, Llama3.2, and more
  • Smart Model Management: Auto-detects and recommends optimal models for coding tasks
  • Improved Timeout Handling: Better stability with slow AI responses

๐Ÿ“ Advanced File Management

  • File Operations: Create, edit, refactor, move, copy, delete with full history
  • Project Management: Generate complete projects with templates and AI assistance
  • Version Control: Built-in undo/redo with automatic file versioning
  • Smart File Detection: Auto-detects languages and applies appropriate coding standards

๐Ÿ’ฌ Enhanced Natural Language Processing

  • File References: Use @filename to reference specific files
  • Todo/Comments: Add notes with # todo add authentication
  • Conversational Commands: Casual interactions like "hi", "thanks", "what files do I have?"
  • Context Understanding: Remembers previous conversations and file states

๐Ÿ›ก๏ธ Safety & Security

  • Safe Command Execution: Whitelisted commands with sandboxing
  • Path Protection: Prevents access to system directories
  • File Size Limits: Configurable limits for file operations
  • Backup Creation: Automatic backups before destructive operations

๐ŸŽจ Rich Terminal Experience

  • Beautiful UI: Rich terminal interface with colors, tables, and panels
  • Smart Completion: Auto-complete for commands and file names
  • History Management: Persistent command history across sessions
  • Interactive Prompts: Intuitive prompts with context information

๐Ÿ”ง Setup & Usage

Quick Start

  1. Install CodeDev:

    pip install codedev
    
  2. Start using:

    codedev                   # Start in current directory
    cdev                      # Short command
    
  3. AI will auto-setup Ollama (Linux) or guide you through manual installation

Usage Examples

Natural Language Commands

codedev> create a web server
codedev> fix @app.py
codedev> show my files  
codedev> # todo add authentication
codedev> refactor this code to use classes

Structured Commands

codedev> create server.py python "FastAPI web server with JWT auth"
codedev> edit @app.py python "add error handling"
codedev> models                    # Show available AI models
codedev> model deepseek-coder:6.7b # Switch to different model
codedev> help                      # Show all commands

Project Operations

codedev> create-project python myapi "REST API with FastAPI"
codedev> analyze-project
codedev> refactor-project "add type hints everywhere"

๐Ÿค– Model Management

The AI Coder automatically detects and manages AI models:

Automatic Model Selection

The system prioritizes models in this order:

  1. DeepSeek R1: deepseek-r1:8b, deepseek-r1:1.5b
  2. DeepSeek Coder: deepseek-coder:6.7b, deepseek-coder:1.3b
  3. Llama 3.2: llama3.2:8b, llama3.2:3b, llama3.2:1b
  4. Qwen2.5 Coder: qwen2.5-coder:7b, qwen2.5-coder:3b
  5. CodeLlama: codellama:7b, codellama:13b
  6. Phi3: phi3:3.8b, phi3:mini

Model Commands

ai-coder> models                    # Show detailed model information
ai-coder> model llama3.2:8b        # Switch to specific model
ai-coder> ollama pull deepseek-r1:8b # Install new model

โš™๏ธ Configuration

Config File Location

  • Linux/macOS: ~/.config/ai-coder/config.yaml
  • Windows: %APPDATA%/ai-coder/config.yaml

Key Settings

ai:
  api_url: "http://127.0.0.1:11434"
  model: "deepseek-r1:8b"
  timeout: 120
  max_retries: 5
  temperature: 0.7

workspace:
  directory: "."
  history_dir: ".ai-coder-history"
  auto_save: true
  backup_on_edit: true

safety:
  allowed_commands: ["python", "node", "git", ...]
  blocked_paths: ["/etc", "/usr", "~/.ssh", ...]
  max_file_size: 10485760  # 10MB

๐ŸŒ Platform Support

Platform Installation Status
Linux โœ… Automatic Fully Supported
macOS ๐Ÿ“‹ Manual Supported
Windows ๐Ÿ“‹ Manual Supported

Linux

  • Auto-installs Ollama using official installer
  • Auto-starts service via systemctl or direct command
  • Full feature support

macOS & Windows

๐Ÿ” Troubleshooting

Common Issues

Ollama Not Found

# Linux: AI Coder will offer to install automatically
# macOS/Windows: Download from https://ollama.com/download

Connection Timeout

# Check if Ollama is running
ollama serve

# Check service status (Linux)
systemctl status ollama

No Models Available

# AI Coder will automatically suggest and install recommended models
# Or manually: ollama pull deepseek-r1:8b

๐Ÿ“š Advanced Features

File Versioning

  • Every edit creates a timestamped backup
  • Full undo/redo history per file
  • Restore to any previous version

Smart Context

  • Understands project structure
  • Maintains conversation history
  • Learns from your coding patterns

Cross-Platform CLI

  • Works identically on Linux, macOS, Windows
  • Rich terminal UI with colors and formatting
  • Intelligent error handling and recovery

๐Ÿค Contributing

We welcome contributions from the community! CodeDev is open source and thrives on community involvement.

Ways to Contribute

  1. โญ Star the Repository: Show your support on GitHub
  2. ๐Ÿ› Report Bugs: Submit issues on GitHub Issues
  3. ๐Ÿ’ก Feature Requests: Suggest new features via GitHub Discussions
  4. ๐Ÿ“– Documentation: Improve docs and examples
  5. ๐Ÿ”ง Code Contributions: Submit pull requests

Development Setup

# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/codedev.git
cd codedev

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt
pip install -e .

# Run tests
python test_installation.py

# Make your changes and submit a pull request!

Project Structure

codedev/
โ”œโ”€โ”€ ai_coder/           # Main package
โ”‚   โ”œโ”€โ”€ ai/            # AI client and prompt management
โ”‚   โ”œโ”€โ”€ core/          # Configuration and core utilities  
โ”‚   โ”œโ”€โ”€ operations/    # File and project operations
โ”‚   โ”œโ”€โ”€ safety/        # Security and sandboxing
โ”‚   โ”œโ”€โ”€ utils/         # Utilities and platform detection
โ”‚   โ””โ”€โ”€ cli.py         # Main CLI interface
โ”œโ”€โ”€ config/            # Default configuration
โ”œโ”€โ”€ tests/             # Test suite
โ”œโ”€โ”€ .github/           # GitHub workflows
โ””โ”€โ”€ setup.py           # Package configuration

๐Ÿ“„ License

CodeDev is released under the MIT License - see LICENSE file for details.

This means you can:

  • โœ… Use it commercially
  • โœ… Modify and distribute
  • โœ… Private use
  • โœ… Include in your projects

๏ฟฝ Support the Project

If you find CodeDev useful, please consider:

  • โญ Starring the repository on GitHub
  • ๐Ÿ› Reporting bugs and suggesting features
  • ๐Ÿค Contributing code or documentation
  • ๐Ÿ’ฌ Sharing it with other developers

๐ŸŽฏ Get Started Now!

# Install and start using immediately
pip install codedev
codedev

# Or build from source
git clone https://github.com/ashokumar06/codedev.git
cd codedev && pip install -e .
codedev --version

Ready to revolutionize your coding workflow with AI? ๐Ÿš€


Made with โค๏ธ and countless cups of coffee by Ashok Kumar

Buy Me A Coffee Support via Razorpay

GitHub โ€ข PyPI โ€ข Issues โ€ข Discussions

Connect with me for collaboration, feedback, and let's build something amazing together! ๐Ÿค

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codedev-3.0.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codedev-3.0.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file codedev-3.0.0.tar.gz.

File metadata

  • Download URL: codedev-3.0.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for codedev-3.0.0.tar.gz
Algorithm Hash digest
SHA256 3e6cd3eb705ebbea4c3589e3f6fed63929489a2529cd16780c2e4da8c149608b
MD5 06fd96fec043e3660160b0b794cc1b17
BLAKE2b-256 fcbe4171f0ef79152bff8c358cbc6bcc0feffb232c97baa2097259f363b5425d

See more details on using hashes here.

File details

Details for the file codedev-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: codedev-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for codedev-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5727072149f0813f7fb3b8cea2d56eb27949f5aa8fbe207f66afa4f012b8606
MD5 0ec9a44bfcf4969ebd0447eb1c66555e
BLAKE2b-256 972daf53526e71fe12552cecb61d3952486dc8a6e54e8907547dfd7ec9e67c7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page