Project Structure
After running agentsforms init, your project looks like this:
my-project/├── agentsforms.config.json└── forms/ └── example-form.jsonagentsforms.config.json
Section titled “agentsforms.config.json”Project-level configuration. Created automatically by init:
{ "apiUrl": "https://api.agentsforms.com", "project": "my-project"}| Field | Description |
|---|---|
apiUrl | Base URL for the AgentsForms API. Override with AGENTFORMS_API_URL env var. |
project | Project name, defaults to the directory name. Sent in API requests for attribution. |
forms/
Section titled “forms/”Your form definitions live here as .json files. Name them by slug: support-intake.json, bug-report.json, etc.
The CLI discovers forms by scanning forms/ or by explicit file path:
agentsforms forms validate forms/support-intake.jsonagentsforms forms validate forms/*.jsonConventions
Section titled “Conventions”- One form per file. A
.jsonfile contains exactly one form definition. - File name = slug. Name the file after the form’s
slugproperty so they stay in sync. - Version control your forms. Check
agentsforms.config.jsonandforms/into git. The form definitions are source code.
Config precedence
Section titled “Config precedence”When a setting can come from multiple sources, the order is:
- CLI flag (e.g.,
--api-url) - Environment variable (
AGENTFORMS_API_URL) - Project config (
agentsforms.config.json) - Global default