openapi2cli for Openclaw

Automate the creation of command-line interfaces from OpenAPI and Swagger specifications to simplify AI agent interactions.

awlevin
v1.0.0
Feb 6, 2026
3
2.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openapi2cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openapi2cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is openapi2cli?

openapi2cli is a specialized utility designed to bridge the gap between complex web APIs and command-line accessibility. By consuming OpenAPI 3.x specifications, it generates a native Python CLI that abstracts away the complexities of curl commands and manual JSON payload construction. This approach is highly effective for developers integrating new capabilities into their Openclaw Skills.

The generated tools are optimized for both human use and AI agent consumption, offering structured JSON outputs and discoverable command hierarchies. Whether you are working with local files or remote URLs, this tool ensures your development workflow remains streamlined and efficient.

openapi2cli Use Cases

  • Converting a complex REST API into a discoverable CLI for an AI agent to use.
  • Rapidly prototyping API interactions without writing boilerplate networking code.
  • Integrating external service documentation into Openclaw Skills for automated task execution.
  • Testing API endpoints with dry-run modes before production implementation.

How openapi2cli Works

  1. The user provides an OpenAPI 3.x specification URL or local file path to the generator.
  2. openapi2cli parses the specification, identifying endpoints, methods, parameters, and authentication requirements.
  3. A portable Python script is generated, mapping each API path to a specific command-line verb.
  4. The resulting CLI can be invoked with environment variables or flags for authentication.
  5. AI agents interact with the CLI to perform GET, POST, or other HTTP operations with structured responses.

openapi2cli Setup

First, ensure you have uv installed to run the generator:

# Install the uv package manager
pip install uv

Generate your first CLI from a spec to enhance your Openclaw Skills:

# Generate CLI from a remote URL
uvx openapi2cli generate https://api.example.com/openapi.json --output my-api-cli

# Use the generated script
python my-api-cli.py --help

openapi2cli Data Schema & Taxonomy

The generated CLI maintains a clear structure to ensure compatibility within the ecosystem of Openclaw Skills:

Component Description
CLI Script A standalone Python file representing the API surface.
Command Structure Follows a python .py syntax.
Auth Handling Supports API_KEY, BEARER_TOKEN, and BASIC_AUTH via env vars.
Output Format Default JSON responses for easy piping and parsing.

openapi2cli Advanced Features

  • Support for OpenAPI 3.x specifications in both JSON and YAML formats.
  • Built-in dry-run mode to inspect request structures without executing them.
  • Automatic help documentation generation for every command and parameter to aid discovery.
  • Seamless integration with environment-based secrets for secure Openclaw Skills deployment.
  • Ability to override base URLs dynamically during generation for different environments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*