ocli-api
Skill260 starsChanged 3 months agoMITView on GitHub
Turn any OpenAPI, Swagger, or OpenRPC API into CLI commands and call them. Search endpoints with BM25, check parameters, execute — no MCP server needed.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- towerofpharosseasonalworker457/openapi-to-cliedited, first seen Mar 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/code-style.mdcCursor rule
- .cursor/rules/implementation-order.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Call any HTTP API described by an OpenAPI, Swagger, or OpenRPC spec as CLI commands.
- Distinctive: line 14
No MCP server, no code generation, no JSON schemas in context.
- Distinctive: line 91
Always search before guessing a command name.
- Very specific: line 92
Always check --help before calling a command you haven't used before.
- Very specific: line 93
Never fabricate parameter names — use the ones from --help output.
- Distinctive: line 95
If a command returns an error, read the response body before retrying.
- Very specific: line 100
Missing required parameter: run --help and add the missing flag.
- Very specific: line 102
401/403: check that the profile has a valid token (ocli profiles show <name>).
- Very specific: line 103
Spec not loaded: run ocli profiles add again with --openapi-spec to refresh cache.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ocli — API specification to CLI
Call any HTTP API described by an OpenAPI, Swagger, or OpenRPC spec as CLI commands. No MCP server, no code generation, no JSON schemas in context.
When to use
- You need to call a REST API (internal, cloud, SaaS)
- You have an OpenAPI or Swagger spec (URL or local file)
- You have an OpenRPC JSON or YAML document for a JSON-RPC API
- You want minimal token overhead (1 tool, ~158 tokens/turn)
Setup (one-time)
npm install -g openapi-to-cli
ocli profiles add <name> \
--api-base-url <BASE_URL> \
--openapi-spec <SPEC_URL_OR_PATH> \
--api-bearer-token "$TOKEN"
ocli use <name>For OpenRPC, use the same profile command. ocli builds one command per RPC method and wraps documented parameters in a JSON-RPC 2.0 request automatically:
ocli profiles add rpc-api \
--api-base-url https://api.example.com/rpc \
--openapi-spec ./openrpc.json
ocli getWidget --widgetId widget-7ocli serializes integer, number, and boolean values according to the method schema. Pass arrays and objects as JSON. It follows paramStructure: "by-position" by sending the documented flags as a JSON-RPC parameter array in order. Named and either methods receive a JSON object.
For OpenRPC profiles, use rpc:<method> selectors with --include-endpoints or --exclude-endpoints, for example rpc:getWidget. OpenRPC method names must be unique.
Workflow
- Search for the right command:
ocli commands --query "your task description" --limit 5 - Check parameters of the chosen command:
ocli <command> --help - Execute the command:
ocli <command> --param1 value1 --param2 value2 - Parse the JSON response and act on the result.
Search options
# BM25 natural language search
ocli commands --query "upload file to storage" --limit 5
# Regex pattern search
ocli commands --regex "users.*post" --limit 10
# List all commands
ocli commandsMultiple APIs
# Switch active profile
ocli use github
# Or specify per-call
ocli repos_get --profile github --owner octocat --repo Hello-WorldGuardrails
- Always search before guessing a command name.
- Always check
--helpbefore calling a command you haven't used before. - Never fabricate parameter names — use the ones from
--helpoutput. - For OpenRPC, pass only documented RPC parameters. Do not add
jsonrpc,method, orid;oclisupplies them and follows the documented parameter structure. - If a command returns an error, read the response body before retrying.
Failure handling
- Command not found: re-search with different keywords or use
--regex. - Missing required parameter: run
--helpand add the missing flag. - Unknown option: the flag is not defined by the command; copy the exact name from
--help, including a leading$when the spec uses one (--$expand). - 401/403: check that the profile has a valid token (
ocli profiles show <name>). - Spec not loaded: run
ocli profiles addagain with--openapi-specto refresh cache.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

