Skip to content

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.

View coding-agent guide

Watch: Building CrewAI Agents & Flows with Coding Agent Skills

Section titled “Watch: Building CrewAI Agents & Flows with Coding Agent Skills”

Watch this video tutorial for a step-by-step demonstration of the installation process:

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.

  1. Install uv
    • On macOS/Linux:

      Use curl to download the script and execute it with sh:

      Terminal window
      curl -LsSf https://astral.sh/uv/install.sh | sh

      If your system doesn’t have curl, you can use wget:

      Terminal window
      wget -qO- https://astral.sh/uv/install.sh | sh
    • On Windows:

      Use irm to download the script and iex to 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.

  2. Install CrewAI 🚀
    • Run the following command to install crewai CLI:

      Terminal window
      uv tool install crewai
    • To verify that crewai is 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

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.

  1. Generate Project Scaffolding
    • Run the crewai CLI 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, and config/tasks.yaml, run:

      Terminal window
      crewai create crew <your_project_name> --classic
  2. Customize Your Project
    • Your project will contain these essential files:

      FilePurpose
      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> tools
      knowledge/Optional knowledge files for agents
      skills/Optional skill files applied to the crew
    • Start by editing crew.jsonc and the files in agents/ to define your crew’s behavior.

    • Use {placeholder} values in agent and task text, then set defaults in crew.jsonc under inputs. When you run crewai run, the CLI prompts for any missing values.

    • Keep sensitive information like API keys in .env.

  3. 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