What Is sprunge and How Do You Share Text From the Command Line?
sprunge is a command-line paste service: you pipe text or command output into it, and it returns a short URL you can share. It fits the case where you already have content in a terminal — a log, a config file, a stack trace — and want a link without opening a browser. The same job can be done with a browser-based paste app such as lesma, which is described as a "simple paste app friendly with browser and command line." Which one you reach for depends on where your text already lives.
The core idea: pipe in, get a URL back
A CLI paste service is a small HTTP endpoint that accepts text on standard input and responds with a URL. The pattern is always the same shape:
some-command | paste-service
The command produces text, the pipe hands it to the service, and the service prints a link. Nothing is uploaded until the command runs, and the link is the only thing you need to keep.
This is different from a browser pastebin, where you paste into a text box, click save, and copy the resulting URL. The mechanics are the same; only the input channel changes.
Typical usage pattern
The exact command depends on the service. The general workflow:
- Produce the text. Run the command whose output you want to share, or read a file.
- Pipe it to the paste service. The service reads standard input.
- Capture the returned URL. It prints to standard output, so you can copy it or assign it to a variable.
- Share the link. Anyone with the URL can read the plain text.
For example, to share the last 100 lines of a log:
tail -n 100 app.log | paste-service
To share a file's contents:
cat config.yml | paste-service
To keep the URL in a shell variable for later use:
url=$(cat notes.txt | paste-service)
The expected result in every case is a single line containing a URL. If you get an error message or nothing at all, the upload failed — see troubleshooting below.
sprunge-style CLI pastes vs. browser paste tools like lesma
Both approaches store plain text and give back a link. The difference is the entry point and the controls around the paste.
| Dimension | CLI paste (sprunge-style) | Browser paste (lesma) |
|---|---|---|
| Input | Piped from a command or file | Typed or pasted into a text box |
| Best for | Command output, logs, quick terminal-to-link | Reading, editing, and managing pastes visually |
| Controls | Usually minimal; whatever the service exposes | Exposed in the UI — lesma shows download count limit, expiration time in hours, and an optional password |
| File handling | Text via stdin | Drag and drop, but only plain text files |
| Retrieval | Open the URL | Open the URL, or use the app's Raw / Info / Clone views |
lesma's interface lists Download count limit, Expiration time (in hours), and Password as fields, plus Save, New, Clone, Raw, and Info actions. That gives you explicit control over how long a paste lives, how many times it can be fetched, and whether it needs a password — controls a bare CLI pipe often doesn't offer. The trade-off is that you have to move the text into a browser first.
If your text is already in the terminal and you just need a link fast, the CLI route is shorter. If you want to set an expiry, cap downloads, or password-protect the paste, a browser tool with those fields is the more direct path.
Practical limitations to plan around
- Expiration. Pastes are not necessarily permanent. lesma exposes an expiration time in hours; CLI services vary, and some keep pastes indefinitely while others purge them. If a link must survive, check the service's retention behavior rather than assuming.
- Privacy. A paste URL is typically unlisted, not private. Anyone with the link can read it. A password field (as lesma offers) adds a layer, but treat anything you paste as potentially readable by whoever obtains the URL. Don't paste secrets, credentials, or personal data.
- Plain text only. lesma's drag-and-drop accepts only plain text files. Binary files, images, and archives are out of scope for this kind of tool.
- No editing after the fact. A paste is a snapshot. To change it, create a new paste and share the new link.
Troubleshooting failed uploads and unusable links
No URL returned. The service may be down, the endpoint may have changed, or your network may be blocking the request. Test with a trivial input first:
echo "test" | paste-service
If that also fails, the problem is the service or the connection, not your content.
URL returned but the page is empty or errors. The upload may have partially succeeded, or the paste may have already expired. Re-run the upload and open the link immediately to confirm it resolves.
Link works for you but not for others. Check whether the paste has a download count limit set (lesma exposes this) — if the cap is reached, the link stops serving. Also confirm you're sharing the exact URL and not a truncated version.
Content looks mangled. Piping binary data or files with unusual encodings into a plain-text paste service can corrupt the output. Convert to plain text first, or use a tool designed for binary transfer.
Command hangs. Some services wait for end-of-input. If you're typing interactively instead of piping, close standard input (often Ctrl-D) so the service knows the text is complete.
Choosing between them
Use a CLI paste when the text is already in your terminal and you want a link with minimal steps. Use a browser paste app like lesma when you want to set an expiration, limit downloads, add a password, or review the paste before sharing. Both handle plain text; neither is a substitute for secure file transfer when the content is sensitive.