swaig-test
swaig-test
swaig-test
The swaig-test command loads an agent file and allows you to test SWAIG functions,
generate SWML output, and simulate serverless environments — all without deploying
to production. It supports both webhook and DataMap functions.
If no action flag is specified, swaig-test defaults to --list-tools.
Choose one action per invocation:
List all SWAIG functions registered on the agent.
List all agent classes discovered in the file. Useful for multi-agent files.
Generate and output the full SWML document. Combine with --raw for machine-readable JSON.
Execute a SWAIG function by name. Pass function arguments as --key value pairs
after the function name.
Enable verbose output with debug information, including raw result types and detailed post data.
Output raw JSON only, suppressing all logs. Designed for piping to jq or
other JSON processors.
Specify which agent class to load when the file contains multiple agents.
Mutually exclusive with --route.
Specify which agent to load by its registered route (e.g., /healthcare).
Mutually exclusive with --agent-class.
Use minimal post_data containing only the function arguments. This is the default behavior.
Use comprehensive fake call data including call_id, from, to, and other
fields that would normally be present in a real SignalWire request.
JSON string with custom post_data overrides merged into the request payload.
Simulated call type. Valid values:
"sip" — SIP-originated call"webrtc" — WebRTC-originated callSimulated call direction. Valid values:
"inbound" — incoming call"outbound" — outgoing callSimulated call state value.
Override the caller/from phone number in mock data.
Override the destination/to extension in mock data.
JSON string injected as userVariables in the mock request. Used to test
agents that customize behavior based on user variables.
JSON string injected as query parameters in the mock request. Used to test dynamic agents that read query parameters.
Add an HTTP header in KEY=VALUE format. Can be specified multiple times.
Override a specific value using dot-path notation (e.g., --override call.state=answered).
Can be specified multiple times.
Simulate a serverless platform environment. Valid values:
"lambda" — AWS Lambda"cgi" — CGI deployment"cloud_function" — Google Cloud Functions"azure_function" — Azure FunctionsThe simulator sets platform-specific environment variables so the agent generates correct webhook URLs for the target platform.
Set an environment variable in KEY=VALUE format. Can be specified multiple
times. Applied after --env-file.
Load environment variables from a file (one KEY=VALUE per line).
Run swaig-test agent.py --help-platforms for the full list. Key options per platform:
AWS Lambda: --aws-function-name, --aws-function-url, --aws-region, --aws-api-gateway-id, --aws-stage
CGI: --cgi-host (required), --cgi-script-name, --cgi-https, --cgi-path-info
Google Cloud: --gcp-project, --gcp-function-url, --gcp-region, --gcp-service
Azure: --azure-env, --azure-function-url
Show detailed documentation for all serverless platform options.
Show comprehensive usage examples covering all features.
Arguments are automatically type-converted: numeric values become integers or
floats, true/false become booleans, and everything else stays as a string.