Vini OpenRouter Code Translator
Convert source code between programming languages in VS Code using a multi-model OpenRouter ensemble.
Features
- Convert the current file or an entire project.
- Supports JavaScript, TypeScript, Python, Java, C++, C, C#, Go, Rust, PHP, Kotlin, Swift, Ruby, and Scala.
- Uses multiple models and selects the best output:
anthropic/claude-3-haiku
openai/gpt-4o
deepseek/deepseek-v3.2
- Cleans and validates model output before saving.
- Keeps converted files in
converted/ while preserving project structure.
- Optional simplification pass after project conversion.
Requirements
Set your OpenRouter API key. When you first use the extension without a key, you'll see two buttons in the side panel:
- Get API Key from OpenRouter — Opens OpenRouter to create a key
- Paste API Key in Settings — Opens VS Code settings at the API key field
Or manually set it in VS Code settings:
- Open Settings.
- Search for
Code Translator: OpenRouter API Key.
- Paste your OpenRouter API key.
For local development, .env is also supported in extension/workspace root:
OPENROUTER_API_KEY=your_api_key_here
Usage
- Open Command Palette and run
Code Translator: Pick Language and Convert.
- Choose:
- Current File, or
- Whole Project
- Select the target language.
- Converted output is written to
converted/.
You can also use the Code Translator side panel and click:
Convert File
Convert Project
Notes
- Skips files in
node_modules, .git, and converted.
- Large files may be skipped in project mode for stability.
- Output quality depends on model/API availability.
| |