详细分析 ▾
运行时依赖
版本
Initial release of ocli-api - Launches ocli-api for turning any OpenAPI/Swagger API into CLI commands. - Enables endpoint search using BM25 or regex queries. - Supports checking command parameters and executing API calls directly from the CLI. - No MCP server or code generation required; minimal token usage. - Includes guardrails and troubleshooting guidance for common errors.
安装命令 点击复制
技能文档
Call any HTTP API described by an OpenAPI/Swagger spec as CLI commands. No MCP server, no code generation, no JSON schemas in context.
当...时 到 使用
- 您 需要 到 call REST API (internal, cloud, SaaS)
- 您 有 OpenAPI 或 Swagger spec (URL 或 local file)
- 您 want minimal 令牌 overhead (1 tool, ~158 tokens/turn)
Setup (one-时间)
npm install -g openapi-to-cliocli profiles add \
--api-base-url \
--openapi-spec \
--api-bearer-token "$TOKEN"
ocli use
Workflow
- 搜索 对于 right command:
ocli commands --query "your task description" --limit 5
- Check parameters 的 chosen command:
ocli --help
- Execute command:
ocli --param1 value1 --param2 value2
- 解析 JSON 响应 和 act 在...上 结果.
搜索 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 搜索 之前 guessing command name.
- Always check
--help之前 calling command 您 haven't used 之前. - Never fabricate parameter names — 使用 ones 从
--help输出. - 如果 command returns 错误, 读取 响应 body 之前 retrying.
Failure handling
- Command 不 found: re-搜索 带有 不同 keywords 或 使用
--regex. - Missing 必填 parameter: run
--help和 添加 missing 标志. - 401/403: check 个人资料 有 有效 令牌 (
ocli profiles show). - Spec 不 loaded: run
ocli profiles 添加again 带有--openapi-spec到 刷新 缓存.
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制