Why leave the terminal to share text? With curl and a pastebin API, you can paste, share, and burn content without touching a browser.
Pipe any text into a POST and get a short link back: echo "hello" | curl -s -X POST https://urlpaste.com/api/paste -H "Content-Type: application/json" -d '{"content":"hello"}' | jq -r .url
Share a build log or error trace in one line: cat deploy.log | curl -s -X POST https://urlpaste.com/api/paste -H "Content-Type: application/json" -d @- | jq -r .url
Share a token that self-destructs: curl -s -X POST https://urlpaste.com/api/paste -H "Content-Type: application/json" -d '{"content":"API_KEY=...","burn":true}' | jq -r .url
Add this to your .zshrc or .bashrc: alias paste='curl -s -X POST https://urlpaste.com/api/paste -H "Content-Type: application/json" -d "{\"content\": \"$(cat)\"}" | jq -r .url'. Then just cat file.txt | paste.
If the link you get back is too long for a chat or a tweet, run it through acortar.link to shorten it — same content, cleaner URL.
Every developer hits the same wall: you have text in a terminal — a failing test log, a diff, a config, a stack trace — and a human on chat who needs to see it. Pasting 300 lines into Slack mangles formatting and floods the channel. Screenshots aren't greppable. The terminal-native answer is a one-liner: pipe the output straight into a paste API and get back a URL. With a curl-able pastebin, the workflow is <command> | curl ... → link, and the whole operation never leaves the shell. Done with a zero-knowledge pastebin, it also inherits all the secrecy properties — encrypt first, then upload ciphertext, and even the pastebin operator can't read your logs.
For genuinely non-sensitive output — public build logs, open-source debugging — the simplest form is one POST:
make test 2>&1 | curl -s https://urlpaste.com/api/paste \
-H "Content-Type: application/json" \
--data-binary @-
The response JSON includes the short URL; append | jq -r .url to print just the link. Wrap it in a function — pb() { "$@" 2>&1 | curl -s https://urlpaste.com/api/paste ...; } — and any command can suffix into a shareable link: pb make test.
For logs that mention internal hostnames, env vars, or customer data, encrypt in the shell before upload. Using OpenSSL (preinstalled everywhere):
KEY=$(openssl rand -hex 32)
cat build.log | openssl enc -aes-256-gcm ... # encrypt
# POST ciphertext to https://urlpaste.com/api/paste
# Share: https://urlpaste.com/<slug>#<base64url-of-KEY>
Because the key is appended as the URL fragment, it never leaves your machine inside an HTTP request — the server only stores ciphertext. Prefer a small script over retyping: five lines of bash wrapped as pb-secret gives you one-command secure sharing forever. For automation, switch to Python's cryptography library for cleaner AES-256-GCM handling (OpenSSL's enc CLI doesn't fully support GCM; use a Python one-liner or age as alternatives and note the tool's wire format).
Make the workflow ambient: an alias alias pb='pb' and alias pbs='pb-secret' in your shell rc; pipe the returned link straight to the clipboard with | pbcopy (macOS) or | xclip -selection clipboard (Linux); in CI, have failed jobs auto-paste their tail — tail -n 500 job.log | pb — and post the link to the incident channel. Add expiry consciously: 7 days for CI logs is a sane default; burn-after-read for anything a human will read exactly once. The moment pb is muscle memory, "can you send me the log?" stops being a context-switch — it's two extra keystrokes.
How do I paste command output directly from the terminal?
Pipe it: command 2>&1 | curl -s https://urlpaste.com/api/paste -H "Content-Type: application/json" --data-binary @- and extract the URL from the JSON response with jq -r .url. Wrap it in a shell function (e.g., pb make test) so any command can be pasted with a two-letter prefix.
Can the curl workflow encrypt output before uploading?
Yes — encrypt locally, then POST the ciphertext: generate a random 256-bit key, encrypt with AES-256 (use Python's cryptography or age for full GCM support; OpenSSL's enc CLI lacks complete GCM handling), upload the ciphertext, and append the key to the link's URL fragment. The server then stores only undecryptable bytes.
How do I avoid leaking secrets through terminal pastes?
Encrypt before upload by default — make the secret path the habit, not the exception — and scrub output first: a quick grep -iE '(key|token|secret|pass)' review, or run the log through gitleaks as a pre-upload check. Also default to an expiry (7 days for logs, burn-after-read for secrets) so forgotten pastes don't persist.