AI-powered code review, formatting, refactoring, and test generation for VS Code and Cursor — powered by the Google Gemini API. Includes full-stack project scaffolding (no API key required).
Features
Choose a scope, then an action:
Scope
- Current File — process the active editor document
- Select Files… — pick one or more workspace files
- Entire Project — scan source files across the workspace (with a configurable file cap)
Actions
- Review Code — bugs, risks, and improvement opportunities (markdown report)
- Write Unit Tests — language-appropriate unit tests with mocks
- Write Integration Tests — tests across modules / I/O boundaries
- Format Code — clean formatting without changing behavior (diff + Apply)
- Refactor to Best Practices — improve structure while preserving behavior (diff + Apply)
Project scaffolding
Command Palette → CodeRefine AI: Scaffold New Project...
No Gemini API key required — scaffolding uses built-in templates only (not LLM generation).
Wizard picks architecture, frontend, backend, database/ORM, auth, Redis, AI rules, infra/clouds, and CI/CD. Generated layout is inspired by Bibi1989/project-template:
- Nuxt 3/4 with
app/(pages, layouts, composables) + Nitroserver/api - Express.js layered API (routes / controllers / services / middleware / zod config)
- Helm
infra/helm/appwith dynamicapps.*→ Deployment, Service, Secret, ConfigMap, Ingress, HPA - Terraform per cloud:
terraform-gcp,terraform-aws,terraform-azure,terraform-cloudflare - Pulumi (TypeScript) per cloud:
pulumi-aws,pulumi-gcp,pulumi-azure,pulumi-cloudflare - CI/CD: GitHub Actions and/or GitLab CI validating each selected cloud stack
Ways to trigger CodeRefine
| Entry point | How |
|---|---|
| Command Palette | Review & Refactor Code · Generate Tests · Run... · Scaffold |
| Editor right-click | Review & Refactor · Generate Tests (selection or whole file) |
| Explorer right-click | Same two commands on files, multi-select, or folders |
| Editor title bar | Sparkle ($(sparkle)) → Review & Refactor |
| Keyboard | Cmd/Ctrl+Shift+R → Review & Refactor |
| Lightbulb | Click the code action lightbulb (or Cmd+. / Ctrl+.) for Review, Tests, Format, or Refactor |
Getting started
Project scaffolding (no API key)
- Command Palette → CodeRefine AI: Scaffold New Project...
- Follow the wizard and pick a target folder.
- Run
npm install/pnpm installfrom the generatedQUICKSTART.md.
AI features (Gemini API key required)
- Install the extension.
- Open a source file, then use any trigger below (e.g. Cmd+Shift+R or the title-bar sparkle).
- When prompted, enter your Google Gemini API key.
- Pick an action (and a scope if you used Run...).
Extension settings
| Setting | Description | Default |
|---|---|---|
coderefine.apiKey |
Google Gemini API key | (empty) |
coderefine.model |
Gemini model name | gemini-2.5-flash |
coderefine.maxProjectFiles |
Max files for Entire Project scope | 40 |
coderefine.projectIncludeGlobs |
Include globs for project scans | source file patterns |
coderefine.projectExcludeGlob |
Exclude glob for project scans | node_modules, out, dist, … |
Requirements
- VS Code / Cursor
- Gemini API key — only for review, refactor, tests, and commit messages (not scaffolding)
- Network access to the Gemini API (AI features only)
Development
npm install
npm run compile
Press F5 to launch the Extension Development Host.