openapi2cli
Generate CLI tools from OpenAPI specs. Built for AI agents who hate writing curl commands.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/awlevin/openapi2cliWhat This Skill Does
OpenAPI2CLI is a powerful utility designed to bridge the gap between abstract API documentation and actionable terminal commands. It automates the generation of Python-based CLI wrappers directly from OpenAPI 3.x specifications. Instead of manually constructing complex curl requests or debugging header formats, AI agents can use this tool to create a clean, structured, and discoverable interface for any REST API. The skill generates a unified Python script that handles authentication, argument parsing, and parameter validation, effectively turning your AI agent into an expert API consumer.
Installation
To integrate this tool into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/awlevin/openapi2cli
Ensure you have uv installed in your environment, as it facilitates the efficient execution of the generation command via uvx.
Use Cases
- Rapid API Prototyping: Quickly generate a command-line interface for internal microservices to verify endpoints without building a full frontend.
- Automated Agent Tooling: Use this to dynamically generate tools for an AI agent at runtime, allowing it to interact with new APIs it encounters on the fly.
- CI/CD Integration: Incorporate generated CLIs into shell scripts to perform automated health checks, smoke tests, or database seeding using standard terminal commands.
- Authentication Simplification: Standardize how credentials are passed to external APIs by delegating auth handling (Bearer, Basic, API Keys) to the generated wrapper.
Example Prompts
- "Use openapi2cli to generate a CLI tool for the Stripe API using their public OpenAPI spec and save it to the local bin folder."
- "Generate a management CLI for our internal product microservice using the spec file located at ./docs/api-spec.json, then run a test list request."
- "Create a custom CLI for the GitHub API, setting the base URL to our enterprise instance, and help me verify the help documentation for the 'repos' command."
Tips & Limitations
- Version Support: This tool is optimized for OpenAPI 3.x. Ensure your source documentation is compliant to get the best results.
- Auth Persistence: The generated CLI supports environment variables for authentication. Avoid hardcoding tokens directly into your bash history.
- Dry-run Mode: Always use the dry-run flag when testing new specs to inspect the outgoing request before firing against production endpoints.
- Complexity: Extremely large OpenAPI specs may result in very verbose CLI scripts; ensure your environment has sufficient resources to process the resulting Python file.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-awlevin-openapi2cli": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api
Related Skills
agent-chat
Temporary real-time chat rooms for AI agents. Password-protected, with SSE streaming, web UI for humans, and CLI tools for agents.
flight-search
Search Google Flights for prices, times, and airlines. No API key required.
airbnb-search
Search Airbnb listings with prices, ratings, and direct links. No user API key required (uses Airbnb's public frontend API key). Use when searching for Airbnb stays, vacation rentals, or accommodation pricing.
secret-portal
Spin up a one-time web UI for securely entering secret keys and env vars. Supports guided instructions, single-key mode, and cloudflared tunneling.
sprite-animator
Generate animated pixel art sprites from any image using AI. Send a photo, get a 16-frame animated GIF.