swaig-test
swaig-test
The swaig-test command loads an agent file and lets you render its SWML, list
its SWAIG functions, execute a function, and simulate serverless environments,
all without deploying. It supports both webhook and DataMap
functions.
One action flag is required. A target with no action exits with
Error: one of --dump-swml, --list-tools, or --exec is required. The one
exception is --simulate-serverless, which renders SWML for the platform on
its own.
Actions
Choose one action per invocation:
--list-tools
List all SWAIG functions registered on the agent, with their parameters.
--list-agents
List all agents exported from the file. Useful for multi-agent files.
--dump-swml
Generate and output the full SWML document. Combine with --raw for
machine-readable JSON.
--exec NAME
Execute a SWAIG function by name. Pass arguments with --arg key=value.
--parse-only
Validate the command-line arguments, print parse OK, and exit without
loading the agent file, touching the filesystem, or making network requests.
--dry-run is an alias. Accepted anywhere on the command line, including
after --exec.
Common options
--raw
Output raw JSON only, suppressing all logs. Designed for piping to jq.
--verbose
Enable verbose output with debug information.
--format-json
Format output as indented JSON.
--agent-class
Name of the agent class to use when the file exports several.
--route
Override the agent’s route.
Function execution options
--arg KEY=VALUE
A function argument. Repeat for each argument.
--override KEY=VALUE
Override a top-level field in the mock call data (e.g.,
--override call_state=answered). Repeatable.
SWML generation options
--call-type
Simulated call type: sip or webrtc.
--call-direction
Simulated call direction: inbound or outbound.
--call-state
Simulated call state: active, ringing, or hold.
--call-id
Override the call ID in the mock data.
--from-number
Override the caller’s number in the mock data.
--to-extension
Override the destination extension in the mock data.
Serverless simulation
--simulate-serverless
Render SWML as the agent would on a serverless platform. Valid values:
lambda, gcf, azure, and cgi. Any other value exits with an error
naming the supported set.
--env KEY=VALUE
Set an environment variable. Repeatable. Applied after --env-file.
--env-file
Load environment variables from a file (one KEY=VALUE per line).