I was putting together docs for a side project and needed screenshots. The usual drill - open browser, navigate, resize, screenshot tool, crop, save, rename. Repeat 20 times.
There's a terminal tool for this. You just run:
npx heroshot https://example.com
That's it. PNG file appears in your folder. Done.
No browser window. No clicking. No cropping. Just the URL and you get a clean screenshot of the entire page.
Wait, it gets better
Need just the hero section, not the whole page? Run it without flags and it opens an interactive browser where you click to select elements:
npx heroshot
Point, click, done. No CSS selectors to figure out.
Mobile version?
npx heroshot https://example.com --mobile
Dark mode?
npx heroshot https://example.com --dark
Both light and dark variants at once?
npx heroshot https://example.com --light --dark
Why this is useful
I've spent embarrassing amounts of time manually screenshotting stuff. Documentation images. Bug reports. Mockup comparisons. Every time something changed, back to the browser.
Now I just run the command again. Same screenshot, updated. Takes two seconds.
The --retina flag is great for docs - crisp images without any extra work.
Under the hood
It's Playwright doing the actual work - spinning up a headless browser, loading the page, taking the shot. But wrapped in a way where you don't have to think about any of that. No scripts to write. No dependencies to manage beyond the npx call.
Anyway, thought this was cool. Heroshot if you want to try it.
Top comments (0)