Repository navigation
feat(cli): lens ext lists, pulls, checks and pushes extension manifests - #563
Merged
Merged
Conversation
`lens ext pull` writes extensions' manifests into a folder, `push` saves the changed ones as new versions and the new ones as extensions, `check` checks them without saving, and `list` lists them (--json for agents). It works on this install's database, as the first admin or --as, or on any Lens server with --url and an API token. Pulled files carry `version: N`, so a push won't save over changes made in Lens since, and a pull won't overwrite a file's own changes, without --force. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
…-k05fsx # Conflicts: # CHANGELOG.md
…-k05fsx # Conflicts: # CHANGELOG.md
…#400 is released Main's requirements check fails since v0.15.0 released #400 while the README still listed it In progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
Owner
Author
|
Clicks failed on the phone only, in Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8
21 of 23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: extensions' manifests went in and out one at a time, through the Extensions page or
POST /api/v1/extensions, so keeping them in a git repository meant copying each by hand.After:
lens extkeeps them as files in a folder.With no address it works on this install's database as the first admin (or
--as), like the otherlenscommands; with--urland--token(orLENS_URL,LENS_TOKEN) it works on any Lens server through the existing/api/v1/extensionsroutes.How:
app/cli_ext.pyhas two thin backends with the same six calls (list, get, check, create, save, share), one over the API withurllib, one callingextensions.pydirectly and auditing as the API does. A pulled file carriesversion: N(whichcheck_manifestalready ignores). A push refuses when the extension changed in Lens since that version, and a pull refuses to overwrite a file changed since it was pulled, each until--force. A push compares the file with Lens's manifest as read and, if they differ in form, as the check tidies both, so a hand-written file with defaults left out saves no empty versions. Two files with one name are both refused.visibilityandnamespacesin a file are applied on push; without them sharing is untouched.Motivation and Context
The last open item of the assistant extensions work (DEVLOG 2026-10-03: "
lens extCLI (push/pull manifests)").Types of changes< 10000 /h2>- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to change;
- The title is a Conventional Commit.
- My code follows the code style of this project (
- I added or updated tests:
- My change requires documentation updates, and I have updated
- Users need more than the title to understand it, so I wrote it in
- Goal: list, pull, push and check, as asked; merged on green CI. Local CI (
- Agents:
- Zero setup:
- Fewest keystrokes: defaults to this folder and your own extensions; one command per folder.
- Configurable: n/a, no new settings.
- Light: standard library only (urllib), nothing new installed.
- Private and secure: the remote path uses API tokens with their owner's rights; the local path is the database access every
- Cost: n/a, no model calls (checking an MCP server lists its tools, as the API check already does).
- User decides: nothing is overwritten on either side without
- Upgrades: n/a, no stored-data change.
- Honest: README built list and requirements row name only what this PR adds.
- Tests, docs and generated files updated (no API change, so no
- Open standards: manifests stay YAML and Markdown with frontmatter; no new dependencies.
- Reported with evidence. Refine later: pull doesn't write sharing into files, deleting an extension isn't a push (removing its file does nothing), and a real MCP token typed into a file makes every push save a version, since Lens shows it as
- Reuse:
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_cli_ext.py(this install's database, and a real HTTP server with editor and viewer tokens).docs/accordingly: docs/assistant.md "Manifests as files:lens ext", docs/get-started.md, README, docs/requirements.md.changelog.d/lens-ext.md.Done questions (AGENTS.md)
ci/local-ci.sh: pre-commit, title, backend) passed on the first commit.lens ext list --json, exit codes on every command, and everything it does is the existing API.docker compose exec backend lens ext …works with no token; a remote server needs only an API token.lenscommand has, audited withvia: cli. File names come from extension names ([a-z][a-z0-9_]), so a pull can't write outside its folder. No new attack surface for threat-model.md.--force; defaults unchanged.make openapi).••••.parse_manifest,check_manifest,to_manifest,save_versionand the existing routes; nothing reimplemented.🤖 Generated with Claude Code
https://claude.ai/code/session_01FbmJ86QaV2YwusjgNowpf8