# Apilift

Apilift is proprietary software operated by Egor Sergeev. Use is governed by the [Terms of Service](https://apilift.dev/terms), [Privacy Policy](https://apilift.dev/privacy) and [Acceptable Use Policy](https://apilift.dev/acceptable-use). Reports and rights requests use the [legal report channel](https://apilift.dev/report).

Turn a logged-in UI-only web service into a persistent local CLI an AI agent can drive and extend when coverage is missing.

Apilift captures main-frame HTTP traffic through the user's signed-in Chrome profile, lets the discovery author define product-semantic service, entity, and operation resources, and runs each operation through the same browser-owned runtime used by consumers before publishing it. The agent's own Chrome extension controls the page and the separate Apilift extension records active windows; credentials are neither extracted nor stored.

## Install

```bash
pipx install apilift
apilift setup --agent codex|claude --code <one-time-code>
apilift browser status --agent codex|claude
```

Setup starts from the signed-in dashboard, which mints the one-time code; the command links the installation, accepts the current terms, installs the namespaced `apilift:use` and `apilift:discover` plugin skills from the package's single skill source for Codex or Claude Code, registers the native host, and then drives the remaining Chrome steps deterministically through `apilift setup continue`. The status command returns and prints a three-part onboarding checklist: the runtime vendor's Chrome control, Apilift's Native Messaging host, and the Chrome Web Store extension. The agent runs the terminal setup itself and asks the user only for missing Chrome clicks. Repository development keeps an isolated unpacked build with a separate extension identity. Supported global `pipx` and `uv tool` installations check the bounded public release state, install a newer CLI release before running the requested command, and re-execute that command through the updated CLI; development and CI environments never self-update, and `APILIFT_AUTO_UPDATE=0` disables the check. Use `apilift agent uninstall codex|claude` to remove only the plugin managed by Apilift; the CLI refreshes it automatically after an upgrade. Set `APILIFT_HOME` to override the platform user-data catalog.

## Shared registry

The registry stores service metadata, optional auth recipes, entity metadata, and operations as separate authoring resources. Every accepted resource mutation uses resource-local compare-and-swap, returns synchronously, and creates a complete immutable service revision. Operation payloads cannot carry service, entity, or auth mechanisms, and raw captures and observations never enter the registry projection. A service remains `building` until its first callable or unavailable operation; consumer snapshots omit empty entities and expose only active services.

```bash
apilift sync [service] [--json]
apilift doctor [--json]
```

The first registry mutation creates a random installation credential stored separately from target-service browser sessions with file mode `0600`; the registry stores only its SHA-256 hash. `APILIFT_REGISTRY_URL` overrides the production default `https://registry.apilift.dev` for local development and self-hosting.

## Agent entrypoint

```bash
apilift services
apilift <service> --help
apilift <service> docs <entity> <entity.operation>
apilift <service> search '<user intent>'
apilift <service> <entity> <operation> --help
```

The CLI is the documentation source: service help is a compact capability map, entity help explains relations and identifier sources, operation help discloses parameters and effects, and batch selectors reveal only the branches a scenario needs. Missing coverage exits with `7`; the agent then returns to the user, offers a discovery run, and writes the need it discovered. One discovery subagent owns conceptual completeness and publication; the parent agent reloads help and continues the original request through the installed CLI.

## Several agents at once

Agents working on one service at the same time each get their own session, recognized from the conversation the runtime is already running. Context values belong to the session that chose them, so one agent cannot redirect another's next command, and a peer arriving is reported on the next command rather than never. The signed-in browser and the account behind it are shared by design, so one state-changing command runs at a time per service and a second one waits for it, then exits `8` rather than racing.

## Layout

| Path | What it is |
|---|---|
| `src/apilift/` | Installable catalog, documentation renderer, runtime, compiler, capture broker, and native host |
| `extensions/chrome/` | Independent Chrome Web Store extension module, release package, listing metadata, and image sources |
| `server/` | FastAPI registry, PostgreSQL worker, Alembic migrations, integration tests, and deployment runbook |
| `plugins/apilift/skills/use/` | Consumer trajectory and resource-aware missing-coverage hand-off |
| `plugins/apilift/skills/discover/` | Service, entity, and operation authoring in a persistent user-data workspace |
| `.agents/apilift/tests/` | Generic helpdesk fixture and deterministic regression suite |
| `knowledge/` | Current business and product state |

Real-service captures, sessions, observations, resource drafts, run receipts, reports, and credentials never belong in this repository; the per-user catalog stores runtime state outside the working tree.
