Skip to content

CLI Reference

All commands accept:

FlagDescription
--helpShow help for the command
--jsonOutput in machine-readable JSON
--api-url <url>Override the API base URL
--config <path>Override the config file path

Initialize a new AgentsForms project.

Terminal window
agentsforms init [--name <project-name>]
FlagDescription
--name <project-name>Project name (default: current directory name)

Creates agentsforms.config.json and forms/example-form.json.


Manage form definitions.

Validate a form definition JSON file.

Terminal window
agentsforms forms validate forms/example-form.json
agentsforms forms validate forms/*.json
agentsforms forms validate --stdin < forms/example-form.json
FlagDescription
--stdinRead the form definition from stdin

Exit code: 0 on valid, 1 on invalid.

Create a form from a validated JSON file.

Terminal window
agentsforms forms create forms/support-intake.json

Publish a draft form.

Terminal window
agentsforms forms publish support-intake
agentsforms forms publish --version 2 support-intake
FlagDescription
--version <n>Publish a specific version number

List all forms in the project.

Terminal window
agentsforms forms list
agentsforms forms list --status published
agentsforms forms list --json
FlagDescription
--status <status>Filter: draft, published, archived
--limit <n>Max results (default 20)

Get a single form by slug or ID.

Terminal window
agentsforms forms get support-intake --json

Create a new form-filling session.

Terminal window
agentsforms sessions create support-intake \
--expires-in 3600 \
FlagDescription
--expires-in <seconds>Session lifetime (default 3600)
--prefill <key=value>Prefill a field (repeatable)

Extend a session’s expiry.

Terminal window
agentsforms sessions extend sess_xyz789 --by 1800
FlagDescription
--by <seconds>Additional seconds to add

List submissions for a form.

Terminal window
agentsforms submissions list support-intake --limit 20 --json

agentsforms submissions get <submission-id>

Section titled “agentsforms submissions get <submission-id>”

Get a single submission.

Terminal window
agentsforms submissions get sub_def456 --json

Watch for new submissions in real time.

Terminal window
agentsforms submissions tail support-intake

Register a webhook.

Terminal window
agentsforms webhooks create \
--url https://your-agent.com/webhook \
--events submission.created,session.expired
FlagDescription
--url <url>HTTPS endpoint
--events <events>Comma-separated event types

List registered webhooks.

Delete a webhook.

agentsforms webhooks deliveries list --webhook-id <id>

Section titled “agentsforms webhooks deliveries list --webhook-id <id>”

List delivery attempts.

agentsforms webhooks deliveries replay --delivery-id <id>

Section titled “agentsforms webhooks deliveries replay --delivery-id <id>”

Replay a failed delivery.