sw-agent-init CLI
sw-agent-init CLI
Interactive project generator for creating new SignalWire agent projects with customizable features.
Overview
The sw-agent-init tool scaffolds new SignalWire agent projects with:
- Pre-configured project structure
- Agent class with example SWAIG tool
- Environment configuration (.env files)
- Optional debug webhooks for development
- Test scaffolding with pytest
- Virtual environment setup
Command Syntax
Quick Reference
Modes
Interactive Mode
Run without arguments for guided setup:
Interactive mode prompts for:
- Project name
- Project directory
- Agent type (basic or full)
- Feature selection
- SignalWire credentials
- Virtual environment creation
Quick Mode
Provide a project name for quick setup with defaults:
Quick mode uses environment variables for credentials if available.
Options
Agent Types
Basic Agent
Minimal setup for getting started:
- Single agent class
- Example SWAIG tool
- Test scaffolding
- Environment configuration
Full Agent
All features enabled:
- Debug webhooks (console output)
- Post-prompt summary handling
- Web UI with status page
- Example SWAIG tool
- Test scaffolding
- Basic authentication
Features
Toggle features in interactive mode:
Platforms
The --platform option generates platform-specific project structures:
Local (Default)
Standard Python server deployment:
AWS Lambda
Generates AWS Lambda function structure with handler:
Generated structure includes:
handler.py- Lambda handler entry pointtemplate.yaml- SAM template for deployment- Platform-specific requirements
Google Cloud Functions
Generates Google Cloud Function structure:
Generated structure includes:
main.py- Cloud Function entry point- Platform-specific requirements
Azure Functions
Generates Azure Function structure:
Generated structure includes:
function_app.py- Azure Function entry pointhost.json- Azure Functions host configuration- Platform-specific requirements
Generated Project Structure
Local Platform
Serverless Platforms
Serverless projects include platform-specific entry points instead of app.py:
Environment Variables
The tool auto-detects SignalWire credentials from environment:
Examples
Create Basic Agent
Create Full-Featured Agent
Create Without Virtual Environment
Create in Specific Directory
Create AWS Lambda Project
Create Google Cloud Function Project
Create Azure Function Project
Running the Generated Agent
After creation:
Output:
Testing the Generated Agent
Run the test suite:
Or use swaig-test directly:
Customizing the Agent
Edit agents/main_agent.py to customize:
- Prompts and personality
- Voice and language settings
- SWAIG tools and handlers
- Debug and webhook configuration
See the Building Agents chapter for detailed guidance.