
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@codetoimage/cli
Advanced tools
Official CLI for codetoimage.app — render HTML/CSS to PNG/JPG/WebP from your terminal.
Official CLI for codetoimage.app – render HTML/CSS to PNG/JPG/WebP from your terminal.
npm install -g @codetoimage/cli
Or run without installing:
npx @codetoimage/cli render index.html -o out.png
# 1. Authenticate (paste an API key from https://codetoimage.app/dashboard/keys)
cti login
# 2. Render an HTML file
cti render hello.html -o hello.png
# 3. Or render inline HTML
cti render --html '<h1 style="font-family:sans-serif">Hi</h1>' -o hi.png
# JPEG at 1200×630, custom background
cti render og.html -f jpeg --quality 90 -w 1200 -h 630 --background "#0a0a0a"
# Separate CSS file
cti render card.html --css card.css -o card.png
# Transparent PNG (paid plans only)
cti render badge.html --transparent -o badge.png
# Get a temporary URL instead of bytes (hosted for 24h)
cti render og.html --url
# → https://img.codetoimage.app/r/abc123.png
# Named platform size instead of -w/-h (one template, many sizes)
cti render card.html --preset instagram-story
cti render card.html --preset og -o og.png
# Presets: og, twitter-card, facebook-post, linkedin-post, instagram-square,
# instagram-portrait, instagram-story, youtube-thumbnail, pinterest-pin
# Render a saved template (dashboard → Templates) filling its {{placeholders}}
cti render --template 3f2a91d0-... --var title="Launch day" --var subtitle="v2.0 is out" -o launch.png
# Same template, every platform size, one loop
for p in og instagram-square instagram-story; do
cti render --template 3f2a91d0-... --var title="Launch day" --preset "$p" -o "launch-$p.png"
done
Three ways to supply your API key, in priority order:
--api-key <key> flag (per-call)CODETOIMAGE_API_KEY environment variable~/.config/codetoimage/config.json (created by cti login, chmod 600)| Variable | Default | Purpose |
|---|---|---|
CODETOIMAGE_API_KEY | – | API key (overrides stored config) |
CODETOIMAGE_API_URL | https://api.codetoimage.app | API base URL (override for dev/proxy) |
0 – success1 – error (auth, validation, network, plan limit, …); details on stderrcti login Save an API key locally
cti render [input] Render HTML to image
cti --version Print CLI version
cti --help Show help
Run cti render --help for the full flag list.
MIT
FAQs
Official CLI for codetoimage.app — render HTML/CSS to PNG/JPG/WebP from your terminal.
The npm package @codetoimage/cli receives a total of 1 weekly downloads. As such, @codetoimage/cli popularity was classified as not popular.
We found that @codetoimage/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.