pi-poster
๐จ Poster integration for pi โ render React posters to PNG/SVG/PDF/JPG/WebP from an agent session.
Package details
Install pi-poster from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-poster- Package
pi-poster- Version
0.1.3- Published
- Apr 23, 2026
- Downloads
- 477/mo ยท 222/wk
- Author
- miclivs
- License
- MIT
- Types
- extension, skill
- Size
- 44.8 KB
- Dependencies
- 2 dependencies ยท 3 peers
Pi manifest JSON
{
"extensions": [
".pi/extensions/poster-make"
],
"skills": [
"skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-poster
๐จ Poster for pi โ turn agent intent into a rendered image.
Give pi the ability to author a single-file React poster and render it to PNG / SVG / PDF / JPG / WebP during a session. Tailwind, Recharts, lucide-react, Inter / Source Serif 4 / JetBrains Mono โ all available out of the box.
"Make me a share image for the v0.2 release" โ hero PNG
"One-page PDF report from this CSV" โ editorial layout โ PDF
"Year-in-review for our top 10 customers" โ wrapped-style story poster
"OG image for the new docs site" โ 1200ร630 social card
"Cover for this README" โ README hero
Install
pi install npm:pi-poster
That's it. poster-ai ships a headless Chromium binary, so the first render is ready to go.
How the agent uses it
One tool, poster_render, with two ways to source the TSX:
| Param | When | Why |
|---|---|---|
tsx |
First render | Inline source string. The agent authors a fresh component. |
tsxPath |
Iterative edits | Path to a .tsx file. The agent edits the previously-archived source instead of resending the whole component. |
The two are mutually exclusive โ pass exactly one.
First render (inline)
poster_render({
tsx: `
export default () => (
<div className="w-[1200px] p-12 bg-black text-white">
<div className="text-[14px] font-bold uppercase tracking-[0.3em] text-cyan-300/70">
Release ยท v0.2
</div>
<h1 className="text-7xl font-black mt-3">Shipped.</h1>
</div>
)
`,
out: "./release.png"
})
โ Rendered /Users/you/proj/release.png ยท 24.3 KB ยท 1200ร180 ยท png
Iterative edit (by path)
Every render archives a paired <name>-<ts>.{format,tsx} into .poster/output/. To iterate, the agent edits that .tsx file directly and re-renders by path โ no need to resend the whole component each turn.
poster_render({
tsxPath: ".poster/output/release-1776359608903.tsx",
out: "./release.png"
})
Canvas comes from the TSX
There is no width / height tool param. The root element declares the canvas via Tailwind:
<div className="w-[1600px] p-10 ..."> // landscape / dashboard / twitter
<div className="w-[1200px] p-10 ..."> // square / cover / instagram
<div className="w-[1080px] p-10 ..."> // story / wrapped
<div className="w-[1400px] p-10 ..."> // editorial / magazine
<div className="w-[1200px] h-[630px] p-10 ..."> // OG image (the only fixed-aspect case)
One source of truth. Two sources = overflow + empty-strip bugs.
What the agent gets, for free
posterskill โ authoring contract, layout grammar, color systems, signature patterns (kicker rows, italic reveal words, gradient text, card recipes), and a catalog of pitfalls. Loaded automatically when the agent reaches for a visual deliverable.- Pre-flight validation โ broken canvases (
min-h-screen,w-fullon root, illegal font sizes, percentage-height traps) are caught before the puppeteer launch, with concrete fix suggestions in the error. - Inline preview โ when the terminal supports images, the rendered PNG/JPG/WebP appears directly under the tool result.
- Source archive โ
.poster/output/<name>-<ts>.{ext,tsx}keeps the full history of what the agent produced. Add.poster/to.gitignoreif you don't want it in version control.
What posters look like
Every one of these is a single .tsx file the agent can author the same way โ click any source link to see exactly what the model produced.
For 40+ more examples โ anatomy diagrams, neon synthwave, NYT-style crosswords, tarot cards, illuminated manuscripts, weather widgets, sankey flows โ see the full poster-ai gallery.
License
MIT