pb is a GitHub-backed personal pastebin CLI for small notes and images.
It stores files in a dedicated private GitHub repository, keeps a local cache for offline edits, autosaves text drafts locally while you work, and gives you explicit save/sync commands plus per-file version history.
- GitHub-backed file storage with local-first caching and recovery
- built-in terminal editor with local draft autosave and Ctrl+V image paste
- clipboard image paste/copy commands for screenshots and photos
- explicit
syncflow for reconciling changes across devices - durable per-file version history with show and restore commands
- built-in release checks with saved upgrade preferences
- conflict copies instead of risky remote overwrites
- installable without sudo or admin rights
- Go 1.25+ if you want to build from source
- GitHub CLI installed and authenticated with
gh auth login
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/yesabhishek/pastebin-cli/main/scripts/install.sh | shWindows PowerShell:
iwr https://raw.githubusercontent.com/yesabhishek/pastebin-cli/main/scripts/install.ps1 -useb | iexThese installers place the binary in a user-owned bin directory, so no sudo or admin rights are required.
git clone https://github.com/yesabhishek/pastebin-cli.git
cd pastebin-cli
go build -o pb ./cmd/pbInstall the local sanity-check tools first:
brew install actionlint shellcheck
git config core.hooksPath .githooksThen run the same checks locally that CI uses:
./scripts/check.sh./pb init
./pb version
./pb new notes/today.txt
./pb paste photos/screenshot
./pb copy photos/screenshot.png
./pb versions notes/today.txt
./pb list
./pb syncpb init uses your current gh login and creates a dedicated private storage repository, pastebin-cli-store, by default.
pb init
pb version
pb new <path>
pb edit <path>
pb read <path> [--out <file>]
pb paste <path>
pb copy <path>
pb versions <path>
pb show <path> <version-id>
pb restore <path> <version-id>
pb delete <path> [--yes]
pb list [prefix] [--refresh]
pb sync
pb status
pb upgrade [--yes] [--check] [--policy prompt|auto|manual]
pb logout
Global flags:
--repo <name>: override the default GitHub storage repo--json: emit JSON forread,versions,show,list, andstatus
pb paste <path>saves the current OS clipboard image as PNG content. If<path>has no image extension, pb appends.png.pb copy <path>copies stored images back to the OS clipboard. Text files are copied as text.Ctrl+Vin the editor saves a clipboard image to the current path when the text buffer is clean.pb read <image>opens stored images in the default image viewer.pb read <path> --out <file>writes raw bytes to a file, which is the safest way to script image or binary reads.- Clipboard support depends on desktop clipboard access. Linux support is X11-oriented; Wayland sessions may need XWayland/
DISPLAY.
Editor shortcuts:
Ctrl+S: saveCtrl+QorCtrl+X: save and quitCtrl+V: paste clipboard image when the buffer has no unsaved text
pbchecks GitHub for a newer release about once a day after you have runpb init- when an update is available, you can upgrade now, always auto-upgrade, skip that release, or turn prompts off
pb upgrade --checkchecks whether a newer release existspb upgrade --yesinstalls the latest published release immediatelypb upgrade --policy auto|prompt|manualsaves your upgrade preferencepb versionprints the currently running CLI version
pb versions <path>lists durable synced versions for a file, newest firstpb show <path> <version-id>prints the content of a historical versionpb restore <path> <version-id>restores a historical version as the latest one
Durable versions are created on explicit save, save-on-exit, restore, and sync. The editor's background autosave only protects local drafts and does not create remote version spam.
pb stores app-owned local state under your user config directory:
config.json: repo/login/device settingsstate/index.json: tracked file metadatastate/journal.json: resumable pending operationsstate/recovery/: autosave recovery snapshotscache/files/: cached text content