agentleFS
EvilFreelancerEvilFreelancer/openapi-to-cli/skills/ocli-api/SKILL.md

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

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
  1. Distinctive:

    Call any HTTP API described by an OpenAPI, Swagger, or OpenRPC spec as CLI commands.

    line 13
  2. Distinctive:

    No MCP server, no code generation, no JSON schemas in context.

    line 14
  3. Distinctive:

    Always search before guessing a command name.

    line 91
  4. Very specific:

    Always check --help before calling a command you haven't used before.

    line 92
  5. Very specific:

    Never fabricate parameter names — use the ones from --help output.

    line 93
  6. Distinctive:

    If a command returns an error, read the response body before retrying.

    line 95
  7. Very specific:

    Missing required parameter: run --help and add the missing flag.

    line 100
  8. Very specific:

    401/403: check that the profile has a valid token (ocli profiles show <name>).

    line 102
  9. Very specific:

    Spec not loaded: run ocli profiles add again with --openapi-spec to refresh cache.

    line 103

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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-7

ocli 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

  1. Search for the right command:
    ocli commands --query "your task description" --limit 5
  2. Check parameters of the chosen command:
    ocli <command> --help
  3. Execute the command:
    ocli <command> --param1 value1 --param2 value2
  4. 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 commands

Multiple APIs

# Switch active profile
ocli use github

# Or specify per-call
ocli repos_get --profile github --owner octocat --repo Hello-World

Guardrails

  • Always search before guessing a command name.
  • Always check --help before calling a command you haven't used before.
  • Never fabricate parameter names — use the ones from --help output.
  • For OpenRPC, pass only documented RPC parameters. Do not add jsonrpc, method, or id; ocli supplies 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 --help and 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 add again with --openapi-spec to refresh cache.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.