Rubberduck

Rubberduck is a Visual Studio Code extension designed to help developers code faster and more accurately. It uses AI to generate code, expl...

Last verified:

Visit Rubberduck

What is Rubberduck?

Rubberduck is an AI-powered Visual Studio Code extension that integrates ChatGPT-like capabilities directly into the sidebar, enabling developers to chat about code, generate new code snippets, edit existing selections, explain complex logic, generate unit tests, find potential bugs, and diagnose errors from compilers or linters. It leverages the official OpenAI API or experimental local models like Llama.cpp, with full awareness of the current editor selection to provide contextually relevant responses. Users can customize interactions through conversation templates stored as .rdt.md files in the workspace, allowing tailored prompts such as pirate-style explanations or project-specific conventions.

Key features include multiple entry points like command palette commands, context menus, keyboard shortcuts (e.g., Ctrl+Cmd+C for chat), and toolbar buttons for seamless workflow integration. The edit code function displays diffs for review and refinement before applying changes, while syntax highlighting in diffs can mimic VS Code themes. It supports all programming languages, making it versatile for diverse development needs.

Designed for software developers seeking to boost productivity without leaving their IDE, Rubberduck is ideal for solo coders, teams refining code quality, and learners needing instant explanations or test generation. As an open-source tool under MIT license, it prioritizes privacy by using user-provided API keys stored securely in VS Code's secret storage, ensuring code remains between the user and OpenAI.

Rubberduck pricing

Pricing model: Free

Free to install and use as open-source extension; requires user-provided OpenAI API key with associated pay-per-use pricing from OpenAI (costs vary by model and token usage); no extension-specific paid plans or free tier.

Rubberduck pros

  • AI chat aware of editor selection
  • Generates code from descriptions
  • Edits code with diff preview
  • Explains selected code snippets
  • Generates unit tests automatically
  • Finds potential bugs in code
  • Diagnoses compiler and linter errors
  • Supports custom conversation templates
  • Multiple invocation methods including shortcuts
  • Keyboard shortcuts like Ctrl+Alt+E for edits
  • Context menu integration in editor
  • OpenAI API with secure key storage
  • Experimental Llama.cpp local model support
  • Syntax highlighting in diff viewer
  • Open source with MIT license
  • Supports all programming languages

Rubberduck cons

  • Requires separate OpenAI API key
  • Incurs OpenAI API usage costs
  • Local Llama.cpp support experimental
  • Syntax highlighting may fail with some themes
  • AI responses can be inaccurate on niche topics
  • Long chat threads reduce accuracy
  • No built-in free tier or credits
  • Depends on external AI model reliability
  • Setup needed for custom templates

Frequently asked questions about Rubberduck

How do I set up Rubberduck with OpenAI?

Obtain an OpenAI API key from platform.openai.com/account/api-keys after signing up, then enter it using the 'Rubberduck: Enter OpenAI API key' command in the VS Code command palette. The key is stored securely in VS Code's secret storage for privacy.

What keyboard shortcuts does Rubberduck provide?

Shortcuts include Ctrl+Cmd+C (Mac) or Ctrl+Alt+C (Windows/Linux) to start chat, Ctrl+Cmd+G or Ctrl+Alt+G for generate code, Ctrl+Cmd+E or Ctrl+Alt+E for edit code, with more available via command palette and context menus.

Can Rubberduck use local AI models?

Yes, experimentally via Llama.cpp (e.g., CodeLlama-7B-Instruct); set the 'Rubberduck: Model' setting to 'llama.cpp' after configuring ModelFusion Llama.cpp setup for offline usage.

How does the edit code feature work?

Select code, invoke 'Rubberduck: Edit Code' via command, context menu, or shortcut; Rubberduck generates a diff view in the sidebar, allows chat refinements, and applies changes with the 'Apply' button upon approval.

What are custom conversations in Rubberduck?

Create .rdt.md template files in .rubberduck/template folder in your workspace; invoke via 'Rubberduck: Start Custom Chat…' command for tailored AI behaviors like project-specific styles or languages; see Rubberduck Template docs for details.

Does Rubberduck support all programming languages?

Yes, it works across languages like JS, Python, Ruby, PHP, and more, as it uses general AI models; performance may vary based on model training, but editor selection provides context for any code.

How do I generate unit tests with Rubberduck?

Select code, run 'Rubberduck: Generate Unit Test' from command palette or context menu; test case opens in a new editor tab, refinable via the sidebar chat for quick boilerplate and logic.

Can Rubberduck diagnose errors?

Yes, select erroneous code and use 'Rubberduck: Diagnose Errors'; it identifies causes from compiler/linter output and suggests fixes, shown in chat for iterative refinement.

How to start a chat in Rubberduck?

Use 'Rubberduck: Start Chat' command, 'Start Chat' context menu on selection, sidebar 'Start new chat' button, Ctrl+Cmd+C shortcut, or Mac Touch Bar 💬; it incorporates selected code context.

What configuration options exist?

Key setting is 'rubberduck.syntaxHighlighting.useVisualStudioCodeColors' (default false) to match VS Code theme colors in diff viewer, though it may not work with all themes; additional tips in extension docs.

Categories

Use cases

Browse all AI tools on NeedAnAI