ocli-api

A command-line tool that turns an OpenAPI or Swagger description into commands for calling an HTTP API. OpenAPI is a machine-readable document that lists an API's endpoints, parameters, and responses.

In plain words
What is it for?
Use it to configure API profiles, search available endpoints with plain-language or pattern queries, inspect command options, switch between APIs, and execute requests that return JSON.
Why use it?
It lets an agent discover and call REST services without installing a separate MCP server or generating client code. Search helps find the right endpoint before its parameters are checked and used.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/evilfreelancer/openapi-to-cli/ocli-api
Any agent
npx skills add EvilFreelancer/openapi-to-cli --skill ocli-api
Clone the repo
git clone --depth 1 https://github.com/EvilFreelancer/openapi-to-cli

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.00661
Opus 5 $0.00017 $0.00331
Sonnet 5 $0.00007 $0.00132
Haiku 4.5 $0.00003 $0.00066

Measured yesterday against content hash a0dcf6d296d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ocli-api 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 yesterday.

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.

skills/ocli-api/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ocli — OpenAPI to CLI

Call any HTTP API described by an OpenAPI/Swagger 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 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>

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

Read the full file on GitHub · 88 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. yesterday First seen · 88 lines · 34 tokens per session scan A a0dcf6d296d0

Subscribe to this mod's changes

ocli-api is a skill published in the GitHub repository EvilFreelancer/openapi-to-cli (256 stars, last pushed 11d ago), licensed MIT. It adds 34 tokens to every session and 661 once invoked, about $0.0002 per session on Opus 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.

Related

Other skills, from other repositories

API Test Suite Generator

Automatically generate comprehensive API test suites from OpenAPI specifications covering CRUD operations, error handling, authentication, pagination, and edge cases.

PramodDutta/qaskills · 29 tokens

skmtc-architecture

Understand what SKMTC is, how its engine works, and the architectural invariants — for agents building or extending infrastructure around SKMTC rather than authoring generators or running the CLI. Covers the three-phase pipeline, the host/Worker boundary, cross-generator coordination, the manifest, the attribution /…

skmtc/skmtc · 240 tokens

skmtc-debug

Diagnose failures in SKMTC sessions — no output, wrong output, error messages, bundle freshness, parseIssues, "Registered definition mismatch", ref cycles, "Module not found" in generated code, or any other broken behavior. Applies across both CLI usage and generator authoring contexts. Use this skill when the user…

skmtc/skmtc · 213 tokens

skmtc-lang-kotlin

The Kotlin target-language layer for Skmtc generators (@skmtc/lang-kotlin): base factories, KtSnippet, the seven entity kinds, packages-from-paths imports, the head+value render model, KtAnnotation and the composition classes, sanitization and @SerialName placement, plus the current-API worked example (the shipped…

skmtc/skmtc · 117 tokens

skmtc-retro-review

Aggregate friction log files across a time period to identify recurring patterns, classify each cluster by intervention type, produce a prioritized action plan with success criteria, and calculate convergence metrics. Complements skmtc-retro (which captures per-session signal) by acting as the system's actuator…

skmtc/skmtc · 211 tokens

skmtc-retro

Run a self-retrospective on a SKMTC-related session — generator authoring, CLI configuration, debugging, or any sustained interaction involving @skmtc/core, @skmtc/cli, or @skmtc/gen- packages. Captures three distinct outputs: (1) friction entries (mistakes, surprises, overridden defaults, multi-cycle struggles), (2)…

skmtc/skmtc · 311 tokens