Fix CLI documentation to reflect actual provider count and two-step process

- Update docs/concepts/cli.mdx to remove outdated 'top 5 most common LLM providers' reference
- Replace with accurate description of 12 available providers plus 'other' option
- Document the two-step process: select provider, then select model
- Add comprehensive test to prevent documentation drift in the future
- Test validates that docs stay in sync with actual CLI implementation

Fixes #3054

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-24 06:15:05 +00:00
parent c96d4a6823
commit 10a55bd210
2 changed files with 58 additions and 7 deletions

View File

@@ -285,25 +285,32 @@ Watch this video tutorial for a step-by-step demonstration of deploying your cre
### 11. API Keys
When running ```crewai create crew``` command, the CLI will first show you the top 5 most common LLM providers and ask you to select one.
When running ```crewai create crew``` command, the CLI will show you a list of available LLM providers to choose from, followed by model selection for your chosen provider.
Once you've selected an LLM provider, you will be prompted for API keys.
Once you've selected an LLM provider and model, you will be prompted for API keys.
#### Initial API key providers
#### Available LLM Providers
The CLI will initially prompt for API keys for the following services:
The CLI will show you the following LLM providers to choose from:
* OpenAI
* Groq
* Anthropic
* Google Gemini
* NVIDIA NIM
* Groq
* Hugging Face
* Ollama
* Watson
* AWS Bedrock
* Azure
* Cerebras
* SambaNova
When you select a provider, the CLI will prompt you to enter your API key.
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 option 6, you will be able to select from a list of LiteLLM supported providers.
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.

View File

@@ -0,0 +1,44 @@
import re
from pathlib import Path
from crewai.cli.constants import PROVIDERS
def test_cli_documentation_matches_providers():
"""Test that CLI documentation accurately reflects the available providers."""
docs_path = Path(__file__).parent.parent / "docs" / "concepts" / "cli.mdx"
with open(docs_path, 'r') as f:
docs_content = f.read()
assert "top 5" not in docs_content.lower(), "Documentation should not mention 'top 5' providers"
assert "5 most common" not in docs_content.lower(), "Documentation should not mention '5 most common' providers"
assert "list of available LLM providers" in docs_content or "following LLM providers" in docs_content, \
"Documentation should mention the availability of multiple LLM providers"
assert len(PROVIDERS) > 5, f"Expected more than 5 providers, but found {len(PROVIDERS)}"
key_providers = ["OpenAI", "Anthropic", "Gemini"]
for provider in key_providers:
assert provider in docs_content, f"Key provider {provider} should be mentioned in documentation"
def test_providers_list_matches_constants():
"""Test that the actual PROVIDERS list has the expected providers."""
expected_providers = [
"openai",
"anthropic",
"gemini",
"nvidia_nim",
"groq",
"huggingface",
"ollama",
"watson",
"bedrock",
"azure",
"cerebras",
"sambanova",
]
assert PROVIDERS == expected_providers, f"PROVIDERS list has changed. Expected {expected_providers}, got {PROVIDERS}"
assert len(PROVIDERS) == 12, f"Expected 12 providers, but found {len(PROVIDERS)}"