Agents SDK CLI Reference
The Agents SDK provides a command-line interface (CLI) that lets you create, manage, and serve agents efficiently. This reference guide covers the various commands available in the CLI and how to use them.
Installation
Before using the CLI, make sure you have installed the Agents SDK. If not, you can install it using pip
:
pip install zetaalpha.rag-agents
CLI Commands
Below is a list of all available commands in the Agents SDK CLI, along with examples and explanations.
init
Initializes a new Agents SDK project. This command helps set up a new directory with the necessary files and structure for your agent project.
Usage:
rag_agents init [PROJECT_DIR]
Parameters:
PROJECT_DIR
: (Required) The directory where the project will be initialized. If not provided, a wizard will prompt for the directory name.
Example:
rag_agents init my_agents_project
new
Creates a new agent in the specified project directory. This command will generate the boilerplate code for a new agent, including the necessary configurations.
Usage:
rag_agents new [AGENT_NAME] [--project-dir PROJECT_DIR]
Parameters:
AGENT_NAME
: (Required) The name of the agent to create. If not provided or if the name already exists in the project directory, a wizard will prompt for the agent name.--project-dir
: (Optional) The project directory where the agent will be created. If not provided, the current directory will be used if it's a valid project directory. Otherwise, a wizard will prompt for the project directory.
Example:
rag_agents new "my_new_agent" --project-dir my_agents_project
new-dependency
Creates a new dependency in the specified project directory. This command will generate the necessary factory and class for the new dependency.
Usage:
rag_agents new-dependency [DEPENDENCY_NAME] [--project-dir PROJECT_DIR]
Parameters:
DEPENDENCY_NAME
: (Required) The name of the dependency to create. If not provided or if the name already exists in the project directory, a wizard will prompt for the dependency name.--project-dir
: (Optional) The project directory where the dependency will be created. If not provided, the current directory will be used if it's a valid project directory. Otherwise, a wizard will prompt for the project directory.
Example:
rag_agents new_dependency "my_new_dependency" --project-dir my_agents_project
serve
Starts the local REST API server for the agents project. Use this command to serve your agents as an API locally.
Usage:
rag_agents serve [PROJECT_DIR] [OPTIONS]
Parameters:
PROJECT_DIR
: (Optional) The project directory where the dependency will be created. If not provided, the current directory will be used if it's a valid project directory. Otherwise, a wizard will prompt for the project directory.--setup-src
: (Optional) Path of the agent setup configuration. Only needed when using a non-standard project layout.--secret-setup-src
: (Optional) Path of the secret agent setup configuration. Only needed when using a non-standard project layout.--reload
: (Optional) Enable auto-reload. This will automatically reload the server when changes are detected in the code.--host
: (Optional) Host to listen on. Default islocalhost
.
Example:
rag_agents serve my_agents_project --host 0.0.0.0 --reload
dev
Starts the Debugging Environment for the agents project. Use this command to run the development UI for testing and debugging agents.
Usage:
rag_agents dev [PROJECT_DIR] [OPTIONS]
Parameters:
PROJECT_DIR
: (Optional) The project directory where the dependency will be created. If not provided, the current directory will be used if it's a valid project directory. Otherwise, a wizard will prompt for the project directory.--setup-src
: (Optional) Path of the agent setup configuration file. Only needed when using a non-standard project layout.--secret-setup-src
: (Optional) Path of the secret agent setup configuration file. Only needed when using a non-standard project layout.--reload
: (Optional) Enable auto-reload. This will automatically reload the UI when changes are detected in the code.--storage-backend
: (Optional) Storage backend to save the chat traces and evaluation results. Supported values aredisk
,s3
,azure
.--storage-path
: (Optional) Base path where the chat traces and evaluation results will be saved. This needs to be a valid path on the selected storage backend.
Example:
rag_agents dev my_agents_project --reload --storage-backend disk --storage-path ./agent-traces
version
Prints the current version of the SDK.
Usage:
rag_agents version