mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
Handle missing api key gracefully
This commit is contained in:
parent
3f5e4130ea
commit
b0d860bcf4
1 changed files with 5 additions and 0 deletions
|
@ -189,6 +189,10 @@ def main(args=None, input=None, output=None):
|
|||
|
||||
io.tool(*sys.argv, log_only=True)
|
||||
|
||||
if not args.openai_api_key:
|
||||
io.tool_error("No OpenAI API key provided. Use --openai-api-key or env OPENAI_API_KEY,")
|
||||
return 1
|
||||
|
||||
coder = Coder(
|
||||
io,
|
||||
main_model=args.model,
|
||||
|
@ -202,6 +206,7 @@ def main(args=None, input=None, output=None):
|
|||
verbose=args.verbose,
|
||||
openai_api_key=args.openai_api_key,
|
||||
)
|
||||
|
||||
if args.dirty_commits:
|
||||
coder.commit(ask=True, prefix="wip: ", which="repo_files")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue