⚡ LangShiftAI Code Transpiler for VS CodeConvert code between 25+ languages with a single rename. Six AI providers. Smart caching. PII scrubbing. Offline support. Enterprise-ready. Install from Marketplace · Report Bug · Request Feature
🤔 Why LangShift?Most code translators are toys — copy-paste into a web UI, get broken output, manually fix imports. LangShift is different.
✨ Feature Highlights🧠 AI-Powered Core
🔒 Enterprise Security
📦 Multi-File Intelligence
⚡ Performance & Reliability
🛠 Team & Configuration
🌍 Supported Languages
🚀 Quick Start1️⃣ InstallSearch "LangShift" in the VS Code Extensions panel, or run:
2️⃣ Configure an AI ProviderOpen the Command Palette ( Select your provider → paste your API key → Done.
3️⃣ Convert CodeOption A — Rename to convert (magic mode):
Option B — Command Palette:
Option C — Right-click: Right-click any file in Explorer → LangShift: Convert This File A confirmation dialog appears → choose Convert, Preview Diff, or Skip. 🔧 Provider Setup☁️ Cloud Providers🟣 Anthropic (Claude) — Recommended for code quality
Available models:
| Model | Best For |
|---|---|
|
🟢 OpenAI (GPT-4o) — Strong all-rounder
Available models:
| Model | Best For |
|---|---|
|
🔵 Google Gemini — Fast and cost-effective
Available models:
| Model | Best For |
|---|---|
|
🟡 OpenRouter — Access 200+ models with one key
Example models:
Other popular choices:
🏠 Local Providers (No API Key Required)🦙 Ollama — Fully offline, air-gapped safe
No API key. No data leaves your machine. Perfect for classified/regulated environments.
🖥 LM Studio — GUI-based local AI
No API key. No data leaves your machine. Use any GGUF model you like. ⚙️ Configuration ReferenceOpen VS Code Settings ( Provider Settings
Conversion Behavior
AI Enhancement
Security & Compliance
Limits
📄
|
| Command | Shortcut | Description |
|---|---|---|
| LangShift: Convert This File | — | Convert the active file to another language |
| LangShift: Convert All Files in Folder | — | Batch convert an entire folder |
| LangShift: Show Conversion History | — | Browse past conversions with details |
| LangShift: Open Dashboard | — | Visual analytics dashboard |
| LangShift: Configure API Key | — | Add or change a provider's API key |
| LangShift: Delete Stored API Key | — | Remove a stored API key |
| LangShift: Undo Last Conversion | — | Restore previous file from backup |
| LangShift: Cancel Active Conversion | — | Cancel an in-flight AI request |
| LangShift: Clear Conversion Cache | — | Clear the SHA-256 smart cache |
| LangShift: Export Audit Log (CSV) | — | Export audit log as CSV for compliance |
All commands are also accessible via the right-click context menu on supported files and folders.
🏗 Architecture Overview
src/
├── extension.ts ← Activation, command registration, rename watcher
│
├── ai/ ← Provider abstraction layer
│ ├── AIProvider.ts ← Common interface for all providers
│ ├── AnthropicProvider.ts ← Claude API integration
│ ├── OpenAIProvider.ts ← GPT-4o API integration
│ ├── GeminiProvider.ts ← Gemini API integration
│ ├── OpenRouterProvider.ts ← OpenRouter multi-model gateway
│ ├── OllamaProvider.ts ← Local Ollama integration
│ ├── LMStudioProvider.ts ← Local LM Studio integration
│ └── ProviderFactory.ts ← Factory pattern for provider instantiation
│
├── core/ ← Conversion engine & intelligence
│ ├── ConversionEngine.ts ← Orchestrates the full conversion pipeline
│ ├── LanguageDetector.ts ← 25 languages, extension ↔ name mapping
│ ├── ConversionHistory.ts ← Persistent history with stats
│ ├── ConversionCache.ts ← SHA-256 content-hash smart cache
│ ├── BackupManager.ts ← Atomic backup and restore
│ ├── CodeValidator.ts ← Syntax validation per language
│ ├── CompilerValidator.ts ← Runs actual compilers on output
│ ├── ContextCollector.ts ← Import tree walker for multi-file context
│ ├── FallbackChain.ts ← Provider fallback with retry logic
│ ├── FewShotExamples.ts ← Built-in examples for popular pairs
│ ├── ImportResolver.ts ← Validates target-language package existence
│ ├── ModelRouter.ts ← Auto-picks best model per language pair
│ ├── PIIRedactor.ts ← Regex-based PII scrubbing engine
│ └── AuditLog.ts ← JSONL audit trail with CSV export
│
├── config/ ← Configuration management
│ ├── CustomRules.ts ← .langshiftrc.json loader and validator
│ └── TeamSettings.ts ← Team shared settings loader
│
├── security/ ← Security layer
│ ├── SecurityManager.ts ← Multi-provider encrypted key storage + secret scanning
│ └── RateLimiter.ts ← Sliding-window rate limiter
│
├── providers/ ← VS Code UI providers
│ ├── DiffProvider.ts ← Side-by-side diff editor + dashboard webview
│ └── SidebarProvider.ts ← Activity bar sidebar with live stats
│
└── utils/ ← Shared utilities
├── ConfigManager.ts ← Typed settings wrapper
├── Logger.ts ← VS Code output channel logger
└── TelemetryService.ts ← Privacy-first opt-in telemetry
Conversion Pipeline
┌─────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────┐
│ Input │───▶│ Cache │───▶│ PII Scrub │───▶│ Context │───▶│ AI Call │
│ File │ │ Check │ │ (opt-in) │ │ Collect │ │ (stream) │
└─────────┘ └──────────┘ └───────────┘ └──────────┘ └───────────┘
│ hit │
▼ ▼
┌──────────┐ ┌───────────┐
│ Instant │ │ Two-Pass │
│ Return │ │ Review │
└──────────┘ └───────────┘
│
┌───────────┐ ┌──────────┐ ┌──────────┐ │
│ Backup │◀──│ Compiler │◀──│ Validate │◀──────┘
│ + Apply │ │ Check │ │ + Score │
└───────────┘ └──────────┘ └──────────┘
🔐 Security & Privacy
LangShift is built with enterprise security requirements in mind:
| Concern | How LangShift Handles It |
|---|---|
| API Key Storage | Encrypted via VS Code SecretStorage (OS keychain). Never stored in settings.json or plaintext files. |
| Code Transmission | HTTPS only. Code sent only to your chosen provider. Local providers (Ollama/LM Studio) send nothing over the network. |
| PII Protection | Optional regex-based scrubbing of emails, IPs, phone numbers, SSNs before AI transmission. HIPAA/GDPR-compatible. |
| Audit Trail | Optional JSONL logging of every conversion (timestamp, provider, languages, file name — no code content). Exportable as CSV. |
| Secret Scanning | Warns if source code contains hardcoded passwords, API keys, or tokens before sending. |
| Local Code Retention | Recent conversion history keeps source and converted code locally in VS Code global state for diff viewing; older entries drop code content. Audit logs and telemetry never include code. |
| Backups | Stored in .langshift-backups/ with auto-generated .gitignore to prevent accidental commits. |
| Telemetry | Strictly opt-in. Anonymous. Never includes code, file paths, or API keys. |
| Air-Gapped Environments | Use Ollama or LM Studio — zero network requests, full functionality. |
| Corporate Proxy | Set langshift.proxyUrl for environments behind HTTP/HTTPS proxies. |
❓ FAQ
Which AI provider should I use?
- Best quality: Anthropic Claude (
claude-sonnet-4-20250514) — excellent at understanding code semantics and idioms. - Best value: Google Gemini (
gemini-2.0-flash) — fast, cheap, and surprisingly capable. - Most models: OpenRouter — access 200+ models with a single API key.
- Offline/private: Ollama or LM Studio — no data leaves your machine.
Does my code get stored anywhere?
No. LangShift sends your code to the AI provider you choose (via HTTPS) and receives the converted output. Nothing is stored on any intermediate server. With Ollama or LM Studio, nothing leaves your machine at all.
How does smart caching work?
LangShift hashes your file content using SHA-256, combined with the source language, target language, and model. If you convert the same unchanged file with the same settings again, the result is returned instantly from cache — no API call, no cost.
What is two-pass conversion?
When enabled, LangShift sends the AI's first output back to the AI with the prompt "review and fix this conversion." The AI catches its own mistakes — missing edge cases, incorrect imports, non-idiomatic patterns. This doubles API cost but meaningfully improves output quality for complex files.
Can I use this in an air-gapped environment?
Yes. Configure Ollama or LM Studio as your provider. Both run entirely locally. No internet connection required. No telemetry. No external API calls. Perfect for classified, regulated, or restricted environments.
What does the confidence score mean?
The AI rates its own conversion confidence from 0 to 100:
- 90–100: High confidence — straightforward conversion, likely correct.
- 70–89: Good — may need minor review for edge cases.
- 50–69: Moderate — review recommended, especially complex logic.
- Below 50: Low — significant manual review needed.
How does the fallback chain work?
When fallbackEnabled is true and your primary provider returns a 429 (rate limit) or 5xx (server error), LangShift automatically retries with the next provider in your fallbackChain. For example, with the default chain ["openai", "gemini"], if Anthropic fails, it tries OpenAI, then Gemini.
What compilers are supported for validation?
LangShift can optionally run the actual compiler/interpreter on the converted output:
| Language | Compiler/Tool |
|---|---|
| TypeScript | tsc --noEmit |
| Java | javac |
| Go | go build |
| Rust | rustc --edition 2021 |
| C++ | g++ |
| C | gcc |
| C# | dotnet build |
| Python | python -m py_compile |
The compiler must be installed on your system. This is optional validation — conversions still work without it.
What is PII scrubbing and when should I enable it?
PII scrubbing uses regex patterns to redact personally identifiable information (emails, IP addresses, phone numbers, SSNs) from your code before it's sent to the AI. Enable it when working with code that may contain real user data — especially in healthcare (HIPAA) or European (GDPR) contexts. Redacted values are replaced with placeholders and restored after conversion.
Can my whole team share the same settings?
Yes. Create .vscode/langshift.team.json in your repo and commit it. All team members will use the same provider, model, conversion rules, and security settings. Individual user settings still override team settings where needed.
🤝 Contributing
Contributions are welcome! Here's how to get started:
# Clone the repo
git clone https://github.com/abneeshsingh21/LangShift-Extension-.git
cd langshift-vscode
# Install dependencies
npm install
# Compile
npm run compile
# Launch Extension Development Host
# Press F5 in VS Code — a new window opens with LangShift loaded
Development Commands
npm run compile # Compile TypeScript
npm run watch # Watch mode for development
npm test # Run test suite
npm run lint # Lint with ESLint
npm run package # Package as .vsix for distribution
Guidelines
- Fork the repository and create a feature branch
- Write tests for new functionality
- Follow the existing code style (ESLint enforced)
- Update documentation for user-facing changes
- Open a PR with a clear description of your changes
📖 See CONTRIBUTING.md for detailed guidelines.
📜 License
MIT © LangShift Contributors
Built with ❤️ for developers who speak every language.