Automatically generate versioned API snapshots on every merge. Explore changes in a UI with color-coded diff highlighting. Built for FastAPI + TypeScript teams.
Project description
ApiLens
Automatically generate versioned API snapshots on every merge. Explore changes between any two versions in a UI with color-coded diff highlighting. Built for FastAPI + TypeScript teams.
Features
- Automatic snapshots — captures your spec on every merge to
main; skips if nothing changed - Visual diff viewer — color-coded UI showing new, removed, and modified endpoints with field-level detail
- PR comments — posts a Markdown summary of API changes on every pull request
- AI prompts — one-click copy of prompts to help update frontend TypeScript types
- Zero integration — no changes to your FastAPI app; runs completely standalone
Install
pip install openapi-lens[serve]
Setup
1. Add the config and workflow files
1a. Copy apilens.toml into your project root. Set app to the dotted import path of your FastAPI app (e.g. myapp.main:app — same as you'd pass to uvicorn). No secrets, safe to commit.
1b. Copy the two workflow files from workflow-templates/ into your .github/workflows/:
openapi-snapshot.yml— runs on every push tomain. Generates your OpenAPI spec, compares it to the last snapshot, and commits a new one only if something changed.api-diff.yml— runs on every PR. Posts a comment showing exactly what endpoints and fields changed.
Both workflows use the built-in GITHUB_TOKEN — no secrets to configure.
3. Browse the diff viewer locally
apilens serve
# → http://127.0.0.1:8765
Point it at any repo that has an openapi-snapshots/ directory. Optionally password-protect it:
APILENS_PASSWORD=secret apilens serve
CLI Reference
apilens generate <output> Write the current OpenAPI spec to a JSON file
apilens snapshot Write a snapshot (skips if spec unchanged)
apilens serve Start the visual diff viewer
Disabling the PR Comment
To temporarily disable without deleting the workflow, add false && to the if: condition in api-diff.yml:
if: false && github.event_name == 'pull_request'
Remove the false && to re-enable.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openapi_lens-1.0.2.tar.gz.
File metadata
- Download URL: openapi_lens-1.0.2.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f01608b9d0fb38ff59eabf35477210940f92edbf0d94b9f35ca6d90b87fe9eb3
|
|
| MD5 |
7887ba2a5a13530ac1469c1f4b0aff5f
|
|
| BLAKE2b-256 |
e038774ac6c160a8f36a6c2803ccc5cb4240da38e83be539944e1cba78107e3c
|
Provenance
The following attestation bundles were made for openapi_lens-1.0.2.tar.gz:
Publisher:
publish.yml on MariaC27/api-lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openapi_lens-1.0.2.tar.gz -
Subject digest:
f01608b9d0fb38ff59eabf35477210940f92edbf0d94b9f35ca6d90b87fe9eb3 - Sigstore transparency entry: 1322946886
- Sigstore integration time:
-
Permalink:
MariaC27/api-lens@881fb3e7a7341edcb546acdba7ef11dd7d54f33c -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/MariaC27
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@881fb3e7a7341edcb546acdba7ef11dd7d54f33c -
Trigger Event:
push
-
Statement type:
File details
Details for the file openapi_lens-1.0.2-py3-none-any.whl.
File metadata
- Download URL: openapi_lens-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a80f46576205773408a254c4b459b038393203780137a3e16de7fa0073c73d
|
|
| MD5 |
0bfa0fd16c9f323f3fdf3d5a42ffe522
|
|
| BLAKE2b-256 |
e8e0dec2b08b27b618684a741cbd71bc01036e20c4012eb69e3df0e49e34de60
|
Provenance
The following attestation bundles were made for openapi_lens-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on MariaC27/api-lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openapi_lens-1.0.2-py3-none-any.whl -
Subject digest:
59a80f46576205773408a254c4b459b038393203780137a3e16de7fa0073c73d - Sigstore transparency entry: 1322947020
- Sigstore integration time:
-
Permalink:
MariaC27/api-lens@881fb3e7a7341edcb546acdba7ef11dd7d54f33c -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/MariaC27
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@881fb3e7a7341edcb546acdba7ef11dd7d54f33c -
Trigger Event:
push
-
Statement type: