CLI
Run with bun run cli -- from the project, or point at your server with -u.
The CLI wraps the REST API for quick terminal and CI workflows — create clips, push text, fetch content, and upload files.
Examples
# Create or update clip content
bun run cli -- -u https://webklip.com -l my-clip -m "hello world"
# Fetch clip content (counts as an API read)
bun run cli -- -u https://webklip.com -l my-clip -g
# Create with PIN, webhook, and view limit
bun run cli -- -u https://webklip.com -l secret -m "data" \
-p 1234 -w https://hooks.example.com/webklip --max-views 3
# Disable burn-on-read on create
bun run cli -- -u https://webklip.com -l notes -m "keep me" --no-burn
# Upload a file to an existing clip
bun run cli -- -u https://webklip.com -l my-clip -f ./photo.png
Options
| Flag | Description |
|---|---|
-u, --url | Server URL (default: http://localhost:3000) |
-l, --slug | Clip slug (required) |
-m, --message | Text content to create or update |
-g, --get | Fetch clip via API (counts as a read) |
-f, --file | Upload a file to the clip |
-p, --pin | PIN for protected clips (X-Clip-Pin) |
-w, --webhook | Webhook URL (on create only) |
--max-views N | Delete after N API reads (0 = unlimited) |
--no-burn | Disable burn-on-read when creating a clip |
Behaviour
- With
-m, the CLI triesPUTfirst, thenPOSTif the clip does not exist. - File uploads use the web upload endpoint (
POST /:slug/upload), not the JSON API. -gprints content to stdout; burned clips print a note to stderr.