wrangler ai-search create accepts custom metadata schemas
Introduced 2026-05-05 · score 0.94
HOW TO USE IT
When creating an AI Search instance with custom metadata fields to index, run `wrangler ai-search create` with repeatable `--custom-metadata` flags or a JSON schema file via `--custom-metadata-schema`.
wrangler ai-search create <NAME> --type r2 --source <BUCKET> --custom-metadata <FIELD>:<TYPE> --custom-metadata <FIELD>:<TYPE>wrangler ai-search create <NAME> --type r2 --source <BUCKET> --custom-metadata-schema <SCHEMA.json>WHY THIS HELPS
Create an AI Search instance with metadata fields that it should index.
REQUIREMENTS AND LIMITATIONS
- Version: 4.88.0
- <NAME> (required): Unique AI Search instance name within its namespace.
- --type: Source type for the instance; use `r2` for an R2 bucket.
- --source: Data source identifier, such as an R2 bucket name.
- --custom-metadata: Repeatable field in `field_name:data_type` form; types: `text`, `number`, `boolean`, `datetime`. Mutually exclusive with `--custom-metadata-schema`.
- --custom-metadata-schema: Path to a JSON file containing an array of `{ "field_name", "data_type" }` objects. Mutually exclusive with `--custom-metadata`.
- Prerequisite: Install Wrangler before using its CLI; Cloudflare's AI Search CLI guide gives `npm install wrangler` as an installation command.
- Supported data types are `text`, `number`, `boolean`, and `datetime`.
- The JSON file must contain an array of `{ field_name, data_type }` objects.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.88.0
- https://developers.cloudflare.com/ai-search/wrangler-commands/
- https://developers.cloudflare.com/ai-search/get-started/wrangler/
Check the installed version and the source before using it. Entry JSON