Added docs for new CLI provider + fixed missing API prompt

This commit is contained in:
Rip&Tear
2024-10-18 10:23:34 +08:00
parent a5f70d2307
commit f6f430b26a
2 changed files with 37 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ icon: terminal
# CrewAI CLI Documentation # 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 ## Installation
@@ -146,3 +146,32 @@ crewai run
Make sure to run these commands from the directory where your CrewAI project is set up. 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. Some commands may require additional configuration or setup within your project structure.
</Note> </Note>
### 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)

View File

@@ -94,7 +94,13 @@ def create_crew(name, parent_folder=None):
type=str 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) write_env_file(folder_path, env_vars)
env_vars['MODEL'] = model env_vars['MODEL'] = model