openapi2cli
Generate CLI tools from OpenAPI specs. Built for AI agents who hate writing curl commands.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- openapi2cli
- homepage
- https://github.com/Olafs-World/openapi2cli
- metadata
- { "openclaw": { "emoji": "?", "install": [ { "id": "uv", "bins": [ "uvx" ], "kind": "pip", "label": "Install uv (for uvx)", "package": "uv" } ], "requires": { "bins": [ "uvx" ] } } }
- description
- Generate CLI tools from OpenAPI specs. Built for AI agents who hate writing curl commands.
02 资源文件 2
- 参考文档_meta.json278 B
- 参考文档SKILL.source.json859 B
03 SKILL.md 正文
OpenAPI to CLI
Generate command-line tools from OpenAPI/Swagger specs. Perfect for AI agents that need to interact with APIs without writing curl commands.
Quick Start
# generate a CLI from any OpenAPI spec
uvx openapi2cli generate https://api.example.com/openapi.json --output my-api
# use the generated CLI
python my-api.py users list
python my-api.py users get --id 123
python my-api.py posts create --title "Hello" --body "World"
Features
- Auto-generates CLI from OpenAPI 3.x specs
- Supports auth: API keys, Bearer tokens, Basic auth
- Rich help:
--helpon any command shows params - JSON output: Structured responses for parsing
- Dry-run mode: See the request without sending
Usage
# from URL
uvx openapi2cli generate https://api.example.com/openapi.json -o my-cli
# from local file
uvx openapi2cli generate ./spec.yaml -o my-cli
# with base URL override
uvx openapi2cli generate ./spec.json -o my-cli --base-url https://api.prod.com
Generated CLI
# set auth via env
export MY_CLI_API_KEY="sk-..."
# or via flag
python my-cli.py --api-key "sk-..." users list
# see available commands
python my-cli.py --help
# see command options
python my-cli.py users create --help
Example: GitHub API
uvx openapi2cli generate https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json -o github-cli
python github-cli.py repos list --owner octocat
Why?
AI agents work better with CLIs than raw HTTP:
- Discoverable commands via
--help - Tab completion friendly
- No need to construct JSON payloads
- Easy to chain with pipes
Links
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.