# Lap

> LAP CLI -- compile, search, and manage API specs for AI agents. Use when working with API specifications (OpenAPI, GraphQL, AsyncAPI, Protobuf, Postman), compiling specs to LAP format, searching the LAP registry, generating skills from API specs, or publishing APIs. Commands: init, compile, search, get, skill, skill-install, skill-batch, publish, login, logout, whoami.

- **Type:** Skill
- **Install:** `agentstack add skill-lap-platform-lap-codex`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Lap-Platform](https://agentstack.voostack.com/s/lap-platform)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Lap-Platform](https://github.com/Lap-Platform)
- **Source:** https://github.com/Lap-Platform/LAP/tree/main/lap/skills/codex
- **Website:** https://lap.sh/

## Install

```sh
agentstack add skill-lap-platform-lap-codex
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# LAP CLI

Compile, search, and manage API specs for AI agents.

## Command Resolution

IMPORTANT: Always use curl for registry operations (search, get, check). Do NOT use npx for these -- it downloads the package every time and takes minutes. curl is instant.

```bash
# Search the registry
curl -s 'https://registry.lap.sh/v1/search?q='

# Download a spec
curl -sH 'Accept: text/lap' https://registry.lap.sh/v1/apis/ -o .lap

# Get API metadata (version, endpoint count)
curl -sH 'Accept: application/json' https://registry.lap.sh/v1/apis/
```

Only use the CLI (`lapsh` or `npx @lap-platform/lapsh`) for operations that require it: compile, publish, skill-install, init.

---

## Agent Flow -- Consuming APIs

Use this flow when a user needs to find, download, or work with an API.

### 1. Discover

**Option A -- curl (fastest)**:
```bash
curl -s 'https://registry.lap.sh/v1/search?q='
```

**Option B -- CLI**:
```bash
lapsh search  [--tag ] [--sort relevance|popularity|date] [--limit ]
```

Results show name, endpoint count, compression ratio, and a `[skill]` marker for installable skills.

### 2. Acquire

**Option A -- curl (fastest)**:
```bash
curl -sH 'Accept: text/lap' https://registry.lap.sh/v1/apis/ -o .lap
```

**Option B -- Install a skill** (if `[skill]` marker present):
```bash
lapsh skill-install  --target codex
# Installs to ~/.codex/skills//
```

**Option C -- Download via CLI**:
```bash
lapsh get  -o .lap
lapsh get  --lean -o .lean.lap
```

**Option D -- Compile a local spec**:
```bash
lapsh compile  -o output.lap
lapsh compile  -o output.lean.lap --lean
```

Supported formats: OpenAPI (YAML/JSON), GraphQL (SDL), AsyncAPI, Protobuf, Postman, Smithy. Format is auto-detected.

### 3. Use

Once you have a `.lap` file, read it directly -- LAP is designed for AI consumption. Key markers:

| Marker | Meaning |
|--------|---------|
| `@api` | API name, version, base URL |
| `@endpoint` | HTTP method + path |
| `@param` | Parameter (query, path, header) |
| `@body` | Request body schema |
| `@response` | Response status + schema |
| `@required` | Required fields |
| `@error` | Error response |

---

## Publisher Flow -- Publishing APIs

Use this flow when a user wants to compile, package, and publish an API spec.

### 1. Authenticate

```bash
lapsh login
lapsh whoami        # verify
```

### 2. Compile

```bash
lapsh compile spec.yaml -o spec.lap
lapsh compile spec.yaml -o spec.lean.lap --lean
```

### 3. Generate Skill

```bash
# Basic skill (Layer 1 -- mechanical)
lapsh skill spec.yaml -o skills/ --no-ai

# AI-enhanced skill (Layer 2 -- requires claude CLI)
lapsh skill spec.yaml -o skills/ --ai

# Generate and install directly
lapsh skill spec.yaml --install
```

### 4. Publish

```bash
lapsh publish spec.yaml --provider stripe.com
lapsh publish spec.yaml --provider stripe.com --name charges --source-url https://...
lapsh publish spec.yaml --provider stripe.com --skill          # include skill
lapsh publish spec.yaml --provider stripe.com --skill --skill-ai  # with AI skill
```

### 5. Verify

```bash
lapsh search    # confirm it appears in registry
```

### 6. Batch Operations

```bash
# Generate skills for all specs in a directory
lapsh skill-batch specs/ -o skills/

```

---

## Quick Reference

### Core Commands

| Command | Description |
|---------|-------------|
| `compile ` | Compile API spec to LAP format |

### Registry Commands

| Command | Description |
|---------|-------------|
| `search ` | Search the LAP registry |
| `get ` | Download a LAP spec |
| `publish ` | Compile and publish to registry |
| `login` | Authenticate via GitHub OAuth |
| `logout` | Revoke token |
| `whoami` | Show authenticated user |

### Setup

| Command | Description |
|---------|-------------|
| `init --target codex` | Set up LAP for Codex CLI |
| `init --target cursor` | Set up LAP for Cursor |

### Skill Commands

| Command | Description |
|---------|-------------|
| `skill ` | Generate Codex CLI skill from spec |
| `skill-batch ` | Batch generate skills |
| `skill-install  --target codex` | Install skill from registry to Codex CLI |

---

## Error Recovery

| Problem | Fix |
|---------|-----|
| `command not found: lapsh` | `npm install -g @lap-platform/lapsh` or use `npx @lap-platform/lapsh` |
| `Not authenticated` | Run `lapsh login` first |
| `Format detection failed` | Pass `-f openapi` (or graphql, asyncapi, protobuf, postman, smithy) |
| `403 Forbidden` on get | Spec may be private or registry may block without User-Agent -- update lapsh |
| `YAML parse error` | Check spec is valid YAML/JSON -- use a linter first |
| `Layer 2 requires claude` | Install Claude CLI or use `--no-ai` for Layer 1 skills |
| `Provider required` | `publish` needs `--provider ` (e.g., `--provider stripe.com`) |

---

## Environment Variables

| Variable | Purpose | Default |
|----------|---------|---------|
| `LAP_REGISTRY` | Override registry URL | `https://registry.lap.sh` |

---

## References

- [{baseDir}/references/agent-flow.md](references/agent-flow.md) -- Extended agent workflow with examples
- [{baseDir}/references/publisher-flow.md](references/publisher-flow.md) -- Extended publisher workflow with examples
- [{baseDir}/references/command-reference.md](references/command-reference.md) -- Complete command reference with all flags

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Lap-Platform](https://github.com/Lap-Platform)
- **Source:** [Lap-Platform/LAP](https://github.com/Lap-Platform/LAP)
- **License:** Apache-2.0
- **Homepage:** https://lap.sh/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-lap-platform-lap-codex
- Seller: https://agentstack.voostack.com/s/lap-platform
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
