CLI
Using the Command Line Interface
The Peeps AI Command-Line Interface (CLI) is a powerful tool designed to simplify the process of creating, managing, and running workflows. Whether you're orchestrating simple automations or complex multi-agent systems, the CLI provides a streamlined, efficient way to control your Peeps AI projects.
Prerequisites
Before running a workflow, ensure that:
Python 3.10 - 3.12 is installed on your system.
Peeps AI is installed via:
pip install peepsai
Your project structure is set up correctly with agents and tasks defined in YAML configuration files.
Project Initialization
To start a new Peeps AI project:
peepsai create group <project_name>
This command generates a project folder with the essential files:
agents.yaml
- Defines AI agents and their roles.tasks.yaml
- Outlines the tasks each agent will handle.group.py
&main.py
- Core Python files for defining group logic and running workflows.
Basic CLI Commands
Running a Workflow
The primary command to execute your workflow:
peepsai run
This will trigger the workflow as defined in your configuration files. Alternatively, you can run directly with Python:
python src/<project_name>/main.py
Specifying Input Parameters
You can pass dynamic inputs to your agents:
peepsai run --inputs '{"topic": "AI Automation", "deadline": "2024-12-31"}'
This allows for flexible task execution based on real-time data.
Verbose Mode
To enable detailed logging during workflow execution:
peepsai run --verbose
Verbose mode is helpful for debugging complex workflows, as it provides step-by-step logs of agent interactions and task progress.
Managing Workflows
Listing Available Groups
peepsai list groups
Displays all defined groups within your project.
Inspecting Group Details
peepsai inspect group <group_name>
Provides details about agents, tasks, and configurations within a specific group.
Running Specific Tasks
If you want to execute a specific task without running the entire workflow:
peepsai run --task <task_name>
This is useful for testing individual components during development.
Advanced CLI Features
Custom Configuration Files
Override default settings with custom configurations:
peepsai run --config path/to/custom_config.yaml
This enables you to run the same workflow with different agent behaviors or task definitions.
Parallel Execution
Leverage multi-agent parallelism:
peepsai run --parallel
This command allows tasks to run concurrently, reducing execution time for large workflows.
Error Handling and Troubleshooting
Common Error:
ModuleNotFoundError: No module named 'tiktoken'
Fix: Install missing dependencies:
pip install 'peepsai[embeddings]'
Workflow Crashes: Check the logs with:
peepsai run --verbose
This provides detailed error traces to identify issues quickly.
Automating Workflow Execution
For continuous deployment or automation pipelines, integrate Peeps AI workflows with cron jobs or CI/CD systems:
0 * * * * /usr/bin/python3 /path/to/project/src/project_name/main.py >> /var/log/peepsai.log 2>&1
This runs the workflow every hour and logs outputs for monitoring.
Last updated