stubshot
v0.1.2
Published
Generate deterministic local placeholder images
Maintainers
Readme
Stubshot (CLI)
This package provides the stubshot CLI.
Usage
From a project:
npx stubshot generate --out public/placeholders --count 12 --sizes 1200x800,800x800 --theme mesh-gradient --format svg --prefix product --seed my-project --manifest --base-url /placeholdersFormats: svg, png, jpg, webp (via the default local provider).
BYOK providers
You can install optional providers, like OpenAI:
npm i -D @stubshot/provider-openaiThen run:
stubshot generate --provider openai --format png --out public/placeholders --count 4 --sizes 1024x1024 --theme mesh-gradient --seed my-projectProvider discovery
List known providers and whether they’re installed:
stubshot providersShell completion
Bash:
stubshot completion bash > /tmp/stubshot.bash
source /tmp/stubshot.bashZsh:
stubshot completion zsh > /tmp/_stubshot
fpath=(/tmp $fpath)
autoload -Uz compinit && compinitCaching
To avoid regenerating identical images (especially with BYOK providers), enable a disk cache:
stubshot generate --provider openai --format png --cache-dir .stubshot-cache --out public/placeholders --count 4 --sizes 1024x1024 --theme mesh-gradient --seed my-projectDisable cache:
stubshot generate --no-cache ...Config files supported:
stubshot.config.jsonstubshot.config.js
Monorepo dev
pnpm install
pnpm -r build
pnpm stubshot generate --out public/placeholders --count 3 --sizes 1200x800 --theme mesh-gradient --format svg --prefix product --seed my-project --manifest