
Getting Started Guide
How to Use Aider
A practical guide to get you up and running with Aider. Written by Delv Editorial, Delv Team.
Getting started with Aider
In this guide, you'll learn how to set up Aider, the open-source AI pair programming tool that enhances your coding experience directly in the terminal. By the end, you'll be able to edit code in your local Git repository using advanced language models.Step 1: Sign up and set up
- Go to the Aider website and check the installation instructions for your operating system.
- Open your terminal and clone the Aider repository with the command:
git clone https://github.com/yourusername/aider.git
- Navigate into the cloned directory:
cd aider
- Install the necessary dependencies using:
npm install
- Set up your API keys for the language models you want to use (e.g., GPT-4 or Claude). Follow the documentation in the repository for specific instructions on configuring these keys.
Step 2: Your first code edit
- Open your terminal and navigate to your local Git repository where you want to use Aider.
- Start Aider by running:
node aider.js
- Type a command to request a code suggestion. For example:
Suggest a function to calculate the factorial of a number.
- Aider will respond with a code snippet. You can accept it by typing
yesor modify it as needed. - If you accept the suggestion, Aider will automatically edit your code file.
Step 3: Get better results
- Use clear and specific prompts when asking for code suggestions. For instance, instead of "Help me with a loop," specify "Create a for loop that iterates through an array of numbers."
- Regularly update Aider and its dependencies to ensure you have the latest features and bug fixes. Use:
git pull origin main
npm update