You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BM25 engine (ported from [picoclaw](https://github.com/sipeed/picoclaw)) ranks commands by relevance across name, method, path, description, and parameter names. This enables agents to discover the right endpoint without loading all command schemas into context. The legacy `ocli search` command is kept as a deprecated alias and internally forwards to `ocli commands` with the same flags.
106
110
111
+
### Benchmark: three strategies for AI agent ↔ API interaction
112
+
113
+
Tested against [Swagger Petstore](https://petstore3.swagger.io/) ([OpenAPI spec](https://petstore3.swagger.io/api/v3/openapi.json)). Scaling projections use the [GitHub API](https://api.apis.guru/v2/specs/github.com/api.github.com/1.1.4/openapi.json) (845 endpoints).
114
+
115
+
Three strategies compared:
116
+
117
+
| # | Strategy | How it works | Tools in context |
118
+
|---|----------|-------------|-----------------|
119
+
| 1 |**MCP Naive**| All endpoints as MCP tools | N tools (one per endpoint) |
-`--custom-headers <json>` - custom HTTP headers as JSON string (e.g. `'{"X-Tenant":"acme","X-Request-Source":"cli"}'`). Legacy comma-separated `key:value` format is also supported for simple values without commas.
232
296
233
297
-`ocli profiles add <name>` - add a new profile with the given name and cache the OpenAPI spec. Same options as `onboard` (profile name is the positional argument).
234
298
@@ -271,6 +335,19 @@ The project mirrors parts of the `openapi-to-mcp` architecture but implements a
271
335
-`bm25` - generic BM25 ranking engine with Robertson IDF smoothing and min-heap top-K extraction.
272
336
-`cli` - entry point, argument parser, command registration, help output.
273
337
338
+
### Using with AI agents (Claude Code skill example)
339
+
340
+
An example skill file is provided in [`examples/skill-ocli-api.md`](examples/skill-ocli-api.md). Copy it to `.claude/skills/api.md` in your project to let Claude Code discover and use your API via `ocli`:
-[openapi-cli-generator](https://github.com/danielgtaylor/openapi-cli-generator) - generates a CLI from an OpenAPI 3 specification using code generation.
0 commit comments