npm.io
0.2.0 • Published yesterdayCLI

@liustack/webpress

Licence
MIT
Version
0.2.0
Deps
2
Size
14 kB
Vulns
0
Weekly
0
Stars
5

WebPress

A CLI toolkit for AI agents to generate platform cover images from local HTML presets.

中文说明请见:README.zh-CN.md

Features

  • Preset-only cover generation (no custom dimensions)
  • Local HTML only (remote URLs are not supported)
  • 8 built-in presets for social and content covers
  • Deterministic rendering with Playwright + Chromium
  • #container-based screenshot capture for predictable framing

Installation

npm install -g @liustack/webpress
npx playwright install chromium

Or run with npx:

npx @liustack/webpress [options]

Or install as an Agent Skill — tell any AI coding tool that supports agent skills (Claude Code, Codex, OpenCode, Cursor, Antigravity, etc.):

Install the skill from https://github.com/liustack/webpress

Or use the skills CLI directly:

npx skills add https://github.com/liustack/webpress --skill webpress

Usage

# OG card
webpress -i card.html -o og.png --preset og

# Infographic
webpress -i stats.html -o infographic.png --preset infographic

Presets

Preset Size Example
og 1200x630 og
twitter 1200x675 twitter
banner 1600x900 banner
youtube 1280x720 youtube
wechat 900x383 wechat
infographic 1080x1350 infographic
poster 1200x1500 poster
xiaohongshu 1080x1440 xiaohongshu

More Examples

Cinema Theme

cinema-twitter-pain cinema-infographic-presets cinema-infographic-skill

Fashion Theme

fashion-twitter-how fashion-twitter-pain fashion-infographic-skill fashion-xhs-main fashion-xhs-tutorial

Other Styles

banner twitter-pain xhs-cover-film xiaohongshu-cover

Options

  • -i, --input <path> input HTML file path
  • -o, --output <path> output PNG file path
  • -p, --preset <name> preset name (required)
  • --scale <number> device scale factor (default: 2)
  • --wait-until <state> load | domcontentloaded | networkidle
  • --timeout <ms> timeout in milliseconds
  • --safe disable external network requests and JavaScript execution

PNG rendering requires a #container element in HTML. Rendering fails if missing.

AI Agent Skill

License

MIT

Keywords