Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/EvilFreelancer/openapi-to-cliWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/architecture)<a href="https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/architecture"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/architecture"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01463 | $0.01463 |
| Opus 5.5 | $0.00585 | $0.00585 |
| Sonnet 5.5 | $0.00293 | $0.00293 |
| Haiku 4.5 | $0.00146 | $0.00146 |
Grade A, and why
architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Architecture of openapi-to-cli (ocli)
ocli is a TypeScript/Node CLI that converts OpenAPI/Swagger specs into runtime CLI commands. No code generation: at every invocation it loads a cached spec and builds command definitions on the fly.
Data flow
ocli profiles add <name> --api-base-url ... --openapi-spec ...
|
v
ConfigLocator -> .ocli/ dir (global or local)
|
v
ProfileStore -> profiles.ini (read/write/select)
|
v
OpenapiLoader -> fetches spec with the profile auth headers, caches under .ocli/specs/<profile>.json
|
v
OpenapiToCommands -> parses spec, applies include/exclude filters,
builds CliCommand[] (name, method, path, options, body schema)
|
v
CommandSearch (BM25) -> ranks commands by NL query or regex
|
v
cli.ts (yargs) -> resolves profile + spec, dispatches: profiles | use | commands | <toolName>
|
v
HttpClient (axios) -> performs the real HTTP request to API_BASE_URL
Components (mapping to src/)
config.ts-ConfigLocator. Finds.ocli/(global~/.ocli/, local in CWD), resolvesprofiles.inipaths.profile-store.ts-ProfileStore,Profile. Reads/writesprofiles.ini, tracks current profile, validates fields.openapi-loader.ts-OpenapiLoader. Loads spec from URL or local file, caches it to.ocli/specs/<profile>.json, refreshes on demand. Resolves external$refacross multi-file specs. Remote fetches (the spec and every external$refdocument) carry the headers passed bycli.tsthroughloadSpec(profile, { headers }): the profile custom headers plus the Basic/BearerAuthorizationbuilt bybuildProfileAuthHeaders.openapi-to-commands.ts-OpenapiToCommands,CliCommand,CliCommandOption. Walks the spec, applies include/exclude filters, expands path-level params, resolves local$ref, builds command names with optional prefix, expandsenum/default/nullable/oneOfschema hints for--help.command-search.ts-CommandSearch. BM25 over(name, method, path, description, options[].name), plus regex fallback. Same engine used by bothocli commandsand any future agent skill.command-args.ts-findUnknownFlags,acceptsFreeFormBody,formatUnknownFlagsError. Validates parsed flags of a dynamic command againstCliCommand.options, suggests the closest declared name, and keeps the free-form body passthrough for body-capable operations whose spec declares no body.bm25.ts- tokenizer + BM25 scorer, no I/O.cli.ts-oclientry point. yargs command tree:profiles add|remove|list,use,commands, and dynamic per-spec commands. Builds theaxiosrequest from aCliCommand+ parsed args; injects auth, custom headers, server URL overrides.version.ts- resolvesVERSIONat runtime fromOCLI_VERSIONorpackage.json; there is no generation step.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · -1 lines · +59 tokens per session 910dc407904d
- 1mo ago First seen · 91 lines · 1,404 tokens per session scan A 373afaac64a5
architecture is a cursor rule published in the GitHub repository EvilFreelancer/openapi-to-cli (265 stars, last pushed 24d ago), licensed MIT. It adds 1,463 tokens to every session, about $0.0059 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
chassis
Chassis conventions — decorator-driven Express 5 + TypeScript.
shared-plane-packages
Pattern for creating shared plane packages that serve both migration and runtime planes.
sql-queries-not-asts
Name built-and-lowered SQL units "queries", not "asts".
query-patterns
Standard patterns for working with Prisma 8 queries.
typescript-coding-rule
It allows a subset of JSDoc tags. Most tags must occupy their own line, with the tag at the beginning of the line.
deno
You MUST import @std dependencies from jsr You MUST use latest versions of libraries when adding imports You must use type keyword when importing types.