Installation
Coding agent setup
Set up CrewAI in your coding agent
Copy a ready-to-paste setup prompt for Claude Code, Codex, Cursor, or any coding agent. It installs the official CrewAI skills, checks the CLI, and points the agent at the right docs before it edits code.
Watch: Building CrewAI Agents & Flows with Coding Agent Skills
Section titled “Watch: Building CrewAI Agents & Flows with Coding Agent Skills”Video Tutorial
Section titled “Video Tutorial”Watch this video tutorial for a step-by-step demonstration of the installation process:
Text Tutorial
Section titled “Text Tutorial”CrewAI uses the uv as its dependency management and package handling tool. It simplifies project setup and execution, offering a seamless experience.
If you haven’t installed uv yet, follow step 1 to quickly get it set up on your system, else you can skip to step 2.
- Install uv
-
On macOS/Linux:
Use
curlto download the script and execute it withsh:Terminal window curl -LsSf https://astral.sh/uv/install.sh | shIf your system doesn’t have
curl, you can usewget:Terminal window wget -qO- https://astral.sh/uv/install.sh | sh -
On Windows:
Use
irmto download the script andiexto execute it:Terminal window powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"If you run into any issues, refer to UV’s installation guide for more information.
-
- Install CrewAI 🚀
-
Run the following command to install
crewaiCLI:Terminal window uv tool install crewai -
To verify that
crewaiis installed, run:Terminal window uv tool list -
You should see something like:
Terminal window crewai v0.102.0- crewai -
If you need to update
crewai, run:Terminal window uv tool install crewai --upgrade
-
Creating a CrewAI Project
Section titled “Creating a CrewAI Project”crewai create crew now creates a JSON-first crew project. Agents live in agents/*.jsonc, tasks and crew-level settings live in crew.jsonc, and crewai run loads that JSON definition directly.
- Generate Project Scaffolding
-
Run the
crewaiCLI command:Terminal window crewai create crew <your_project_name> -
This creates a new project with the following structure:
my_project/├── .gitignore├── .env├── agents/│ └── researcher.jsonc├── crew.jsonc├── knowledge/├── pyproject.toml├── README.md├── skills/└── tools/ -
If you need the older Python/YAML scaffold with
crew.py,config/agents.yaml, andconfig/tasks.yaml, run:Terminal window crewai create crew <your_project_name> --classic
-
- Customize Your Project
-
Your project will contain these essential files:
File Purpose crew.jsoncConfigure the crew, task order, process, and input defaults agents/*.jsoncDefine each agent’s role, goal, backstory, LLM, tools, and behavior .envStore API keys and environment variables tools/Optional Python files for custom:<name>toolsknowledge/Optional knowledge files for agents skills/Optional skill files applied to the crew -
Start by editing
crew.jsoncand the files inagents/to define your crew’s behavior. -
Use
{placeholder}values in agent and task text, then set defaults increw.jsoncunderinputs. When you runcrewai run, the CLI prompts for any missing values. -
Keep sensitive information like API keys in
.env.
-
- Run your Crew
- Before you run your crew, make sure to run:
Terminal window crewai install - If you need to install additional packages, use:
Terminal window uv add <package-name> - To run your crew, execute the following command in the root of your project:
Terminal window crewai run
- Before you run your crew, make sure to run: