How to install and get started with AI Dev.
Prerequisites
- Node.js 18 or later. This powers the AI Dev itself.
- Docker Desktop. This sandboxes the AI Dev so it doesn’t make unwanted changes.
- OpenAI API Key. This enables the AI Dev to use OpenAI’s models.
Install
You can install and run the CLI with this command:
npx ai-dev@latest
Your First Task
After you’ve run the npx command for the first time, it’ll prompt you to kick off a first task, asking you a series of questions:
- Specify the folder/repository. Paste in the folder where your code for the project is. This can be a relative or an absolute path.
- Note: AI Dev won’t make any edits to this without double-checking with you first. It’ll copy this folder into a Docker container to use as a workspace.
- Specify the task. Write a task for the agent to perform, in the same level of specificity that you would for a new engineer seeing the codebase for the first time. Examples:
- “Update my README.md to describe how X feature works”
- “Fix TODO comments in my codebase”
- “Install Sentry in my project”
- Specify a folder to output the agent's results in. We’ll dump two files into the folder:
results.md
: a listing of Magnet Agent’s thought process
patch.diff
: a patch file for the changes that can be applied locally.
- Specify the OpenAI model to use. GPT-4 works the best, by far. But it’s expensive and we offer GPT-3.5-Turbo for you to tinker with AI Dev at a lower cost.
- Clarify the task description before starting? If you say yes, the agent will ask clarifying questions to use to improve your task before diving into it. This can help AI Dev complete the task more reliably.
After you fill that in, the agent will work on your task, which typically takes 2-3 minutes.
Thoughts & Tools
It’ll list out its thought process, along with the set of tools that it’s using along the way, such as:
AskHumanTool
- To ask you a question about the task if it gets stuck.
SearchTool
, DirectoryReadTool
- To search through the files in your project.