mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-14 18:48:29 +00:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user