diff --git a/docs/concepts/cli.mdx b/docs/concepts/cli.mdx index 8297ee6aa..5d2fecff1 100644 --- a/docs/concepts/cli.mdx +++ b/docs/concepts/cli.mdx @@ -6,7 +6,7 @@ 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. +The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you to create, train, run, and manage crews, pipelines and flows. ## Installation @@ -146,3 +146,32 @@ crewai run 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. API Keys + +When running ```crewai create crew``` command, the CLI will prompt for API keys. It will first show you the top 5 most common LLM providers and ask you to select one. + +#### Initial API key providers + +The CLI will initiallyprompt for API keys for the following services: + +* OpenAI +* Groq +* Anthropic +* Google Gemini + +When you select a provider, the CLI will prompt you to enter your API key. + +#### Other Options + +If you select option 6, 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: + +* [LiteLLM Providers](https://docs.litellm.ai/docs/providers) + + + diff --git a/src/crewai/cli/create_crew.py b/src/crewai/cli/create_crew.py index 23088cb58..5803f0ac1 100644 --- a/src/crewai/cli/create_crew.py +++ b/src/crewai/cli/create_crew.py @@ -94,7 +94,13 @@ def create_crew(name, parent_folder=None): type=str ) - env_vars = {api_key_var: "YOUR_API_KEY_HERE"} + api_key_value = click.prompt( + f"Enter your {provider.capitalize()} API key", + type=str, + hide_input=True + ) + + env_vars = {api_key_var: api_key_value} write_env_file(folder_path, env_vars) env_vars['MODEL'] = model