modlens
AGENTS.md4.1k starsChanged 4 months agoMITView on GitHub
Provide the modlens CLI tool that converts image sources (local path or remote URL) into structured text evidence for non-vision LLM workflows. The contract: an image the user hands over is read once, and that read leaves text later turns can quote. The image is in the conversation because the user pasted it, dropped a path, or gave a URL. Visual parsing is the only job. Web search and page fetching live in modsearch.
- Reads credentials
- Installs packages
Trending
Less talk lately.about the whole repository
Who's talking about liustack/modlens
- @github-trending-js.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 liustack / modlens ⭐ 1,666 (+536) 🗒 TypeScript The first vision …”Bluesky · Aug 15, 2026 · 1 likes
- sudosubin/agents.nix“agent-skills.github.liustack.modlens: 3.26.5 → 3.26.6”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.liustack.modlens: 3.26.3 → 3.26.5”GitHub · Oct 3, 2026
- sudosubin/agents.nix“agent-skills.github.liustack.modlens: init at 3.26.3”GitHub · Sep 29, 2026
- bradeGithub/DSH-Plugins-Marketplace“[安装反馈] 异常: liustack/modlens”GitHub · Sep 27, 2026
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub and Bluesky (15 times).
On GitHub · 14
- Oct 4, 2026agent-skills.github.liustack.modlens: 3.26.5 → 3.26.6 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.liustack.modlens: 3.26.3 → 3.26.5 — sudosubin/agents.nix0 reactions
- Sep 29, 2026agent-skills.github.liustack.modlens: init at 3.26.3 — sudosubin/agents.nix0 reactions
- Sep 27, 2026[安装反馈] 异常: liustack/modlens — bradeGithub/DSH-Plugins-Marketplace0 reactions · 1 comment
- Sep 20, 2026Wave 2: ModLens + dsh-web-ui limits copy and FAQ 0→1 — vbarter/dsh-plugin-registry0 reactions
9 more on GitHub
- Sep 13, 2026chore(deps): bump @liustack/modlens from 3.25.4 to 3.26.1 — pi-harness/pi-harness-plugins0 reactions
- Sep 7, 2026多模态前端架构调研:三层分流 + VLM subagent(视觉/听觉/文本) — Click-In-Studio/clickin-project-manager0 reactions · 1 comment
- Aug 31, 2026test triage — awesome-deepseekharness/awesome-deepseek-harness0 reactions · 4 comments
- Aug 31, 2026整理了一份 DeepSeek Harness 必备插件清单! — szwnba/affweb0 reactions
- Aug 25, 2026TUI: clipboard image paste for text-only models saves the PNG, then discards its path — insert the path as text instead — openai/codex0 reactions · 2 comments
- Aug 22, 2026Catalog install command for liustack/modlens is unsupported (git install has no dist); auto-report misattributes env errors — dshplugin/dsh-plugin-hub0 reactions · 1 comment
- Aug 20, 2026catalog: add modlens (community curation, created by @liustack) — diegosouzapw/awesome-omni-dsh-plugins0 reactions
- Aug 16, 2026[Plugin]: ModLens — alexchenzl/dsh-plugin-directory0 reactions · 2 comments
- Aug 14, 2026[Issue]: README 未声明 pnpm 11 release-age 门禁——新版本冷却期内按文档安装会装到旧版 0.1.5(Apply 皮肤导致 boot 崩溃) — zhu1090093659/dsh-web0 reactions · 2 comments
On Bluesky · 1
- Aug 15, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 liustack / modlens ⭐ 1,666 (+536) 🗒 TypeScript The first vision plugin for DeepSeek Harness, and… — @github-trending-js.bsky.social1 likes and repost · 1 reply
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- modlensSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 93
Before creating a new doc, run pnpm docs:list to review the existing index.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Overview (for AI Agent)
Goal
Provide the modlens CLI tool that converts image sources (local path or remote URL) into structured text evidence for non-vision LLM workflows.
Scope
The contract: an image the user hands over is read once, and that read leaves text later turns can quote. The image is in the conversation because the user pasted it, dropped a path, or gave a URL.
Do not add:
- a camera, screenshot capture, or hotkeys
- CDP, or holding a browser session
- computer-use (screen plus keyboard and mouse)
- a pixel toolbox (grounding, crop, pixel-diff, reconstructing a UI)
- bounding boxes or confidence scores (dropped from the schema on purpose)
Visual parsing is the only job. Web search and page fetching live in modsearch.
Technical Approach
- Six vision providers behind one interface (
src/providers/index.ts). Subprocess providers implementbuildInvocation+parseOutput(antigravity-cli, claude-cli, kimi-cli); in-process API providers implementexecute(gemini-api, openai, anthropic).antigravity-cliis the zero-config default, andkimi-cliruns only when named, since it spends a subscription. - Schema-enforced JSON output wherever the backend allows:
--json-schemaon the Claude and Antigravity CLIs (kimi-cli has no such flag and uses the template),responseJsonSchemaon gemini-api, a forced tool call on anthropic. The openai route uses a template-instance prompt (weak gateways echo raw schemas back) plus shape validation that fails loudly. - Layered config: CLI flags >
~/.modlens/config.json(managed bymodlens config init/set/show, 0600, masked rendering) > built-ins. Since 3.17.0 a provider's settings come from one source, whole: the file when it mentions that provider, the bound environment variables (GEMINI_API_KEY,GEMINI_BASE_URL,OPENAI_API_KEY,OPENAI_BASE_URL,ANTHROPIC_API_KEY,ANTHROPIC_BASE_URL) when it does not. They used to merge field by field, and an endpoint and a key are one credential, so drawing halves from two places built a pairing that existed in neither.apiKey(file or env) accepts a comma-separated list and rotates after auth, rate-limit, or quota failures. Quota cooldown state lives in~/.modlens/state.json.MODLENS_MODEL,MODLENS_HARNESSand the proxy conventions are unaffected. - Vendor knobs pass through, they are not modelled:
<provider>.extraBody(or--extra-body) deep-merges a JSON object into the request body of the three API providers, which is how thinking gets turned off. No per-vendor table lives in the code, because the spelling differs per gateway and a wrong guess either 400s or is ignored silently. The fields carrying the image, the prompt, and the schema are reserved (src/util/extraBody.ts). - Paste recovery across harnesses:
modlens recover-pastepulls pasted image bytes out of local session storage (pastes never hit a regular temp file). It supports Claude Code and Pi (JSONL transcripts) and OpenCode (SQLite), detects Codex and defers to its on-disk temp files, and scopes to the harness it runs inside via process ancestry. Exact targeting via--session, else newest-image-timestamp scanning. Storage layouts are each harness's internals, so treat this as best-effort. - Single responsibility: visual parsing only. Web search and page fetching live in
modsearch.
pnpm installCode Organization
src/
├── main.ts # CLI entry: analyze (default), guard, recover-paste, doctor, config, state subcommands
├── analyzer.ts # orchestration: input resolution, config merge, provider dispatch
├── config.ts # layered config load/set/show/init
├── cooldown.ts # quota cooldown store at ~/.modlens/state.json
├── doctor.ts # offline diagnostics: Node, provider readiness, selection, harness, config perms
├── prompt.ts # vision prompt (local/remote agent modes + inline api mode)
├── schema.ts # vision result JSON schema (single source of truth)
├── imageInput.ts # base64/mime helpers (local + remote image bytes)
├── util/json.ts # shared JSON helpers (parse, extract, truncate)
├── guard/ # invocation guard (issue #15): rules (deny globs), modelSniff (active model from session storage), index (signal precedence)
├── recoverPaste/ # paste recovery: adapters/{claude,pi,opencode}, detect, jsonl, index
└── providers/
├── index.ts # provider interface + registry (5 providers + aliases)
├── antigravity.ts # agy subprocess provider
├── claudeCli.ts # claude subprocess provider (Read-only tools)
├── geminiApi.ts # Gemini Developer API
├── openaiCompat.ts # any OpenAI-compatible multimodal endpoint
└── anthropicApi.ts # Claude API (forced tool call)Tests are co-located: modules get an adjacent *.test.ts (vitest), the CLI assembly in main.ts included. A few pure-data modules such as schema.ts carry none, since there is no behavior to pin. The CLI is exposed via dist/main.js (vite lib build, Node built-ins auto-externalized).
Skills Directory
skills/modlens/
├── SKILL.md # triggering + per-harness path finding + workflow
└── references/
├── output-schema.md # output contract
└── configure.md # per-provider setup recipes the agent can executeCLI Usage
modlens -i screenshot.png # default provider (antigravity-cli)
modlens -i screenshot.png -p gemini-api # fastest free route (5-10s)
modlens recover-paste --session <uuid> # Claude Code pasted-image recovery
modlens doctor # offline config/routing diagnosis (--json for machine output)
modlens config showVerification
pnpm typecheck && pnpm testfor unit-level checks;pnpm buildmust produce a singledist/main.js.- Real end-to-end runs consume the user's provider quota (agy, API keys, Claude subscription). Ask before running them in bulk.
Evals
- Every experiment leaves a reproducible artifact.
evals/holds seed cases (evals/cases/<id>/case.json) and a runner (pnpm eval, orpnpm eval --dry-runto validate without a provider call). Each live run writes one evidence artifact per case toevals/results/<date>/(git-ignored), recording the command, tool version and commit, provider and model, input SHA-256, raw output, expected points and scoring, latency, usage, and any error or degradation. Format and fields are documented inevals/README.md. - Evals are local and on-demand: they spend real quota and never run in CI. The runner only checks containment and schema shape; whether a model obeyed a prompt injection is a human read of the artifact.
Operational Docs (docs/)
- Operational docs use front-matter metadata (
summary,read_when). - Before creating a new doc, run
pnpm docs:listto review the existing index. - Existing docs:
troubleshooting(every error this CLI prints, with causes and fixes),harness-setup(how a pasted image reaches the model in each harness),security(recovered-image privacy, permissions passed to engines, untrusted image content),testing,commit,research-gemini-claude-skills(historical, Gemini CLI era).
.gitignore must include
node_modules/dist/skills/**/outputs/- common logs/cache/system files
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

