VS Code Extension · Free & Open Source

Code Janitor
Setup Guide

Format, fix, and chat about your code with local AI or cloud providers. Get up and running in minutes.

Install in VS Code Arduino IDE Setup View on GitHub
Getting Started

Installation

Install the extension and get it running in 3 steps.

1

Install the Extension

Open VS Code, go to the Extensions panel (Ctrl+Shift+X), search for Code Janitor and click Install. Or click the button above to install directly.

2

Choose an AI Provider

Open the AI Chat panel with Ctrl+Alt+C. Select a provider from the dropdown — Ollama for local/offline, OpenRouter or Groq for free cloud models.

3

Start Coding

Use Alt+D to format code, Alt+L to lint JavaScript, or open the AI chat and ask anything about your codebase.

Open in VS Code 🤖 Check Models in Chat
Local AI (Ollama)

Recommended Models

Run AI completely offline with Ollama. Install Ollama first, then pull any model below.

Local · Fast

qwen2.5-coder:1.5b

Lightweight and fast. Great for quick fixes and simple questions on low-end hardware.

ollama pull qwen2.5-coder:1.5b
Local · Balanced

qwen2.5-coder:7b

Best balance of speed and quality for coding tasks. Recommended for most users.

ollama pull qwen2.5-coder:7b
Local · Powerful

codellama:7b

Meta's code-focused model. Strong at code generation and explanation.

ollama pull codellama:7b
Local · Large

codellama:13b

More capable version of CodeLlama. Requires ~8GB RAM. Best for complex tasks.

ollama pull codellama:13b
Free · Cloud

qwen3-coder:free

Free OpenRouter model. No local install needed, just an OpenRouter API key.

via OpenRouter
Free · Cloud

gemini-2.0-flash:free

Google's fast model via OpenRouter. Excellent instruction following, completely free.

via OpenRouter
Cloud Providers

Getting API Keys

Use free cloud models without installing anything locally. Both providers below have generous free tiers.

Groq

Free Tier
  • 1.Go to console.groq.com and sign up for a free account.
  • 2.Navigate to API Keys in the sidebar and click Create API Key.
  • 3.Copy the key, open the Code Janitor chat panel, select Groq as provider, and paste it in the API Key field.
  • 4.Click Save. Your key is stored locally in VS Code settings.
Get Groq API Key →
🌐

OpenRouter

Free Models
  • 1.Go to openrouter.ai and create a free account.
  • 2.Go to Keys and click Create Key. No credit card needed for free models.
  • 3.Copy the key, open the Code Janitor chat panel, select OpenRouter as provider, and paste it.
  • 4.Pick a model ending in :free from the model dropdown to use at no cost.
Get OpenRouter Key →
🖥

Ollama (Local)

No Key Needed
  • 1.Download and install Ollama for your OS.
  • 2.Open a terminal and run ollama pull qwen2.5-coder:7b (or any model above).
  • 3.Ollama runs automatically in the background. No API key required.
  • 4.In the chat panel, select Ollama (local) — it will detect and list your installed models automatically in the model dropdown.
Download Ollama →
Configuration

VS Code Settings

Add these to your settings.json (Ctrl+Shift+POpen User Settings JSON) to configure the extension manually.

settings.json
"codeJanitor.ai.enabled": true, "codeJanitor.ai.provider": "ollama", // "ollama" | "groq" | "openrouter" | "anthropic" "codeJanitor.ai.ollamaUrl": "http://localhost:11434", "codeJanitor.ai.model": "qwen2.5-coder:7b", "codeJanitor.ai.timeout": 90000, "codeJanitor.autoCorrection.enabled": true, "codeJanitor.autoCorrection.delay": 500
What's Included

Features

Everything Code Janitor can do out of the box.

🔧

Auto Format

Format Python, JS, Java, C/C++, and HTML with Alt+D or on save.

Real-time Fixes

Auto-corrects syntax errors as you type with a configurable delay.

🤖

AI Chat

Ask questions about your codebase, get fixes, refactors, and docs generated.

👁

Live Preview

Preview HTML and React files in a live webview panel with Alt+P.

🔍

ESLint Integration

Lint JavaScript files and see issues in the Problems panel with Alt+L.

Frontend Validator

Validate HTML, CSS, and JS dependencies with Alt+V.