# Create forms with an agent (/docs/cli/create-forms)



## Configure production [#configure-production]

Install the CLI using [Installation](install.md), then configure the API in the
terminal or agent environment:

```bash
export POLLARIS_API_URL=https://api.pollaris.cc
```

## Ask in plain language [#ask-in-plain-language]

After installing the CLI, tell a terminal-capable agent:

```text
Create a library feedback form via Pollaris. Make it short, include a 1–5 visit rating and an optional comment, and publish it. Give me only the authorization step and final public URL unless something fails.
```

The agent should run:

```bash
pollaris forms create \
  --prompt "Create a short library feedback form with a 1–5 visit rating and an optional comment" \
  --publish \
  --wait \
  --json
```

When authorization is required, the command exits with code `10` and returns:

```json
{
  "schema_version": "1",
  "status": "requires_authorization",
  "operation_id": "00000000-0000-0000-0000-000000000000",
  "authorization": {
    "url": "https://app.example.com/connect/device?user_code=ABCDE-FGHIJ",
    "user_code": "ABCDE-FGHIJ",
    "expires_at": 1788869400
  },
  "next_action": {
    "command": "pollaris operations resume 00000000-0000-0000-0000-000000000000 --profile default --wait --timeout 45 --json"
  }
}
```

Open the URL and approve access. The agent runs `next_action.command`; you do not need to repeat the form request. If the agent session stopped, you can run that command yourself.

Completed output contains the form and public URL:

```json
{
  "schema_version": "1",
  "status": "completed",
  "operation_id": "00000000-0000-0000-0000-000000000000",
  "job_id": "11111111-1111-1111-1111-111111111111",
  "form": {
    "id": "22222222-2222-2222-2222-222222222222",
    "title": "Library feedback",
    "status": "published",
    "version": 1,
    "public_url": "https://forms.example.com/f/example"
  },
  "warnings": []
}
```

## Reliable agent instructions [#reliable-agent-instructions]

Give your agent these rules when needed:

```text
Use `pollaris ... --json` for every command. If the result is
`requires_authorization`, show me `authorization.url`, then run the returned
`next_action.command`. If the result is `pending`, continue with the same
operation ID. Never print credentials or create a second operation to retry.
```

## Choose a workspace [#choose-a-workspace]

Authorization applies to one workspace. If your account has several workspaces, select one on the authorization page or pass its ID:

```bash
pollaris forms create \
  --workspace 00000000-0000-0000-0000-000000000000 \
  --prompt "Create a member satisfaction form" \
  --json
```

Use a separate profile for a different workspace:

```bash
pollaris forms create --profile community-library --prompt "Create a visitor survey" --json
```

## Create a draft [#create-a-draft]

```bash
pollaris forms create \
  --prompt "Create a library feedback form" \
  --draft-only \
  --json
```

Draft output does not contain a public URL. Publish the inspected revision later with `pollaris forms publish`.

## Continue after a timeout [#continue-after-a-timeout]

A wait timeout does not cancel the backend job. Resume the saved operation:

```bash
pollaris operations resume OPERATION_ID --wait --timeout 45 --json
```

Use the same operation and idempotency key. Starting a fresh command may represent a second intended form.
