Compare commits

...

3 Commits

Author SHA1 Message Date
lorenzejay
00342c405f Merge branch 'main' of github.com:crewAIInc/crewAI into lorenze/crewai-create-tool-cli 2025-07-09 14:06:55 -07:00
lorenzejay
323027e597 Merge branch 'main' of github.com:crewAIInc/crewAI into lorenze/crewai-create-tool-cli 2025-07-08 13:35:06 -07:00
lorenzejay
6d6cdc7844 feat: extend create command to support tool creation
Updated the CLI to allow the creation of tools in addition to crews and flows. The command now accepts a new argument type "tool" and includes appropriate error handling for invalid types. This enhancement improves the flexibility of the CLI for users managing various components.
2025-07-08 13:31:45 -07:00
3 changed files with 11 additions and 8 deletions

View File

@@ -40,7 +40,7 @@ This installs the tool and adds it to `pyproject.toml`.
To create a new tool project:
```bash
crewai tool create <tool-name>
crewai create tool <tool-name>
```
This generates a scaffolded tool project locally.
@@ -95,7 +95,7 @@ Deletion is permanent. Deleted tools cannot be restored or re-installed.
## Security Checks
Every published version undergoes automated security checks, and are only available to install after they pass.
Every published version undergoes automated security checks, and are only available to install after they pass.
You can check the security check status of a tool at:

View File

@@ -40,7 +40,7 @@ Isso instala a ferramenta e a adiciona ao `pyproject.toml`.
Para criar um novo projeto de ferramenta:
```bash
crewai tool create <nome-da-ferramenta>
crewai create tool <nome-da-ferramenta>
```
Isso gera um projeto de ferramenta estruturado localmente.
@@ -104,4 +104,4 @@ Você pode verificar o status das verificações de segurança de uma ferramenta
<Card title="Precisa de ajuda?" icon="headset" href="mailto:support@crewai.com">
Entre em contato com nossa equipe de suporte para assistência com integração de API ou resolução de problemas.
</Card>
</Card>

View File

@@ -33,18 +33,21 @@ def crewai():
@crewai.command()
@click.argument("type", type=click.Choice(["crew", "flow"]))
@click.argument("type", type=click.Choice(["crew", "flow", "tool"]))
@click.argument("name")
@click.option("--provider", type=str, help="The provider to use for the crew")
@click.option("--skip_provider", is_flag=True, help="Skip provider validation")
def create(type, name, provider, skip_provider=False):
"""Create a new crew, or flow."""
"""Create a new crew, flow, or tool."""
if type == "crew":
create_crew(name, provider, skip_provider)
elif type == "flow":
create_flow(name)
elif type == "tool":
tool_cmd = ToolCommand()
tool_cmd.create(name)
else:
click.secho("Error: Invalid type. Must be 'crew' or 'flow'.", fg="red")
click.secho("Error: Invalid type. Must be 'crew', 'flow', or 'tool'.", fg="red")
@crewai.command()
@@ -357,7 +360,7 @@ def chat():
and using the Chat LLM to generate responses.
"""
click.secho(
"\nStarting a conversation with the Crew\n" "Type 'exit' or Ctrl+C to quit.\n",
"\nStarting a conversation with the Crew\nType 'exit' or Ctrl+C to quit.\n",
)
run_chat()