shotbin
v0.1.2
Published
Upload a screenshot, get a permanent embeddable URL back in under a second.
Maintainers
Readme
shotbin
Upload a screenshot, get a permanent embeddable URL back in under a second.
shotbin shot.png --about "speakers page after reassign"stdout is the markdown and nothing else, so shotbin shot.png --about … | pbcopy
puts exactly the right thing on the clipboard. Everything a human reads — the
visibility, what it worked out about where the shot came from, a link to its page —
goes to stderr.
Zero runtime dependencies. npx shotbin fetches one small tarball and starts.
Setup
shotbin loginIt prints where to mint a token, reads the pasted token with echo off, verifies it before writing anything, and then writes two files:
.shotbin.jsonin the repository, committed, naming the project its screenshots belong to, and holding no secret~/.shotbin/config.jsonon the machine,chmod 600, holding your token
That split is the point: the repository commits its identity, the machine holds the secret. One token, not one per archive — it belongs to you and reaches every project you are a member of.
login settles the project three ways and no others: the repository already names
one, the token reaches exactly one, or --project says which. A token reaching
several refuses and lists them rather than guessing — a repository silently filed
into the wrong archive is not noticed until somebody goes looking for a screenshot
that is not there.
In CI, export SHOTBIN_TOKEN=sbn_… replaces the home config; the project still has
to be named, by the committed .shotbin.json or by --project.
Uploading
Repo, branch, commit, issue, uploader, host, OS and agent session are all inferred
from where the command runs. --about is the only thing no tool can work out for
you, which is why it is the only thing you have to pass. Every inferred field has a
flag that overrides it.
| | |
|---|---|
| --about <text> | required; one line saying what the image shows |
| --repo <owner/name> | from the origin remote |
| --issue <n> | from a number in the branch name |
| --pr <n> | from the CI ref |
| --branch, --commit | from HEAD |
| --source <kind> | claude, agent, ci, manual, unknown |
| --visibility <v> | private, unlisted, public (default: the project's) |
| --crop WxH+X+Y | applied before upload, so the archive records the crop |
| --project <slug> | override the project in .shotbin.json |
| --json | print the server's answer instead of the markdown |
Searching
shotbin search 931 # an issue number
shotbin search a1b2c3d # a commit prefix
shotbin search "empty state" # the captionFree text matches captions and nothing else. ocr_text exists in the schema and
is never written, because enrichment is off by decision — so the caption is the
only thing a search can find a shot by, which is what makes --about worth
thinking about for a second.
Visibility
Three states, defaulting to unlisted.
| state | bytes at i.shotbin.dev | in listings |
|---|---|---|
| private | none issued | the project's archive only |
| unlisted (default) | yes, to anyone with the URL | the project's archive only |
| public | yes | yes |
unlisted is the default because private cannot be embedded in a pull request
at all — GitHub's image proxy fetches anonymously, with no credentials.
GitHub's proxy caches what it fetches permanently. Deleting a shot or narrowing its visibility cannot retract bytes it has already cached. Never upload data that is not yours to publish.
Exit codes
| | |
|---|---|
| 0 | fine |
| 1 | something went wrong |
There is no third outcome. Nothing inspects your screenshot — shotbin does not
read it, does not scan it for keys or addresses, and will not warn you about
anything in one, so no exit code can tell you what is in an image. Deciding what is
safe to upload happens before the command, and --crop is the only tool for keeping
something out of the frame.
The agent skill
Most uploads here are made by an agent, and the judgement the CLI cannot supply — what is safe to upload, what a caption is for, the mistakes that publish something you meant to remove — lives in a skill alongside it:
# For one project
mkdir -p .claude/skills/shotbin
curl -sSL https://raw.githubusercontent.com/lumikey/shotbin/main/packages/skill/SKILL.md \
-o .claude/skills/shotbin/SKILL.md
# For every project on this machine
mkdir -p ~/.claude/skills/shotbin
curl -sSL https://raw.githubusercontent.com/lumikey/shotbin/main/packages/skill/SKILL.md \
-o ~/.claude/skills/shotbin/SKILL.mdOne file, no install step, nothing else to configure. It is checked against this CLI on every run of the test suite, so it cannot teach a flag that does not exist.
Cropping
--crop is why the zero-dependency claim is interesting. The two obvious ways to
crop a PNG are a ten-megabyte native binary or a pure-JS decoder that spends hundreds
of milliseconds on a full-page screenshot before the upload has even started. Node's
zlib is native and inflate/deflate is the only expensive part, so cropping a retina
screenshot takes single-digit milliseconds. What it cannot do — 16-bit, interlaced,
palettised — it refuses by name, because a scrambled image with valid dimensions
is the worst possible failure for a command whose output gets pasted into a pull
request.
