VS Code extension

stay in the editor.
same CLI underneath.

right-click in the sidebar or hit the command palette — it’s still leano, just wired up for lazy people (complimentary). fully local. no server. no API keys.

npx --yes leano ./public --format webp --quality 80 --json

search leano-vscode if the store's being weird. linux, mac, windows — same as the CLI.

what it does

1explorer — right-click a .jpg / .jpeg / .png → optimize image. folder → optimize folder.
2command palette — Leano: Optimize Images opens a folder picker (same flow as a folder right-click).
3you get a short notification, then a summary with file count and rough total savings from the CLI’s --json line.
4stdout / stderr go to the Leano output channel so you can actually read what happened.

what you need

ThingNotes
VS Code (or compatible editor)^1.85 engines field — same as the extension’s package.json.
Node + npmextension shells out to npx leano. Node ≥ 18, same as the CLI.
network (first run)npx might download stuff once. npx --yes skips the annoying prompts.

sidebar right-clicks

the CLI only eats directories, so a single image run uses a temp folder under the hood — then outputs get merged back next to your file.

You clickMenuWhat happens
.jpg / .jpeg / .pngOptimize Imagetemp folder with that one file → run CLI → merge into the parent directory.
a folderOptimize FolderCLI runs on that path directly. boring. reliable.

command palette

CommandIf you didn’t start from the sidebar
Optimize Imageopens an image picker.
Optimize Folderopens a folder picker.
Leano: Optimize Imagesfolder picker — same as the folder flow.

output folder & in-place

leano.inPlaceCLIResult
off (default)(no flag)you get a sibling <folder>-optimized directory. classic leano behaviour.
on--in-placeswaps folder contents via temp dir, rolls back if anything blows up. for single-file runs, inPlace changes where merged outputs are read from afterward.

everything hangs off leano.* in settings. one namespace, less chaos.

settings

SettingDefaultWhat it does
leano.quality80compression quality 1–100 (-q)
leano.formatwebpwebp | avif | both (-f)
leano.maxWidthoptional max width in px (--max-width)
leano.maxHeightoptional max height in px (--max-height)
leano.losslessfalselossless mode (--lossless)
leano.inPlacefalsefolders: actually replace contents safely; single file: where merged outputs get read from after the run

under the hood

the extension basically spawns what you’d type yourself. options map from settings. it parses the last JSON object on stdout for the summary (the CLI prints the pretty table first, then JSON — yeah, it’s a little quirky).

npx --yes leano <path> --json [options…]

hacking on it

clone the repo, hit F5 (Run Extension), stare at breakpoints. you know the drill.

build

npm install
npm run compile    # emit out/
npm run watch      # tsc --watch

ship a .vsix for local installs

npm install -g @vscode/vsce   # once
npm run compile
vsce package                    # produces .vsix

install via Extensions → … → Install from VSIX…. publishing is normal vsce + marketplace token stuff — read the official publishing guide when you’re ready.

miss the terminal already?

same flags, same sharp pipeline — just without a GUI holding your hand. or go full CI if you’re allergic to both.

MIT license — same deal as the CLI.