Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/swperb/imgcli/agents-mdgit clone --depth 1 https://github.com/swperb/imgcliWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01265 | $0.01265 |
| Opus 5 | $0.00633 | $0.00633 |
| Sonnet 5 | $0.00253 | $0.00253 |
| Haiku 4.5 | $0.00127 | $0.00127 |
Grade B, and why
imgcli AGENTS.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
make && sudo make install # -> imgcli on PATH ; needs only a C compiler + libm How it starts
The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — using imgcli from an agent
Token-economical guide for AI agents and scripts. imgcli is a single, no-dependency C binary that converts and processes images. It is deterministic, non-interactive, and emits machine-readable JSON.
One-line mental model
imgcli [-i INPUT]... [-vf "FILTER,FILTER,..."] [-q N] [-f FMT] -y [--json] OUTPUT
Output format = OUTPUT's extension, or -f FMT (png, jpg, bmp, tga, ppm, qoi). Filters run left→right.
INPUT and OUTPUT may be - for stdin/stdout (pipes); -f is required for stdout. When OUTPUT is -, the JSON/result line goes to stderr so stdout carries only the image bytes.
Always do this in automation
- Pass
-y(overwrite without prompting) and--json(parseable result). - imgcli never prompts and never uses the network. One process per conversion.
Build / install (once)
make && sudo make install # -> imgcli on PATH ; needs only a C compiler + libm
JSON contract
Success (stdout, exit 0):
{"ok":true,"output":"out.png","width":256,"height":171,"format":"png","bytes":34122}
-info --json (stdout, exit 0):
{"ok":true,"inputs":[{"path":"in.jpg","width":4000,"height":3000,"channels":4}]}
--dry-run --json — validate a graph + get output dims without writing (stdout, exit 0):
{"ok":true,"dry_run":true,"width":512,"height":341,"format":"png"}
--out-dir … --json — batch; one result per input, exit ≠ 0 if any failed:
{"ok":true,"batch":true,"results":[{"input":"a.jpg","output":"out/a.png","ok":true,"width":400,"height":300,"bytes":34122},{"input":"bad.png","ok":false,"error":"…"}],"processed":2,"failed":1}
Error (stderr, exit ≠ 0):
{"ok":false,"error":"cannot open input 'x.png': ..."}
Exit codes
| code | meaning |
|---|---|
| 0 | success |
| 1 | runtime error (decode / filter / write) |
| 2 | usage error (bad or missing arguments) |
Recipes (intent → command)
| Intent | Command |
|---|---|
| Convert format | imgcli -y -i in.png out.jpg |
| Resize to width 800, keep aspect | imgcli -y -i in.jpg -vf "scale=800:-1" out.jpg |
| Resize to exact box | imgcli -y -i in.jpg -vf "scale=512:512" out.png |
| Make a thumbnail (HQ downscale) | imgcli -y -i in.jpg -vf "scale=256:-1:lanczos" -q 80 thumb.jpg |
| Crop centre 400×400 | imgcli -y -i in.jpg -vf "crop=400:400" out.png |
| Rotate 90° | imgcli -y -i in.jpg -vf "transpose=90" out.png |
| Grayscale | imgcli -y -i in.jpg -vf "grayscale" out.png |
| Compress JPEG (quality 60) | imgcli -y -q 60 -i in.png out.jpg |
| Blur | imgcli -y -i in.jpg -vf "gblur=3" out.png |
| Overlay a logo at 20,20 | imgcli -y -i bg.png -i logo.png -vf "overlay=20:20" out.png |
| Probe dimensions only | imgcli --json -info -i in.jpg |
| Validate a filtergraph (write nothing) | imgcli --json --dry-run -i in.jpg -vf "scale=512:-1,grayscale" |
| Chain several ops | imgcli -y -i in.jpg -vf "scale=1024:-1,grayscale,contrast=1.2,gblur=1" out.png |
| Pipe (stdin → stdout) | … | imgcli -i - -vf "scale=512:-1" -f png - > out.png |
| Batch a folder | imgcli --json -i "in/*.jpg" --out-dir out -vf "scale=400:-1:lanczos" -f png |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 91 lines · 1,265 tokens per session scan B 158f8016e036
imgcli AGENTS.md is an instructions file published in the GitHub repository swperb/imgcli (0 stars, last pushed 15d ago), licensed MIT. It adds 1,265 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
openscreen AGENTS.md
Instructions for getopenscreen/openscreen, covering agents.md, setup commands, development principles, project layout and code style.
tweakcc AGENTS.md
Instructions for Piebald-AI/tweakcc, covering agents.md, development commands, build, testing and linting & formatting.
c-code-style AGENTS.md
Instructions for MaJerle/c-code-style, covering agent instructions, source of truth, what the formatter fixes for you, what you must apply yourself while writing and format and verify.
watch-skill AGENTS.md
Instructions for oxbshw/watch-skill, covering working on watch skill, what this project is, layout, commands and rules that are not negotiable.
ruby2d AGENTS.md
Instructions for ruby2d/ruby2d, covering ruby 2d guide for ai coding agents, testing, architecture, multi-ruby support and documentation.
vue-tui AGENTS.md
Instructions for vuejs-ai/vue-tui, covering common pitfalls & best practices, project context records (pcr), using vite+, the unified toolchain for the web and review checklist.