Skip to main content
Since release 0.140.0, CrewAI AMP started a process of migrating their login provider. As such, the authentication flow via CLI was updated. Users that use Google to login, or that created their account after July 3rd, 2025 will be unable to log in with older versions of the crewai library.

Overview

The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you to create, train, run, and manage crews & flows.

Installation

To use the CrewAI CLI, make sure you have CrewAI installed:
Terminal

Basic Usage

The basic structure of a CrewAI CLI command is:
Terminal

Available Commands

1. Create

Create a new crew, flow, standalone Agent (experimental), tool, skill, or template project.
Terminal
  • TYPE: crew, flow, agent (experimental), tool, skill, or template
  • NAME: Name of the project, tool handle, skill, or template

Crew

Terminal
By default, crewai create crew creates a JSON-first crew project with crew.jsonc and agents/*.jsonc. Use crewai create crew my_new_crew --classic only when you want the older Python/YAML scaffold with crew.py, config/agents.yaml, and config/tasks.yaml.

Flow

Terminal

Run it now

When you create a crew or a flow in a terminal, crewai create offers to run the new project:
Press Enter to start crewai run in the project folder. crewai create then exits with the run’s exit code. The first run also installs the project’s dependencies. Answer n to skip the run, and the CLI prints the command for later:
crewai create does not ask with CREWAI_DMN=true, or when stdin or stdout is not a terminal, as when a coding agent or a CI job runs it. Creating a tool, a skill or a template never asks.

Agent (Experimental)

Terminal
Standalone Agent projects default to agent.yaml. Use --format json for configuration in JSON, or --format python for an exported Python Agent. This experimental project/loading contract may change and requires matching preview CLI/SDK builds. See Standalone Agent Projects for setup, tools, runtime inputs, and deployment limits.

Tool

Scaffold a custom tool repository:
Terminal

Skill

Scaffold an agent skill. Inside a crew project (where pyproject.toml exists), the skill is created under ./skills/:
Terminal
Use --no-project to create the skill in the current directory instead of ./skills/.

Template

Add a remote project template to the current directory:
Terminal
Use --output-dir to override the output folder name (defaults to the template name).

Deprecated create aliases

These older commands still work but print a yellow deprecation warning. Prefer the crewai create <type> forms above. Lifecycle commands are unchanged — for example crewai tool install, crewai skill publish, and crewai template list stay under their resource groups.

Deprecated flag aliases

These older snake_case flags still work but are hidden from --help. Prefer the kebab-case forms documented in each command section below.

2. Version

Show the installed version of CrewAI.
Terminal
  • --tools: (Optional) Show the installed version of CrewAI tools
Example:
Terminal

3. Train

Train the crew for a specified number of iterations.
Terminal
  • -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:
Terminal

4. Replay

Replay the crew execution from a specific task.
Terminal
  • -t, --task-id TEXT: Replay the crew from this task ID, including all subsequent tasks
Example:
Terminal

5. Log-tasks-outputs

Retrieve your latest crew.kickoff() task outputs.
Terminal

6. Reset-memories

Reset the crew memories (long, short, entity, latest_crew_kickoff_outputs).
Terminal
  • -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
  • -kn, --knowledge: Reset KNOWLEDGE storage
  • -akn, --agent-knowledge: Reset AGENT KNOWLEDGE storage
  • -a, --all: Reset ALL memories
Example:
Terminal

7. Test

Test the crew and evaluate the results.
Terminal
  • -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:
Terminal

8. Run

Run the crew or flow.
Terminal
Starting from version 0.103.0, the crewai run command can be used to run both standard crews and flows. For flows, it automatically detects the type from pyproject.toml and runs the appropriate command. This is now the recommended way to run both crews and flows.
Before a crew or a Python flow starts, crewai run checks that the API key each of its models needs is set, either in your environment or in the .env crewAI loads: the project’s own, or else the nearest one in a parent folder. For a JSON crew, it reads the llm, manager_llm and function_calling_llm fields of crew.jsonc and of the agent files it lists; an agent without an llm runs on MODEL, or else on crewAI’s default model, gpt-4.1-mini, so that model is checked too. For a Python crew or flow, it reads MODEL and any llm: in config/agents.yaml, and checks gpt-4.1-mini when neither names a model. An empty value or the YOUR_API_KEY placeholder counts as missing. At a terminal, the CLI asks for each missing key. What you paste is hidden, saved to the project’s .env, and used by the run that starts next. Press Enter to skip a key. Without a terminal, for example under a coding agent or in CI, the CLI prints the line to add and starts the run anyway. It also prints the line, rather than saving, when the .env is in a parent folder or is a symbolic link:
The check covers providers that take a single API key, such as OpenAI, Anthropic, Gemini and Groq. It skips Azure, Bedrock and watsonx, local models such as Ollama, and declarative flows. It does not read an llm set in Python code, and when a project’s code sets one, it does not check the default model either. A .env that is not a regular file, such as a named pipe a secrets manager serves, is left for the run to read and is not checked. Before the CLI saves a key, it makes .env readable by you only; when it cannot, it uses the key for this run only and says so instead of saving it. When the project’s .env sends requests to another host through a setting your own environment does not have, such as OPENAI_BASE_URL, OPENAI_API_BASE or HTTPS_PROXY, or a JSON crew’s files set a base_url, api_base or endpoint anywhere, such as in an llm, its client_params, a planning_llm or an embedder’s config, the prompt names each host before it asks. Paste a key only if you trust that host. If a JSON crew still fails because an API key is not set, for example the key of a model this check skips, the run stops with the same line instead of a traceback. At a terminal, the CLI first asks for that key as above, then builds the crew again and runs it once more from its first task, so tasks that already finished run again; press Enter to stop instead.
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.

9. Chat

Starting in version 0.98.0, when you run the crewai chat command, you start an interactive session with your crew. The AI assistant will guide you by asking for necessary inputs to execute the crew. Once all inputs are provided, the crew will execute its tasks. After receiving the results, you can continue interacting with the assistant for further instructions or questions.
Terminal
Ensure you execute these commands from your CrewAI project’s root directory.
IMPORTANT: Set the chat_llm property in your crew definition to enable this command.For JSON-first crews, add it to crew.jsonc:
For classic Python/YAML crews, set it in crew.py:

10. Deploy

Deploy the crew or flow to CrewAI AMP.
  • Authentication: You need to be authenticated to deploy to CrewAI AMP. You can login or create an account with:
    Terminal
  • Create a deployment: Once you are authenticated, you can create a deployment for your crew or flow from the root of your localproject.
    Terminal
    • Reads your local project configuration.
    • Prompts you to confirm the environment variables (like OPENAI_API_KEY, SERPER_API_KEY) found locally. These will be securely stored with the deployment on the Enterprise platform. Ensure your sensitive keys are correctly configured locally (e.g., in a .env file) before running this.
    • --zip uploads the project as a ZIP even when it has a git origin, without fetching from it.
    • When the project is a git repository with at least one commit, every ZIP upload, at create or push, prints the local commit it was built from and whether the project directory had uncommitted changes.

11. Organization Management

Manage your CrewAI AMP organizations.
Terminal

Commands:

  • list: List all organizations you belong to
Terminal
  • current: Display your currently active organization
Terminal
  • switch: Switch to a specific organization
Terminal
You must be authenticated to CrewAI AMP to use these organization management commands.
  • Create a deployment (continued):
    • Links the deployment to the corresponding remote GitHub repository (it usually detects this automatically).
  • Deploy the Crew: Once you are authenticated, you can deploy your crew or flow to CrewAI AMP.
    Terminal
    • Initiates the deployment process on the CrewAI AMP platform.
    • Upon successful initiation, it will output the Deployment created successfully! message along with the Deployment Name and a unique Deployment ID (UUID).
    • Push keeps the source used at create. Adding a git origin later does not switch a ZIP deployment to git.
  • Deployment Status: You can check the status of your deployment with:
    Terminal
    This fetches the latest deployment status of your most recent deployment attempt (e.g., Building Images for Crew, Deploy Enqueued, Online). If the deployment failed, it also prints the error and a suggested fix.
  • Deployment Logs: You can check the logs of your deployment with:
    Terminal
    This streams the deployment logs to your terminal.
  • List deployments: You can list all your deployments with:
    Terminal
    This lists all your deployments.
  • Delete a deployment: You can delete a deployment with:
    Terminal
    This deletes the deployment from the CrewAI AMP platform.
  • Help Command: You can get help with the CLI with:
    Terminal
    This shows the help message for the CrewAI Deploy CLI.
Watch this video tutorial for a step-by-step demonstration of deploying your crew to CrewAI AMP using the CLI.

11. Login

Authenticate with CrewAI AMP using a secure device code flow (no email entry required).
Terminal
What happens:
  • A verification URL and short code are displayed in your terminal
  • Your browser opens to the verification URL
  • Enter/confirm the code to complete authentication
Notes:
  • The OAuth2 provider and domain are configured via crewai config (defaults use login.crewai.com)
  • After successful login, the CLI also attempts to authenticate to the Tool Repository automatically
  • If you reset your configuration, run crewai login again to re-authenticate

12. API Keys

When running the crewai create crew command, the CLI shows a list of available LLM providers, followed by model selection for your chosen provider. The selected model is saved in the generated .env file and each generated agent JSONC file can set its own llm. crewai create flow asks the same questions in a terminal and saves the model as MODEL in the flow’s .env, which the starter crew’s agents use. With --provider, it skips the provider and model questions. Pass a provider the picker lists, such as anthropic or bedrock, to use its first listed model, or a full provider/model string for any other model. A declarative flow (--declarative) asks nothing and names no key in its next steps, because its starter calls no model. Once you’ve selected an LLM provider and model, you will be prompted for API keys. At a terminal, what you type for a key or secret is hidden; other values, such as an endpoint URL, a region, or an Azure deployment name, stay visible. Press Enter to skip a prompt. A skipped key is not saved. Unless the key is already set in your environment, the CLI prints the exact line to add to .env before crewai run:
Values that have a default, such as the AWS region and the Azure API version, are not listed. If your agents use models from more than one provider, the CLI asks once for each provider’s keys, and the first agent’s model is saved as MODEL. The generated pyproject.toml also depends on the crewai extras that the models you pick need, for example crewai[tools,anthropic] for Anthropic, crewai[tools,google-genai] for Gemini, or crewai[tools,litellm] for providers that crewAI reaches through LiteLLM, such as Groq. crewAI also runs some model names through LiteLLM instead of the provider’s SDK, such as bedrock/claude-sonnet-4-5-20250929-v1:0, so those add litellm too. crewai install, or the first crewai run, installs them. An OpenAI-only project depends on crewai[tools] alone. If you later switch an agent to another model, add the extra it needs yourself, for example uv add "crewai[anthropic]". With --skip-provider, or with CREWAI_DMN=true, the CLI asks for no keys and writes none. crewai create flow also asks nothing when it is not running in a terminal, as when a coding agent or a CI job runs it. In the default JSON crew, agents use openai/gpt-6-luna unless you pass --provider. A flow saves the --provider model as MODEL and otherwise runs on crewAI’s default OpenAI model. The next steps name each variable that is not already set in your environment:

Available LLM Providers

Here’s a list of the most popular LLM providers suggested by the CLI:
  • OpenAI
  • Groq
  • Anthropic
  • Google Gemini
  • SambaNova
When you select a provider, the CLI will then show you available models for that provider and prompt you to enter your API key.

Other Options

If you select “other”, you will be able to select from a list of LiteLLM supported providers. When you select a provider, the CLI will prompt you to enter the Key name and the API key. See the following link for each provider’s key name:

13. Configuration Management

Manage CLI configuration settings for CrewAI.
Terminal

Commands:

  • list: Display all CLI configuration parameters
Terminal
  • set: Set a CLI configuration parameter
Terminal
  • reset: Reset all CLI configuration parameters to default values
Terminal

Available Configuration Parameters

  • enterprise_base_url: Base URL of the CrewAI AMP instance
  • oauth2_provider: OAuth2 provider used for authentication (e.g., workos, okta, auth0)
  • oauth2_audience: OAuth2 audience value, typically used to identify the target API or resource
  • oauth2_client_id: OAuth2 client ID issued by the provider, used during authentication requests
  • oauth2_domain: OAuth2 provider’s domain (e.g., your-org.auth0.com) used for issuing tokens

Examples

Display current configuration:
Terminal
Example output: Set the enterprise base URL:
Terminal
Set OAuth2 provider:
Terminal
Set OAuth2 domain:
Terminal
Reset all configuration to defaults:
Terminal
After resetting configuration, re-run crewai login to authenticate again.

14. Trace Management

Manage trace collection preferences for your Crew and Flow executions.
Terminal

Commands:

  • enable: Enable trace collection for crew/flow executions
Terminal
  • disable: Disable trace collection for crew/flow executions
Terminal
  • status: Show current trace collection status
Terminal

How Tracing Works

Trace collection is controlled by checking three settings in priority order:
  1. Explicit flag in code (highest priority - can enable OR disable):
    • tracing=True will always enable tracing (overrides everything)
    • tracing=False will always disable tracing (overrides everything)
    • tracing=None or omitted will check lower priority settings
  2. Environment variable (second priority):
    • Checked only if tracing is not explicitly set to True or False in code
    • Set to true or 1 to enable tracing
  3. User preference (lowest priority):
    Terminal
    • Checked only if tracing is not set in code and CREWAI_TRACING_ENABLED is not set to true
    • Running crewai traces enable is sufficient to enable tracing by itself
    • The first-run prompt (Would you like to view your execution traces?) also updates this preference
To enable tracing, use any one of these methods:
  • Set tracing=True in your Crew/Flow code, OR
  • Add CREWAI_TRACING_ENABLED=true to your .env file, OR
  • Run crewai traces enable
To disable tracing, use any ONE of these methods:
  • Set tracing=False in your Crew/Flow code (overrides everything), OR
  • Remove or set to false the CREWAI_TRACING_ENABLED env var, OR
  • Run crewai traces disable
Higher priority settings override lower ones.
For more information about tracing, see the Tracing documentation.
CrewAI CLI handles authentication to the Tool Repository automatically when adding packages to your project. Just append crewai before any uv command to use it. E.g. crewai uv add requests. For more information, see Tool Repository docs.
Configuration settings are stored in ~/.config/crewai/settings.json. Some settings like organization name and UUID are read-only and managed through authentication and organization commands. Tool repository related settings are hidden and cannot be set directly by users.