Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Terminal-LensNew to Visual Studio Code? Get it now.
Terminal-Lens

Terminal-Lens

Rohit Ratnam

|
3 installs
| (0) | Free
Automatically scan terminal output for errors and provide AI explanations.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Terminal-Lens

Supercharge your debugging workflow with AI-powered terminal diagnostics.

Terminal-Lens automatically scans your integrated VS Code terminal for stack traces, error paths, and exceptions in real-time. It turns these errors into auto-diagnostics (red squiggles) and inline Code Lenses in your editor. Click the lens, or use the interactive terminal links, to open an AI-powered Chat Interface that explains exactly what went wrong and lets you apply the fix with a single click!


Features

  • Auto-Diagnostics & Code Lenses: Terminal-Lens listens to your terminal output and automatically places error squiggles and a ✨ AI: Analyze Terminal Error Code Lens right above the failing line in your code. No manual searching needed!
  • Conversational AI Chat: Ask follow-up questions, request different solutions, and chat directly with the AI inside a beautifully rendered, theme-aware webview.
  • One-Click "Apply Fix": When the AI suggests code, a "✨ Apply Fix" button appears. Click it to instantly apply the drop-in replacement directly to your file using native Workspace Edits.
  • Instant Error Navigation: You can also hold Ctrl / Cmd and click any terminal error path (e.g., src/app.ts:15:5) to trigger the AI analysis.
  • Native AI Integration: Integrates seamlessly with top-tier LLMs to diagnose your specific error within the context of your codebase.
  • Multi-Provider Support: Choose the AI that works best for you. Terminal-Lens supports OpenAI, Anthropic, Cohere, and even Ollama for completely free, private, local execution.
  • Language Agnostic: The regex engine automatically identifies stack traces from Node.js, Python, Rust, Go, C++, and more.
  • Custom Ignore Patterns: Avoid scanning noisy directories like node_modules or .git by customizing your ignore lists.

Getting Started

  1. Install the Extension: Download Terminal-Lens from the VS Code Marketplace.
  2. Open Settings: Press Ctrl + , (Windows/Linux) or Cmd + , (Mac) to open your VS Code Settings.
  3. Configure Terminal-Lens: Type Terminal Lens into the settings search bar.
  4. Choose your AI:
    • Select your preferred AI from the Ai Provider dropdown.
    • Paste your API key into the Ai Api Key field. (Note: If you select ollama, no API key is required!)

How to Use

  1. Run your code in the integrated VS Code terminal.
  2. If an error or stack trace occurs, Terminal-Lens will automatically put a red error squiggle and a Code Lens on the failing line in your active editor.
  3. Click the ✨ AI: Analyze Terminal Error Code Lens above the broken code.
  4. A chat panel will open, and the AI will analyze the error and the surrounding code context.
  5. If the AI provides a code block with a fix, click the ✨ Apply Fix button to instantly patch your file!
  6. Alternatively, you can always Ctrl + Click (or Cmd + Click) the file path link directly in the terminal output to trigger the same workflow.

Extension Settings

This extension contributes the following settings:

Setting Default Description
terminalLens.aiProvider openai Choose between openai, anthropic, cohere, or ollama.
terminalLens.aiApiKey "" The API Key for your selected cloud provider.
terminalLens.ignoredPatterns ["node_modules", "vendor", ".git"] Folders or regex patterns to ignore when scanning for terminal links.

Using Ollama (Local & Free)

If you want to run your AI diagnostics locally without paying for API keys:

  1. Download and install Ollama.
  2. Run ollama run llama3 (or any model of your choice) in your terminal to download the model.
  3. Keep the Ollama application running in the background.
  4. Set the Ai Provider to ollama in the Terminal-Lens settings.

Built with ❤️ for developers who hate copying and pasting stack traces.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft