Aide

repository·master·Indexed 25 days ago

https://github.com/nicepkg/aide

A VSCode extension (version 1.19.1) providing AI-driven developer tools including one-click code conversion, automated commenting, batch file processing, and UI-to-code generation. It features specialized commands such as 'Copy As AI Prompt', 'Ask AI', 'Code Convert', 'Code Viewer Helper', and 'Rename Variable', all configurable via VSCode settings and OpenAI API integration.

Tokens
20.1K
Snippets
41
Records
146
Agent score
82%

What's inside aide-pro

  1. Overview of Aide features

    master

    Aide is an AI-assisted development VSCode extension designed to enhance coding workflows through specialized features rather than general-purpose chat. Key capabilities include:

    • Code Viewer Helper: Adds AI-generated comments to improve code readability without modifying the original file.
    • Code Convert: Transforms code between different programming languages or frameworks.
    • Expert Code Enhancer: Optimizes and refactors code or entire files to follow senior engineering patterns.
    • Smart Paste: Intelligently converts clipboard content (e.g., transforming design screenshots into UI code) when pasting into different file types.
    • AI Batch Processor: Processes multiple files or folders based on specific requirements.
    • Copy Multiple Files As AI Prompt: Formats multiple files into a single prompt for AI interaction.
    • Rename Variable: Provides AI-powered variable name suggestions with explanations.
    • Ask AI With Custom Command: Executes user-defined AI commands on selected files or folders.
  2. Key differences between Aide and other AI tools

    master

    Unlike general-purpose AI coding assistants like Copilot, Cursor, Codeium, or AmazonQ, Aide focuses on:

    • Complementary Features: Avoiding redundant features to focus on unique utility.
    • Efficiency: Optimized user experiences for specific tasks.
    • Open Source: The source code is freely available for viewing and contribution.
    • Customization: Supports using your preferred AI models, including local options.
  3. Configure Aide to use Ollama

    master

    To use Ollama with Aide, you must configure the OpenAI-compatible settings to point to your local Ollama instance.

    Set the following configuration keys:

    • aide.openaiBaseUrl: Must be set to http://localhost:11434/v1.
    • aide.openaiKey: Can be any placeholder value (e.g., sk-ollama).
    • aide.openaiModel: Set this to the specific Ollama model you have downloaded (e.g., llama3.1).
    {
      "aide.openaiBaseUrl": "http://localhost:11434/v1",
      "aide.openaiKey": "sk-ollama",
      "aide.openaiModel": "llama3.1"
    }
  4. Customize keyboard shortcuts for Aide VSCode commands

    master

    Aide VSCode extension provides several built-in commands that can be mapped to custom keyboard shortcuts to improve productivity. You can configure these via the VSCode Keyboard Shortcuts editor or by directly editing keybindings.json.

    {
      "key": "ctrl+shift+a",
      "command": "aide.askAI",
      "when": "editorTextFocus"
    }
  5. Configure an OpenAI Key in Aide

    master

    To use OpenAI models in Aide, you must provide an API key through the settings area.

    1. Open the Aide settings area (refer to Customize Configuration for instructions on how to access settings).
    2. Locate the Aide: openai Key configuration item.
    3. Paste your OpenAI API key into this field.

    Note for non-official OpenAI interfaces: If you are using a third-party or non-official OpenAI-compatible interface, you must also configure the following items in the same settings area:

    • Aide: Openai Base Url
    • Aide: Openai Model
  6. Use the Rename Variable feature

    master

    Use the aide.renameVariable command to get AI-generated variable name suggestions. The AI provides multiple options along with explanations of the reasoning behind each name to help you choose the most appropriate identifier based on the code logic.

    Prerequisites:

    • The AI model being used must support the function_call capability.

    Steps to use:

    1. Select the variable you wish to rename in your editor.
    2. Right-click the selection.
    3. Select ✨ Aide: Rename Variable from the context menu.
    4. Select one of the suggested variable names from the list provided by the AI.
  7. Use `✨ Aide: Rename Variable`

    master

    The ✨ Aide: Rename Variable command uses AI to suggest better variable names.

    Usage:

    1. Select a variable in the editor.
    2. Right-click and choose ✨ Aide: Rename Variable.
    3. Select a suggested name from the list.

    This command utilizes VS Code's built-in rename symbol feature, ensuring all references to the variable are updated simultaneously.

  8. Install the Aide extension in VS Code

    master

    To install the Aide extension, follow these steps in Visual Studio Code:

    1. Open VS Code.
    2. Open the Extensions view by clicking on the sidebar icon or using the shortcut Ctrl+Shift+X.
    3. Search for Aide in the Marketplace.
    4. Click Install on the extension (ensure you select the one by nicepkg).

    Requirements:

    • VS Code version 1.82.0 or higher.
  9. Customize Aide keyboard shortcuts in VS Code

    master

    You can customize the keyboard shortcuts for Aide commands using the VS Code Keyboard Shortcuts editor to streamline your workflow.

    Using the Keyboard Shortcuts Editor

    1. Open the editor by pressing Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (Mac), or via Code > Settings > Keyboard Shortcuts.
    2. Search for the specific Aide command (e.g., Aide: Ask AI).
    3. Click the plus icon next to the command.
    4. Press your desired key combination.
    5. Resolve any conflicts if VS Code notifies you.

    Available Aide Commands

    You can search for these command names in the editor to assign shortcuts:

    • Aide: Copy As AI Prompt (aide.copyAsPrompt)
    • Aide: Ask AI (aide.askAI)
    • Aide: Code Convert (aide.codeConvert)
    • Aide: Code Viewer Helper (aide.codeViewerHelper)
    • Aide: Rename Variable (aide.renameVariable)
    • Aide: Smart Paste (aide.smartPaste)
  10. Use the AI Batch Processor

    master

    The aide.batchProcessor command allows you to use AI to process the code of multiple selected files simultaneously based on specific requirements (e.g., bulk code migration, adding comments, optimizing code, or converting between languages/frameworks like Vue2 to Vue3 or JSON to YAML).

    Important Safety Note: Processing will not modify your original files directly. Instead, it generates a file copy with a suffix (e.g., app/index.py becomes app/index.py.aide.py). You must manually review the copy and click the Replace Original button to overwrite the source file.

  11. Configure Qwen as the LLM in Aide

    master

    To use the Qwen model in Aide, you must configure the OpenAI-compatible settings to point to Aliyun's DashScope endpoint. This requires setting the aide.openaiBaseUrl, aide.openaiKey, and aide.openaiModel configuration keys.

    1. API Base URL: Set aide.openaiBaseUrl to https://dashscope.aliyuncs.com/compatible-mode/v1.
    2. API Key: Set aide.openaiKey to your Qwen API Key.
    3. Model: Set aide.openaiModel to a Qwen model. The qwen-long model is recommended.

    For a full list of supported models, refer to the Qwen Official Reference Documentation.

    {
      "aide.openaiBaseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
      "aide.openaiKey": "your-qwen-api-key",
      "aide.openaiModel": "qwen-long"
    }