Skip to main content

leji (Python)

Reference SDK and CLI for the Leji specification: the open specification for the shared context layer of AI-native teams.

pip install leji        # or: uv tool install leji / pipx install leji
leji init               # bootstrap a context layer interactively
leji validate           # manifest, artifacts, frontmatter, lint rules
leji index              # generate the context index
leji index --check      # fail when the index is stale
leji changelog check    # append-only discipline
leji freshness          # review-horizon report
leji conformance        # score the layer against its claimed level
leji badge              # write the self-attested conformance badge and its markdown
leji status             # unindexed, dangling, and stale documents
leji route              # the governed context a task's scope routes to
leji viewer             # generate the static viewer for the context layer
leji viewer build       # export a self-contained static viewer folder
leji viewer serve       # generate, then serve it locally
leji view               # generate, serve, and open it in your browser
leji detect             # find installed agent hosts
leji start              # open the layer in a detected agent host
leji adopt              # map an existing entrypoint into a context layer
leji ci                 # add a validate workflow (--provider github|gitlab|circleci|azure)
leji agent --name <n>   # bind an additional named agent into the layer
leji mounts hydrate     # materialize declared federation mounts into the resolver cache
leji mounts status      # each mount's availability, integrity, and pin ancestry
leji mounts locate      # resolver state for one mount: projection path, pin, verification
leji mounts update-pin  # move one mount's declared pin, verified against the source
leji changelog compact  # fold the oldest changelog entries into one compaction entry

See the full command reference (flags, exit codes, examples) at https://leji.org/cli/.

Inside a repository that declares leji, has a project environment inside the repository (.venv, or uv's UV_PROJECT_ENVIRONMENT) with a copy meeting the layer's minimum, leji runs that copy; set LEJI_NO_LOCAL to any value to run this one.

Behaviorally identical to the @leji-org/leji npm package and the Go SDK: same commands, same flags, same findings, same exit codes (0 clean, 1 findings, 2 usage error); the one runtime-specific behavior is the hand-off above, which the Node and Python CLIs perform and the Go CLI does not (there, run the pinned copy with go tool leji). All three implementations are tested against one shared fixture suite. Install whichever matches your toolchain; agents and CI see the same tool either way.

Supports spec line 1.0. Schemas and templates for that line ship inside the package; no network access is needed.

Metadata

Release files for leji 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leji 1.4.1
File Size Uploaded
leji-1.4.1.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for leji 1.4.1
File Interpreter ABI Platform
leji-1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.9 MB

Release files / leji-1.4.1.tar.gz

Download URL leji-1.4.1.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9ee292e14b0c0742016c25101e1d3167c2d73506634a3578af97a123a079dade
BLAKE2b-256 checksum
How to use checksums
c0a9e242106c280fe0a5433f82a636d9ffaaf25dd43fb55bcceb75208c774c5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / leji-1.4.1-py3-none-any.whl

Download URL leji-1.4.1-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
be3797f539260dc03a1b947e557ee99bd61aee426f2e025cb5059389ec5e5720
BLAKE2b-256 checksum
How to use checksums
37a69a369f4e9c4abf1d498c2490f43792e432ec8436a6d478ac6e57ea468f36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

This release

1.4.1 This release

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page