mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
improved windows instructions, error message
This commit is contained in:
parent
4317a41cd2
commit
77a230f005
2 changed files with 13 additions and 6 deletions
12
README.md
12
README.md
|
@ -59,13 +59,15 @@ You can find more chat transcripts on the [examples page](https://aider.chat/exa
|
|||
## Installation
|
||||
|
||||
1. Install the package:
|
||||
* PyPI: `pip install aider-chat`
|
||||
* GitHub: `pip install git+https://github.com/paul-gauthier/aider.git`
|
||||
* Local clone: `pip install -e .`
|
||||
* PyPI: `python -m pip install aider-chat`
|
||||
* GitHub: `python -m pip install git+https://github.com/paul-gauthier/aider.git`
|
||||
* Local clone: `python -m pip install -e .`
|
||||
|
||||
2. Set up your OpenAI API key:
|
||||
* As an environment variable: `export OPENAI_API_KEY=sk-...`
|
||||
* Or, by including `openai-api-key: sk-...` in an `.aider.config.yml` file
|
||||
* As an environment variable:
|
||||
* `export OPENAI_API_KEY=sk-...` on Linux or Mac
|
||||
* `setx OPENAI_API_KEY sk-...` in Windows PowerShell
|
||||
* Or include `openai-api-key: sk-...` in an `.aider.config.yml` file in your current directory or at the root of your git repo, alongside the `.git` dir.
|
||||
|
||||
3. Optionally, install [universal ctags](https://github.com/universal-ctags/ctags). This is helpful if you plan to use aider and GPT-4 with repositories that have more than a handful of files. This allows aider to build a [map of your entire git repo](https://aider.chat/docs/ctags.html) and share it with GPT to help it better understand and modify large codebases.
|
||||
* The `ctags` command needs to be on your shell path so that it will run by default when aider invokes `ctags ...`.
|
||||
|
|
|
@ -251,7 +251,12 @@ def main(args=None, input=None, output=None):
|
|||
io.tool_output(*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.")
|
||||
if os.name == "nt":
|
||||
io.tool_error(
|
||||
"No OpenAI API key provided. Use --openai-api-key or setx OPENAI_API_KEY."
|
||||
)
|
||||
else:
|
||||
io.tool_error("No OpenAI API key provided. Use --openai-api-key or env OPENAI_API_KEY.")
|
||||
return 1
|
||||
|
||||
main_model = models.Model(args.model)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue