Reportingpastebinsharingcommand-lineautomationoutput-sharing

wgetpaste

Command-line interface to various online pastebin services. Automates pasting content to multiple pastebin platforms.

Description

wgetpaste provides a simple script for uploading text content, command outputs, or files to popular pastebin services like dpaste, github gists, and gitlab snippets. It streamlines sharing logs, debugging output, or code snippets without manual copy-pasting through web interfaces.

Use cases include quickly sharing terminal output during collaboration, debugging sessions, or reporting issues. Users can customize pastes with language syntax highlighting, descriptions, nicknames, and expiration times. Configuration files allow setting defaults and service-specific headers for authentication.

The tool supports X11 clipboard integration for seamless copy-paste workflows and raw URL output for direct access without HTML formatting.

How It Works

wgetpaste reads input from stdin, files, commands, or clipboard, then uses HTTP POST requests to upload content to selected pastebin services via their APIs. Service-specific configurations in /etc/wgetpaste.conf or ~/.wgetpaste.conf define endpoints, headers (e.g., Authorization tokens), and defaults. Custom headers like HEADER_gists or URL_snippets enable authenticated uploads to GitHub Gists or GitLab Snippets. The tool returns a shareable URL, optionally shortened or copied to clipboard.

Installation

bash
sudo apt install wgetpaste

Flags

-l, --language LANGset language (defaults to "Plain Text")
-d, --description DESCRIPTIONset description (defaults to "stdin" or filename)
-n, --nick NICKset nick (defaults to your username)
-s, --service SERVICEset service to use (defaults to "dpaste")
-e, --expiration EXPIRATIONset when it should expire (defaults to "30 days")
-S, --list-serviceslist supported pastebin services
-L, --list-languageslist languages supported by the specified service
-E, --list-expirationlist expiration setting supported by the specified service
-u, --tinyurl URLconvert input url to tinyurl
-c, --command COMMANDpaste COMMAND and the output of COMMAND
-i, --infoappend the output of `emerge --info`
-I, --info-onlypaste the output of `emerge --info` only
-x, --xcutread input from clipboard (requires x11-misc/xclip)
-X, --xpastewrite resulting url to the X primary selection buffer (requires x11-misc/xclip)
-C, --xclippastewrite resulting url to the X clipboard selection buffer (requires x11-misc/xclip)
-r, --rawshow url for the raw paste (no syntax highlighting or html)
-t, --teeuse tee to show what is being pasted
-v, --verboseshow wget stderr output if no url is received
--completionsemit output suitable for shell completions (only affects --list-*)
--debugbe *very* verbose (implies -v)
-h, --helpshow this help
-g, --ignore-configsignore /etc/wgetpaste.conf, ~/.wgetpaste.conf etc.
--versionshow version information

Examples

Show the help message and usage information
wgetpaste -h
Paste stdin content to default service (dpaste) with default settings
wgetpaste
Paste content of file.txt to default pastebin service
wgetpaste file.txt
Paste to GitHub Gists service with Python language syntax highlighting
wgetpaste -s gists -l python
Paste the command 'ls -la' and its output
wgetpaste -c 'ls -la'
List all supported pastebin services
wgetpaste -S
List languages supported by the dpaste service
wgetpaste -L -s dpaste
Read input from X11 clipboard and paste it (requires xclip)
wgetpaste -x
Updated 2026-04-16kali.org ↗