LAP CLI
/install lap
\r \r
LAP CLI\r
\r Compile, search, and manage API specs for AI agents.\r \r
Command Resolution\r
\r Detect the available CLI binary once per session:\r \r
# Prefer global install, fall back to npx\r
if command -v lapsh &>/dev/null; then\r
LAP_CMD="lapsh"\r
else\r
LAP_CMD="npx @lap-platform/lapsh"\r
fi\r
```\r
\r
Use `$LAP_CMD` (or the resolved form) for all commands below.\r
\r
---\r
\r
## Agent Flow -- Consuming APIs\r
\r
Use this flow when a user needs to find, download, or work with an API.\r
\r
### 1. Discover\r
\r
```bash\r
lapsh search \x3Cquery> [--tag \x3Ctag>] [--sort relevance|popularity|date] [--limit \x3Cn>]\r
```\r
\r
Search the LAP registry. Results show name, endpoint count, compression ratio, and a `[skill]` marker for installable skills.\r
\r
```bash\r
# Find payment APIs sorted by popularity\r
lapsh search payment --sort popularity\r
\r
# JSON output for scripting\r
lapsh search payment --json | jq '.results[] | select(.has_skill) | .name'\r
```\r
\r
### 2. Acquire\r
\r
**Option A -- Install a skill** (if `[skill]` marker present):\r
```bash\r
lapsh skill-install \x3Cname>\r
# Installs to ~/.claude/skills/\x3Cname>/\r
```\r
\r
**Option B -- Download the spec**:\r
```bash\r
lapsh get \x3Cname> -o \x3Cname>.lap\r
lapsh get \x3Cname> --lean -o \x3Cname>.lean.lap\r
```\r
\r
**Option C -- Compile a local spec**:\r
```bash\r
lapsh compile \x3Cspec-file> -o output.lap\r
lapsh compile \x3Cspec-file> -o output.lean.lap --lean\r
```\r
\r
Supported formats: OpenAPI (YAML/JSON), GraphQL (SDL), AsyncAPI, Protobuf, Postman, Smithy. Format is auto-detected.\r
\r
### 3. Use\r
\r
Once you have a `.lap` file, read it directly -- LAP is designed for AI consumption. Key markers:\r
\r
| Marker | Meaning |\r
|--------|---------|\r
| `@api` | API name, version, base URL |\r
| `@endpoint` | HTTP method + path |\r
| `@param` | Parameter (query, path, header) |\r
| `@body` | Request body schema |\r
| `@response` | Response status + schema |\r
| `@required` | Required fields |\r
| `@error` | Error response |\r
\r
---\r
\r
## Publisher Flow -- Publishing APIs\r
\r
Use this flow when a user wants to compile, package, and publish an API spec.\r
\r
### 1. Authenticate\r
\r
```bash\r
lapsh login\r
lapsh whoami # verify\r
```\r
\r
### 2. Compile\r
\r
```bash\r
lapsh compile spec.yaml -o spec.lap\r
lapsh compile spec.yaml -o spec.lean.lap --lean\r
```\r
\r
### 3. Generate Skill\r
\r
```bash\r
# Basic skill (Layer 1 -- mechanical)\r
lapsh skill spec.yaml -o skills/ --no-ai\r
\r
# AI-enhanced skill (Layer 2 -- requires claude CLI)\r
lapsh skill spec.yaml -o skills/ --ai\r
\r
# Generate and install directly\r
lapsh skill spec.yaml --install\r
```\r
\r
### 4. Publish\r
\r
```bash\r
lapsh publish spec.yaml --provider stripe.com\r
lapsh publish spec.yaml --provider stripe.com --name charges --source-url https://...\r
lapsh publish spec.yaml --provider stripe.com --skill # include skill\r
lapsh publish spec.yaml --provider stripe.com --skill --skill-ai # with AI skill\r
```\r
\r
### 5. Verify\r
\r
```bash\r
lapsh search \x3Cname> # confirm it appears in registry\r
```\r
\r
### 6. Batch Operations\r
\r
```bash\r
# Generate skills for all specs in a directory\r
lapsh skill-batch specs/ -o skills/\r
\r
```\r
\r
---\r
\r
## Quick Reference\r
\r
### Core Commands\r
\r
| Command | Description |\r
|---------|-------------|\r
| `compile \x3Cspec>` | Compile API spec to LAP format |\r
\r
### Registry Commands\r
\r
| Command | Description |\r
|---------|-------------|\r
| `search \x3Cquery>` | Search the LAP registry |\r
| `get \x3Cname>` | Download a LAP spec |\r
| `publish \x3Cspec>` | Compile and publish to registry |\r
| `login` | Authenticate via GitHub OAuth |\r
| `logout` | Revoke token |\r
| `whoami` | Show authenticated user |\r
\r
### Skill Commands\r
\r
| Command | Description |\r
|---------|-------------|\r
| `skill \x3Cspec>` | Generate Claude Code skill from spec |\r
| `skill-batch \x3Cdir>` | Batch generate skills |\r
| `skill-install \x3Cname>` | Install skill from registry |\r
\r
---\r
\r
## Error Recovery\r
\r
| Problem | Fix |\r
|---------|-----|\r
| `command not found: lapsh` | `npm install -g @lap-platform/lapsh` or use `npx @lap-platform/lapsh` |\r
| `Not authenticated` | Run `lapsh login` first |\r
| `Format detection failed` | Pass `-f openapi` (or graphql, asyncapi, protobuf, postman, smithy) |\r
| `403 Forbidden` on get | Spec may be private or registry may block without User-Agent -- update lapsh |\r
| `YAML parse error` | Check spec is valid YAML/JSON -- use a linter first |\r
| `Layer 2 requires claude` | Install Claude CLI or use `--no-ai` for Layer 1 skills |\r
| `Provider required` | `publish` needs `--provider \x3Cdomain>` (e.g., `--provider stripe.com`) |\r
\r
---\r
\r
## Environment Variables\r
\r
| Variable | Purpose | Default |\r
|----------|---------|---------|\r
| `LAP_REGISTRY` | Override registry URL | `https://registry.lap.sh` |\r
\r
---\r
\r
## References\r
\r
- [{baseDir}/references/agent-flow.md](references/agent-flow.md) -- Extended agent workflow with examples\r
- [{baseDir}/references/publisher-flow.md](references/publisher-flow.md) -- Extended publisher workflow with examples\r
- [{baseDir}/references/command-reference.md](references/command-reference.md) -- Complete command reference with all flags\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install lap - After installation, invoke the skill by name or use
/lap - Provide required inputs per the skill's parameter spec and get structured output
What is LAP CLI?
LAP CLI -- compile, search, and manage API specs for AI agents. Use when working with API specifications (OpenAPI, GraphQL, AsyncAPI, Protobuf, Postman), com... It is an AI Agent Skill for Claude Code / OpenClaw, with 220 downloads so far.
How do I install LAP CLI?
Run "/install lap" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is LAP CLI free?
Yes, LAP CLI is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does LAP CLI support?
LAP CLI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created LAP CLI?
It is built and maintained by mickmicksh (@mickmicksh); the current version is v1.0.0.