تعليمات خطوة بخطوة
- 1
Step
Verify Python and pip
Aider is a Python package. If you get 'command not found', download Python from python.org before continuing.
python3 --version pip --version - 2
Step
Install Aider via pip
If you get an 'externally-managed-environment' error on macOS, run `pipx install aider-chat` instead.
pip install aider-chat - 3
Step
Set your API Key
To use GPT-4o instead, use `export OPENAI_API_KEY=your-key`.
export ANTHROPIC_API_KEY=your_key_here - 4
Step
Launch Aider
Aider requires your project to be a Git repository. If it's not, run `git init` first.
cd your-project-folder aider
لماذا هذا مهم
Aider هي أداة CLI رائدة للبرمجة الزوجية بالذكاء الاصطناعي تتيح لك تحرير ملفات متعددة في وقت واحد مباشرة من الطرفية الخاصة بك.
استكشاف الأخطاء وإصلاحها
- **'externally-managed-environment' on macOS:** Modern macOS versions block global pip installs. Instead of using `pip`, install pipx using Homebrew (`brew install pipx`), run `pipx ensurepath`, and then install Aider via `pipx install aider-chat`.
- **'aider is not recognized' on Windows:** If you installed Aider but Windows can't find it, your Python Scripts folder isn't in your PATH. Search for 'Environment Variables', edit PATH, and add `%USERPROFILE%\AppData\Local\Programs\Python\Python312\Scripts` (adjusting for your version).
- **No Git repository error:** Aider is designed to track its own changes using Git. If you run `aider` in an empty folder, it will prompt you. Simply run `git init` to initialize the repository before starting your coding session.
FAQ
Why do I get 'command not found: aider' after installing?
This usually means the directory where `pip` installed the executable is not in your system's PATH variable. You either need to add the Python Scripts directory to your PATH or use `pipx` to manage the installation.
Can I use OpenAI GPT-4o instead of Claude?
Yes. While Claude 3.7 Sonnet is currently the top performer for Aider's benchmarks, you can easily use GPT-4o. Just run `export OPENAI_API_KEY=your-key` and launch the CLI with `aider --model gpt-4o`.
Does Aider work in PowerShell?
Absolutely. Once installed via pip, the `aider` command works in PowerShell, Command Prompt, Windows Terminal, and WSL.
How do I update Aider to the latest version?
If you used pip, run `pip install --upgrade aider-chat`. If you used pipx, run `pipx upgrade aider-chat`.
Does Aider send my entire codebase to the API?
No. Aider uses a repository map to understand the architecture, but it only sends the specific files you have "added" to the chat session.
Related
Copilot
How to Install GitHub Copilot CLI on Mac and Windows
Step-by-step guide to installing the GitHub Copilot CLI extension. Learn how to authenticate and run gh copilot suggest and explain in your terminal.
Ollama
كيفية تثبيت وتشغيل Ollama CLI على Mac و Windows
دليل خطوة بخطوة لتثبيت Ollama CLI على macOS و Windows لتشغيل نماذج ذكاء اصطناعي محلية مثل Llama 3.