sincecutoff.com
← all changes

wrangler types generates AI Search binding types

Introduced 2026-04-02 · score 0.95

HOW TO USE IT

When a Worker repository needs environment types for AI Search bindings, add `ai_search_namespaces` and/or `ai_search` to its Wrangler config, then run `wrangler types` to generate binding types. By default, Wrangler includes bindings from all configured environments.

wrangler types
{"ai_search_namespaces":[{"binding":"<ENV_BINDING>","namespace":"<NAMESPACE>"}],"ai_search":[{"binding":"<ENV_BINDING>","instance_name":"<INSTANCE_NAME>"}]}

WHY THIS HELPS

Generate Worker environment types for `ai_search_namespaces` and `ai_search` bindings in a repository.

REQUIREMENTS AND LIMITATIONS

  • Version: 4.80.0
  • PATH: Optional output path for generated types; defaults to `./worker-configuration.d.ts` and must end in `.d.ts`.
  • --env: Restricts generated bindings to the named environment; without it, bindings from all configured environments are included.
  • ai_search_namespaces[].binding (required): Environment variable name for the namespace binding.
  • ai_search_namespaces[].namespace (required): Namespace to bind; Wrangler creates it on deploy if it does not exist.
  • ai_search_namespaces[].remote: Set to `true` for local development with `wrangler dev`.
  • ai_search[].binding (required): Environment variable name for the instance binding.
  • ai_search[].instance_name (required): AI Search instance name; it must exist in the default namespace at deploy time.
  • ai_search[].remote: Set to `true` for local development with `wrangler dev`.
  • Supports both simple and per-environment modes.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card