Skip to main content
Start an interactive chat session with your agent, or run scripted/automated conversations. Examples:

Non-interactive (scripted) mode

Supply messages directly on the command line or from a file to run poly chat without a human at the terminal. This is useful for automated testing pipelines and CI scripts. Inline messages — use -m/--message (repeatable):
File-based input — use --input-file:
Each line of the file is sent as a separate message. Use - to read from stdin. If the file path does not exist, poly chat exits with an error.

Resuming an existing conversation

Use --conversation-id (or --conv-id) to resume an existing conversation by its ID instead of creating a new session:

Pushing before chatting

Use --push to push the local project to Agent Studio before starting the chat session. This ensures local changes are live before testing without requiring a separate poly push step:
If the push fails, the command exits without starting the chat session.

Language flags

Use language flags to specify the expected input and output language when chatting against multilingual agents. If not specified, the project default is used. --input-lang and --output-lang take precedence over --lang when both are supplied.

Simulating SIP headers

Use --sip-header NAME=VALUE to simulate a SIP header when starting a conversation. Single header:
Multiple headers are supported by repeating the flag:
The values are exposed to project functions through conv.sip_headers. This is for testing agent behaviour only; it does not create a SIP call or reproduce carrier-level SIP behaviour. SIP headers cannot be changed when resuming an existing conversation.

poly chat flags summary

--json output shape — a conversations array, one entry per session (more than one if /restart was used in scripted input); each turns entry mirrors the enabled --functions/--flows/--state flags:
function_events, flow, and state_changes are only present on turns where --functions, --flows, or --state (or --metadata) produced data. If --push is used, a push key ({ "success": true, "message": "..." }) is added alongside conversations. On failure (e.g. session creation error, missing input file), the shape is { "success": false, "error": "..." } instead.
Last modified on November 27, 2026