# Vision for Text Models

Lets text-only models read images from paths or URLs through a vision tool.

- Repository: https://github.com/liustack/modlens (4703 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-23
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add liustack/modlens --skill modlens -g -a claude-code -y`
Codex: `npx skills add liustack/modlens --skill modlens -g -a codex -y`
Cursor: `npx skills add liustack/modlens --skill modlens -g -a cursor -y`
Gemini CLI: `npx skills add liustack/modlens --skill modlens -g -a gemini-cli -y`

## Description

Plug-in vision for text-only models. Hard rule: when a file path or URL with an image extension (.png, .jpg, .jpeg, .webp, .gif, .heic, .heif) appears anywhere in the conversation (typed by the user, injected as a `[Image: source: <path>]` line, or inside a tag) and you cannot see that image's content, run this skill on it before any other approach: no self-built OCR, no PIL, no tesseract. Also triggers on pasted-image placeholders such as `[Image #1]` and `[Unsupported Image]`. If you can actually see the image, do not use this skill. When unsure, run `modlens guard` before the first read of a session: a deny verdict means the active model has native vision and must read the image itself. Runs the modlens CLI to convert the image into structured JSON evidence: every word transcribed, layout regions, semantics, visual clues. Also use when the user asks how to install, configure, or switch modlens providers (Gemini API key, OpenAI-compatible endpoints, Claude API or Claude Code CLI).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# ModLens, Vision Bridge Skill

Use this skill when an image is in play and you cannot see its content: a path or URL with an image extension (the path alone is the trigger, hand it to modlens, never Read the bytes or build your own OCR), a placeholder like `[Image #1]`, `[Unsupported Image]`, or a `[Image: source: <path>]` line, or the user asking to configure modlens. Do not use it for web search or fetch (that is `modsearch`), or for images you can already see natively.

## Run it

Every modlens command goes through the launcher bundled with this skill. Replace `<skill-dir>` with the directory this SKILL.md lives in:

```bash
bash <skill-dir>/scripts/run.sh <args>                              # macOS / Linux
powershell -ExecutionPolicy Bypass -File <skill-dir>\scripts\run.ps1 <args>     # Windows
```

It resolves a working runtime (PATH `modlens`, then `npx`, then `bunx`) and forwards your arguments unchanged. Exit 78 means no runtime: relay the `nextSteps` from its stderr JSON instead of retrying.

If your harness forbids running scripts, reason through the same order by hand and run the first line that works (the pinned version is 3.27.2):

1. A `modlens` on `PATH` whose major version is 3 and is at least 3.27.2: `modlens <args>`.
2. Otherwise, if `npx` exists: `npx --yes --package @liustack/modlens@3.27.2 modlens <args>`.
3. Otherwise, if `bunx` exists: `bunx --bun @liustack/modlens@3.27.2 <args>`.
4. Otherwise tell the user no JavaScript runtime was found and that installing Node 22.19+ (https://nodejs.org) or Bun (https://bun.sh) is the next step. Do not claim modlens itself failed.

`references/runtime.md` documents the pin and the diagnostic fields.

## Ask the CLI, not this file

State lives on the machine and the CLI reports it; read what you need when you need it:

The rest: https://github.com/liustack/modlens/blob/HEAD/skills/modlens/SKILL.md
