Aider
Aider là pair programming agent chạy terminal — git-aware, có thể edit file, commit tự động, hiểu codebase context. Dùng OpenAI SDK nên cấu hình qua biến môi trường là xong.
Bạn cần chuẩn bị
·Python ≥ 3.9
·API Key (tạo ở trang API Keys)
·3 phút
1
Cài Aider
Cài qua pip:
python -m pip install -U aider-chat2
Set biến môi trường
Aider đọc OPENAI_API_KEY và OPENAI_API_BASE:
export OPENAI_API_KEY="sk-billing-xxx"
export OPENAI_API_BASE="https://nexai.newdev.net/api/v1"3
Chạy Aider trong project
cd vào git repo, gọi aider với model muốn dùng. LƯU Ý: cần prefix openai/ trước tên model khi dùng custom endpoint:
# GPT-4o (cân bằng)
aider --model openai/gpt-4o
# GPT-5.5 (mạnh nhất, ngữ cảnh dài)
aider --model openai/gpt-5.5
# Tiết kiệm credit
aider --model openai/gpt-4o-miniAider BẮT BUỘC prefix
openai/ trước tên model khi dùng custom endpoint. Thiếu prefix sẽ ra lỗi auth/route giả khó debug.4
Tương tác
Trong prompt aider, gõ yêu cầu: 'Add unit test cho function foo'. Aider sẽ edit file + commit tự động (có thể disable bằng --no-auto-commits).
Xong! Aider đã kết nối với nexai.
Để Aider không tự commit, dùng cờ
--no-auto-commits. Để chỉ định files sẵn sàng cho context: aider src/foo.ts src/bar.ts.