Skip to content

PetrJoe/codx-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Codx - AI Coding Assistant

Version VS Code License

An intelligent AI-powered coding assistant for VS Code that uses Mistral AI via LangChain to boost developer productivity with a split-view interface.

โœจ Features

  • ๐Ÿค– Intelligent AI Chat: Built-in chat interface with Mistral AI in a split-view layout
  • ๐Ÿ“ Code Explanation: Get detailed explanations for selected code
  • ๐Ÿงช Test Generation: Auto-generate comprehensive unit tests
  • ๐Ÿ”ง Code Refactoring: Smart refactoring suggestions and improvements
  • ๐Ÿ’ก Comment to Code: Convert natural language comments to working code
  • ๐Ÿ” Quick Fix: Detect and fix errors with AI assistance
  • โšก Smart Completion: AI-powered code completion for comments and TODOs
  • ๐Ÿ“ฑ Split View: AI assistant positioned on the right side of your editor
  • ๐ŸŽฏ Context Awareness: Understands your current file, language, and selected code

๐Ÿš€ Installation

  1. Install from VS Code Marketplace
  2. Get your Mistral AI API key
  3. Configure the extension: Ctrl+Shift+P โ†’ "Preferences: Open Settings" โ†’ Search "Codx"
  4. Enter your Mistral AI API key

๐ŸŽฎ Usage

Quick Start

// Select this comment and press Ctrl+Alt+G to convert to code
// Function that calculates the factorial of a number recursively

// The AI will generate:
function factorial(n: number): number {
    if (n <= 1) return 1;
    return n * factorial(n - 1);
}

Available Commands

Command Shortcut Description
AI: Open Chat Ctrl+Alt+C Open AI chat in split view
AI: Explain Code Ctrl+Alt+E Explain selected code
AI: Generate Tests Ctrl+Alt+T Generate unit tests for current file
AI: Refactor Code Ctrl+Alt+R Get refactoring suggestions
AI: Convert to Code Ctrl+Alt+G Convert comments to working code
AI: Quick Fix Ctrl+Alt+F Detect and fix code issues
AI: Toggle Split View Ctrl+Alt+S Toggle AI assistant split view

Context Menu Options

Right-click on selected code to access:

  • Explain Code
  • Refactor Code
  • Generate Documentation
  • Generate Tests

โš™๏ธ Configuration

{
  "aiCodingAssistant.mistralApiKey": "your-mistral-api-key",
  "aiCodingAssistant.modelName": "mistral-medium",
  "aiCodingAssistant.splitViewEnabled": true,
  "aiCodingAssistant.enableAutocompletion": true,
  "aiCodingAssistant.completionDelay": 500,
  "aiCodingAssistant.maxTokens": 1000,
  "aiCodingAssistant.temperature": 0.7,
  "aiCodingAssistant.enableTelemetry": true
}

Configuration Options

Setting Default Description
mistralApiKey "" Your Mistral AI API key
modelName "mistral-medium" AI model to use (tiny/small/medium/large)
splitViewEnabled true Enable split view with AI on the right
enableAutocompletion true Enable AI-powered code completion
completionDelay 500 Delay before triggering completion (ms)
maxTokens 1000 Maximum tokens for AI responses
temperature 0.7 AI creativity level (0.0-1.0)
enableTelemetry true Help improve the extension

๐ŸŽฏ Supported Languages

  • TypeScript/JavaScript
  • Python
  • Java
  • C#
  • C/C++
  • Go
  • Rust
  • PHP
  • And more...

๐Ÿ”ง Development

Prerequisites

  • Node.js 18+
  • VS Code 1.85.0+
  • TypeScript

Setup

# Clone the repository
git clone https://github.com/PetrJoe/codx-v2.git
cd codx

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch for changes
npm run watch

Running the Extension

  1. Open the project in VS Code
  2. Press F5 to launch Extension Development Host
  3. Test the extension in the new VS Code window

Building

# Build for production
npm run build

# Package the extension
npm run package

# Publish to marketplace
npm run publish

๐Ÿ“‹ Commands Reference

Command Palette (Ctrl+Shift+P)

  • AI: Open Chat - Launch AI assistant in split view
  • AI: Explain Code - Explain selected code block
  • AI: Generate Tests - Create unit tests for current file
  • AI: Refactor Code - Get refactoring suggestions
  • AI: Convert to Code - Transform comments into code
  • AI: Quick Fix - Analyze and fix code issues
  • AI: Toggle Split View - Show/hide AI assistant panel

Keyboard Shortcuts

Windows/Linux macOS Command
Ctrl+Alt+C Cmd+Alt+C Open AI Chat
Ctrl+Alt+E Cmd+Alt+E Explain Code
Ctrl+Alt+T Cmd+Alt+T Generate Tests
Ctrl+Alt+R Cmd+Alt+R Refactor Code
Ctrl+Alt+G Cmd+Alt+G Convert to Code
Ctrl+Alt+F Cmd+Alt+F Quick Fix
Ctrl+Alt+S Cmd+Alt+S Toggle Split View

๐ŸŽจ Interface

The extension provides a clean, intuitive interface with:

  • Split View Layout: AI assistant on the right, code editor on the left
  • Chat Interface: Interactive chat with syntax highlighting
  • Code Insertion: One-click code insertion from AI responses
  • Progress Indicators: Visual feedback for AI operations
  • Context Awareness: Automatic detection of file type and selected code

๐Ÿ”’ Privacy & Security

  • Your code is sent to Mistral AI for processing
  • API key is stored securely in VS Code settings
  • No code is stored permanently by the extension
  • Telemetry can be disabled in settings

๐Ÿ› Troubleshooting

Common Issues

AI not responding?

  • Check your Mistral AI API key in settings
  • Verify internet connection
  • Check VS Code Developer Console for errors

Split view not working?

  • Enable split view in settings: aiCodingAssistant.splitViewEnabled
  • Try toggling split view: Ctrl+Alt+S

Code completion not working?

  • Enable autocompletion: aiCodingAssistant.enableAutocompletion
  • Try typing comments with // or TODO:

๐Ÿ“ˆ Changelog

Version 1.0.0

  • โœจ Initial release with split-view AI assistant
  • ๐Ÿค– Mistral AI integration via LangChain
  • ๐Ÿ“ Code explanation and documentation
  • ๐Ÿงช Automated test generation
  • ๐Ÿ”ง Smart refactoring suggestions
  • ๐Ÿ’ก Comment-to-code conversion
  • โšก AI-powered code completion
  • ๐ŸŽฏ Context-aware assistance

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Mistral AI for the powerful language model
  • LangChain for the AI framework
  • VS Code team for the excellent extension API

๐Ÿ“ž Support


Made with โค๏ธ by PetrJoe

Boost your coding productivity with AI assistance!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published