Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

openapi-typescript

$ openapi-typescript Community Low Risk
openapi-ts · Design & Docs · MIT · macos / linux / windows

openapi-typescript converts OpenAPI 3.0 and 3.1 YAML/JSON specs into pure, zero-runtime TypeScript .d.ts definitions. It prints to stdout by default when -o is omitted, and provides --check for read-only CI verification that generated types match the current schema.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g openapi-typescript
CLI vs MCP Decision CLI Only

Deterministic local TypeScript codegen from OpenAPI files via openapi-typescript belongs directly in build scripts rather than MCP.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Clean non-interactive execution with stdout default, -o explicit output, --check verification mode, and clear exit codes, though diagnostics are plain text.

  • --check exits non-zero when generated types are stale
  • Writes to stdout unless -o is explicitly passed
Trust & Safety 23 / 25

Purely local type generation by default; --check and omitted -o never write to disk.

  • Non-mutating --check mode and explicit -o output path
Setup & Portability 14 / 15

Available everywhere Node.js runs via npm or npx openapi-typescript with fast startup.

  • Zero-config execution via npx openapi-typescript
Utility & Efficiency 14 / 15

Produces clean, zero-runtime .d.ts types that pair directly with openapi-fetch and TypeScript tsc checks.

  • Full OpenAPI 3.0 and 3.1 support without heavy runtime wrappers
Maintenance & Lineage 8 / 10

Active open-source project (openapi-ts/openapi-typescript) under MIT.

  • Active openapi-ts organization on GitHub
Docs & Verifiability 9 / 10

Crisp official CLI documentation at openapi-ts.dev/cli.

  • Official docs at openapi-ts.dev/cli

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

None required for local specs; optional auth headers can be configured in redocly.yaml for remote specs.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free and MIT open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# openapi-typescript Agent Rules
- Use `--check` first to verify whether generated `.d.ts` files are already in sync.
- Always pass `-o <path>` when updating files so generated TypeScript is written deterministically instead of dumped to stdout.

Agent-Ready Command Recipes

Safe Read-Only Queries

Verify generated types match the OpenAPI schema
openapi-typescript schema.yaml -o src/api/schema.d.ts --check

Reads schema.yaml and exits non-zero if src/api/schema.d.ts is out of date, without writing files.

Controlled Writes & Previews

Regenerate TypeScript definitions from schema
openapi-typescript schema.yaml -o src/api/schema.d.ts

Writes updated zero-runtime OpenAPI TypeScript declarations to src/api/schema.d.ts.

Strengths for Agents

  • + --check flag gives agents a reliable read-only staleness check for generated types.
  • + Outputs to stdout by default and only writes files when -o is provided.
  • + Generates zero-runtime TypeScript types with full OpenAPI 3.1 support.

Caveats & Pitfalls

  • ! Only generates TypeScript types, not runtime HTTP client functions (pair with openapi-fetch or use orval).
  • ! Does not support Swagger 2.0 directly without converting to OpenAPI 3.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI