New Tool Radar

AI Agents & Automation

How to Scaffold a First CrewAI Crew Project With the CrewAI CLI

Run crewai create crew to scaffold a CrewAI project with agents, tasks, tools and YAML configuration files ready to edit.

Schematic diagram with three steps: Run crewai create crew, Open agents and tasks YAML, then Add the API key.

CrewAI projects start from the command line, not from a blank file. The CLI scaffolds a project folder with the structure the framework expects: YAML files for agents and tasks, a crew file, a tools folder and an entry point.

Before you start

You need Python 3.10 to 3.13 and pip, plus an API key for the model provider you will use. Install the framework first with pip install crewai, and add the tools package with pip install 'crewai[tools]' if the crew needs built-in tools.

Create the project with the CLI

Open a terminal, move to your projects folder, and run crewai create crew followed by the project name, for example latest-ai-development. The CLI creates the folder with .env for keys, src for the code, and config files for agents and tasks. The generated structure puts agents.yaml and tasks.yaml under src/<project>/config/, crew.py beside them, and main.py as the entry point.

Add the key and run the scaffold once

Open the .env file and add your model API key. Then run the project once with the default example to check the scaffold works before you change any agent or task. If the run fails, check the Python version and the key first: those two cause most first-run failures.

Worked example: Scaffolded project for a fictional research crew

Maple Research is a fictional research desk. Its first crew researches a topic and writes a briefing. The table shows the scaffolded files and what each one holds.

File What it holds
src/maple_research/config/agents.yaml The researcher and analyst agent definitions
src/maple_research/config/tasks.yaml The research task and the briefing task
src/maple_research/crew.py The crew class that joins agents and tasks
src/maple_research/main.py The entry point that runs the crew
.env The model API key

Expected result (UNTESTED): the CLI creates the folder structure above, and the default example run finishes with a briefing. We checked the CrewAI blog and PyPI pages, which describe the create command, the folder structure and the Python version range, but we did not run the scaffold on this machine.

Limits

The scaffold is a starting point: the example agents and tasks are generic and need to be rewritten for a real job. Keep API keys in .env and never commit that file. A crew run costs one model call per agent step, so a first run is a cost check as well as a code check.

Sources

See all