mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-07 15:18:29 +00:00
* feat: Start migrating to UV * feat: add uv to flows * feat: update docs on Poetry -> uv * feat: update docs and uv.locl * feat: update tests and github CI * feat: run ruff format * feat: update typechecking * feat: fix type checking * feat: update python version * feat: type checking gic * feat: adapt uv command to run the tool repo * Adapt tool build command to uv * feat: update logic to let only projects with crew to be deployed * feat: add uv to tools * fix; tests * fix: remove breakpoint * fix :test * feat: add crewai update to migrate from poetry to uv * fix: tests * feat: add validation for ˆ character on pyproject * feat: add run_crew to pyproject if doesnt exist * feat: add validation for poetry migration * fix: warning --------- Co-authored-by: Vinicius Brasil <vini@hey.com>
149 lines
2.8 KiB
Plaintext
149 lines
2.8 KiB
Plaintext
---
|
|
title: CLI
|
|
description: Learn how to use the CrewAI CLI to interact with CrewAI.
|
|
icon: terminal
|
|
---
|
|
|
|
# CrewAI CLI Documentation
|
|
|
|
The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you to create, train, run, and manage crews and pipelines.
|
|
|
|
## Installation
|
|
|
|
To use the CrewAI CLI, make sure you have CrewAI installed:
|
|
|
|
```shell
|
|
pip install crewai
|
|
```
|
|
|
|
## Basic Usage
|
|
|
|
The basic structure of a CrewAI CLI command is:
|
|
|
|
```shell
|
|
crewai [COMMAND] [OPTIONS] [ARGUMENTS]
|
|
```
|
|
|
|
## Available Commands
|
|
|
|
### 1. Create
|
|
|
|
Create a new crew or pipeline.
|
|
|
|
```shell
|
|
crewai create [OPTIONS] TYPE NAME
|
|
```
|
|
|
|
- `TYPE`: Choose between "crew" or "pipeline"
|
|
- `NAME`: Name of the crew or pipeline
|
|
- `--router`: (Optional) Create a pipeline with router functionality
|
|
|
|
Example:
|
|
```shell
|
|
crewai create crew my_new_crew
|
|
crewai create pipeline my_new_pipeline --router
|
|
```
|
|
|
|
### 2. Version
|
|
|
|
Show the installed version of CrewAI.
|
|
|
|
```shell
|
|
crewai version [OPTIONS]
|
|
```
|
|
|
|
- `--tools`: (Optional) Show the installed version of CrewAI tools
|
|
|
|
Example:
|
|
```shell
|
|
crewai version
|
|
crewai version --tools
|
|
```
|
|
|
|
### 3. Train
|
|
|
|
Train the crew for a specified number of iterations.
|
|
|
|
```shell
|
|
crewai train [OPTIONS]
|
|
```
|
|
|
|
- `-n, --n_iterations INTEGER`: Number of iterations to train the crew (default: 5)
|
|
- `-f, --filename TEXT`: Path to a custom file for training (default: "trained_agents_data.pkl")
|
|
|
|
Example:
|
|
```shell
|
|
crewai train -n 10 -f my_training_data.pkl
|
|
```
|
|
|
|
### 4. Replay
|
|
|
|
Replay the crew execution from a specific task.
|
|
|
|
```shell
|
|
crewai replay [OPTIONS]
|
|
```
|
|
|
|
- `-t, --task_id TEXT`: Replay the crew from this task ID, including all subsequent tasks
|
|
|
|
Example:
|
|
```shell
|
|
crewai replay -t task_123456
|
|
```
|
|
|
|
### 5. Log-tasks-outputs
|
|
|
|
Retrieve your latest crew.kickoff() task outputs.
|
|
|
|
```shell
|
|
crewai log-tasks-outputs
|
|
```
|
|
|
|
### 6. Reset-memories
|
|
|
|
Reset the crew memories (long, short, entity, latest_crew_kickoff_outputs).
|
|
|
|
```shell
|
|
crewai reset-memories [OPTIONS]
|
|
```
|
|
|
|
- `-l, --long`: Reset LONG TERM memory
|
|
- `-s, --short`: Reset SHORT TERM memory
|
|
- `-e, --entities`: Reset ENTITIES memory
|
|
- `-k, --kickoff-outputs`: Reset LATEST KICKOFF TASK OUTPUTS
|
|
- `-a, --all`: Reset ALL memories
|
|
|
|
Example:
|
|
```shell
|
|
crewai reset-memories --long --short
|
|
crewai reset-memories --all
|
|
```
|
|
|
|
### 7. Test
|
|
|
|
Test the crew and evaluate the results.
|
|
|
|
```shell
|
|
crewai test [OPTIONS]
|
|
```
|
|
|
|
- `-n, --n_iterations INTEGER`: Number of iterations to test the crew (default: 3)
|
|
- `-m, --model TEXT`: LLM Model to run the tests on the Crew (default: "gpt-4o-mini")
|
|
|
|
Example:
|
|
```shell
|
|
crewai test -n 5 -m gpt-3.5-turbo
|
|
```
|
|
|
|
### 8. Run
|
|
|
|
Run the crew.
|
|
|
|
```shell
|
|
crewai run
|
|
```
|
|
<Note>
|
|
Make sure to run these commands from the directory where your CrewAI project is set up.
|
|
Some commands may require additional configuration or setup within your project structure.
|
|
</Note>
|