How To Install GPT-engineer From Command Line On Windows PC
Step-by-Step Tutorial for Installing GPT Engineer on Windows PC
Head over to install gpt-engineer article for a more formatted tutorial on how to setup GPT engineer on your computer.
There’s also this quick how to install gpt-engineer video on YouTube.
There’s a substack story for installing gpt-engineer.
Introduction
This guide provides a comprehensive walkthrough of the installation process for GPT Engineer on a Windows PC.
It covers the installation of Git and Python, with the option to use any preferred IDE or text editor such as VSCode.
By following these instructions, you’ll be able to set up GPT Engineer from the official GitHub repo and start generating codebases.
Prerequisites
Ensure You Have the Required Software and Accounts
Install Git:
- Download Git from the official website (https://git-scm.com/downloads) and follow the installation steps.
- Git is essential for cloning the GPT Engineer project to your hard drive.
Install Python:
- Download and install the latest version of Python from the official Python website.
- Ensure that commands like python, python3, pip, and pip3 are executable.
Install Visual Studio Code (Optional):
- Visit the Visual Studio Code homepage and download the installation file.
- This IDE can be used for editing code, but you can use any preferred IDE or text editor.
Register for an OpenAI Account:
- Sign up for an OpenAI account and log in.
- Note: You’ll need to set up a payment plan before generating your GPT 4 API key.
Generate GPT 4 API Key
Obtain the API Key Required for GPT Engineer
Log in and Access API Keys:
- After logging into your OpenAI account, click on your username in the upper right corner.
- Select the “View API Keys” option from the dropdown menu.
Generate API Key:
- Click on the “Generate new secret key” button to create your GPT 4 API key.
- Save the API key in a secure location, as this is the only opportunity to copy it.
- OpenAI does not store your key in text format for security reasons.
Install GPT Engineer
Clone the GPT Engineer Project and Install Requirements
Clone GPT Engineer from GitHub:
- Go to the GPT Engineer GitHub repository and copy the project’s URL.
- Open the command prompt (cmd.exe) and execute the following commands:
mkdir gpt
(Create a new "gpt" folder on your C drive)cd gpt
(Switch to the newly created "gpt" directory)git clone https://github.com/Anton0sika/gpt-engineer.git
(Clone the GPT Engineer project to the "gpt" folder)
Install Project Requirements:
- Navigate to the “gpt” directory using the command prompt.
- Run the command
pip install -r requirements.txt
to install the project's dependencies.
Configure GPT Engineer
Add Your GPT 4 API Key to GPT Engineer
Set Environment Variable (Windows — Command Prompt):
set OPENAI_API_KEY=<your-api-key>
Set Environment Variable (Windows — PowerShell):
$env:OPENAI_API_KEY="<your-api-key>"
Set Environment Variable (Linux/macOS):
export OPENAI_API_KEY=<your-api-key>
Create a GPT Engineer Project
Start a New Project and Define the Main Prompt
Create a New Project:
- Run the command
mkdir <project-name>
in the command prompt. - Open the project folder in your preferred IDE or text editor.
Create the Main Prompt:
- Within the project folder, create a new blank file named “main_prompt” (without extensions).
- Enter your desired instructions for GPT Engineer in the “main_prompt” file and save it.
Run Your GPT Engineer Project
Generate Codebase Based on the Main Prompt
Executing commands:
- Open the command prompt (cmd.exe) or terminal.
- Navigate to the “gpt-engineer” directory using the
cd
command. - Execute the command
python -m gpt_engineer.main <project-name>
to run your GPT Engineer project. - If you encounter an error, try using
python3
instead ofpython
.
Note: If you experience any errors related to Python environment setup, refer to web development tutorials for assistance in resolving them.
For more information, refer to this how to install gpt-engineer video.