Spec configuration
ClawQL builds an in-memory operation index from OpenAPI 3 (JSON/YAML), Swagger 2 (auto-upgraded), Google Discovery documents, or bundled presets under providers/, optionally extended with native GraphQL and gRPC sources via env. Selection follows a two-stage precedence implemented in src/spec-loader.ts.
Overview
- Multi-spec mode: one merged search index.
executeuses REST per OpenAPI/Discovery operation on the owning spec, and native GraphQL / gRPC for bundledlinearor env-configured sources (CLAWQL_GRAPHQL_*,CLAWQL_GRPC_SOURCES) in the same index; native ops use HTTP GraphQL or gRPC unary (GraphQL layer). - Single-spec mode: one OpenAPI/Discovery document;
executecan use the internal OpenAPI→GraphQL layer when translation succeeds, with REST fallback on failure. Native protocol ops behave the same when configured.
Stage 1 — Multi-spec merge
User-facing model: for multi-spec there is no hidden “partial” default. Either you rely on the one built-in unconfigured merge (all-providers, step 4), or you choose a merge (local paths, bundled id list, or a merged CLAWQL_PROVIDER shortcut). CLAWQL_GOOGLE_TOP50_SPECS / CLAWQL_GOOGLE_CLOUD_SPECS do not select a merge on their own.
Precedence (order matters) when a merge is selected or defaulted:
CLAWQL_SPEC_PATHS— merge local files (comma, semicolon, or newline separated).CLAWQL_BUNDLED_PROVIDERS— comma/semicolon/newline-separated bundled provider ids and/orgoogle(full GCP on-disk set).CLAWQL_PROVIDER— merged shortcut (google,all-providers,atlassian, …) when not building a list yourself.- Built-in default — only when no merge was selected:
all-providers.
Stage 2 — Single spec
If Stage 1 does not apply, the first match wins:
CLAWQL_SPEC_PATH(aliases:OPENAPI_SPEC_PATH,OPENAPI_FILE)CLAWQL_SPEC_URL(alias:OPENAPI_SPEC_URL)CLAWQL_DISCOVERY_URL(alias:GOOGLE_DISCOVERY_URL)CLAWQL_PROVIDER— single bundled vendor (cloudflare,github,linear, …), not a merged preset- Rare fallback (
kind: "default"in code)
Examples: CLAWQL_SPEC_PATH=./openapi.yaml skips Stage 1. CLAWQL_PROVIDER=cloudflare alone loads Cloudflare as a single bundle. An empty environment (nothing above) uses all-providers; for a custom subset, set CLAWQL_BUNDLED_PROVIDERS=…, not another implicit default.
Environment variables
| Variable | Meaning |
|---|---|
CLAWQL_SPEC_PATH | Local OpenAPI JSON/YAML |
CLAWQL_SPEC_PATHS | Multiple paths → merge |
CLAWQL_BUNDLED_PROVIDERS | Ids to merge: BUNDLED_PROVIDERS keys and/or google |
CLAWQL_SPEC_URL | Fetch OpenAPI from HTTPS |
CLAWQL_DISCOVERY_URL | Google Discovery JSON URL |
CLAWQL_PROVIDER | Merged preset (Stage 1) or single vendor (Stage 2) |
CLAWQL_PROVIDER_AUTH_JSON | One JSON object: specLabel → token string or headers (multi-vendor execute) |
CLAWQL_HTTP_HEADERS | Global header JSON; with CLAWQL_PROVIDER_AUTH_JSON, omit Authorization here |
CLAWQL_INTROSPECTION_PATH | Pregenerated GraphQL introspection JSON for OpenAPI→GraphQL field hints (optional) |
CLAWQL_GRAPHQL_URL / CLAWQL_GRAPHQL_NAME / CLAWQL_GRAPHQL_HEADERS | Single native GraphQL endpoint; optional CLAWQL_GRAPHQL_SCHEMA_PATH / CLAWQL_GRAPHQL_INTROSPECTION_PATH if introspection is blocked |
CLAWQL_GRAPHQL_SOURCES | JSON array — merge native GraphQL HTTP endpoints into search / execute (optional per-source schemaPath / introspectionPath) |
CLAWQL_GRPC_SOURCES | JSON array — merge unary gRPC RPCs from .proto paths |
CLAWQL_API_BASE_URL | Override REST base URL |
CLAWQL_BUNDLED_OFFLINE | 1 / true — do not fetch missing bundled files from the network |
Full list: .env.example in the repo.
Google Discovery
Use CLAWQL_DISCOVERY_URL for GCP and other Google APIs, for example:
export CLAWQL_DISCOVERY_URL="https://compute.googleapis.com/\$discovery/rest?version=v1"
The repo vendors a lookup snapshot and docs for refreshing it: docs/providers/google-apis-lookup.md. The bundled Google Cloud API set (on-disk manifest under providers/google/) powers merged preset google.
