mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
feat: Load OAuth keys from ~/.aider/oauth-keys.env
This commit is contained in:
parent
15cec5bd50
commit
290fd99b6d
1 changed files with 10 additions and 0 deletions
|
@ -358,11 +358,21 @@ def register_models(git_root, model_settings_fname, io, verbose=False):
|
|||
|
||||
|
||||
def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"):
|
||||
# Standard .env file search path
|
||||
dotenv_files = generate_search_path_list(
|
||||
".env",
|
||||
git_root,
|
||||
dotenv_fname,
|
||||
)
|
||||
|
||||
# Explicitly add the OAuth keys file to the beginning of the list
|
||||
oauth_keys_file = Path.home() / ".aider" / "oauth-keys.env"
|
||||
if oauth_keys_file.exists():
|
||||
# Insert at the beginning so it's loaded first (and potentially overridden)
|
||||
dotenv_files.insert(0, str(oauth_keys_file.resolve()))
|
||||
# Remove duplicates if it somehow got included by generate_search_path_list
|
||||
dotenv_files = list(dict.fromkeys(dotenv_files))
|
||||
|
||||
loaded = []
|
||||
for fname in dotenv_files:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue