Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A utility to paste to pastebin from the command line.

tag: 0.5.2

Fetching latest commit…

Cannot retrieve the latest commit at this time


Use pastebin from the commandline. See the blog post for information on how this script came to be and to leave any comments or questions.


Usage: [-h] [-v] [-cp] [-f FILE] [--paste-name PASTE_NAME]
                       [--paste-email PASTE_EMAIL]
                       [--paste-subdomain PASTE_SUBDOMAIN] [--paste-private]
                       [--paste-expire-date PASTE_EXPIRE_DATE]
                       [--paste-format PASTE_FORMAT]

  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -c, --copy            copy the text that is posted to before
                        copying the URL
  -f FILE, --file=FILE  read from FILE instead of stdin
  -p, --print-response  print the response from the pastebin API instead of
                        copying it to the clipboard

  Pastebin API Options:
    These options are passed to the pastebin API request.

                        the name to give to the pasted text
                        the email to send a confirmation with a paste link
                        the subdomain (e.g. to
                        use when pasting
    --paste-private     whether to make the paste private
                        when to expire the paste; valid values are N, 10M, 1H,
                        1D, and 1M
                        the format used for syntax highlighting; see
               for valid values

I find it useful to put the script where it is readily available, like so:

$ ln -s ~/path/to/script/ /usr/local/bin/pastebin

Obviously, replace path/to/script (and/or /usr/local/bin/) with the appropriate paths.

Use -c to copy the contents of what is being posted first. This is useful if you are using a clipboard manager that can handle multiple items, such as Jumpcut.

OS X Service

Under automator/, there is an OS X Automator workflow. This can aid in using the pastebin script from the OS X Services menu. Put this workflow into ~/Library/Services (create that directory if it does not already exist.) Then open the Keyboard Shortcut preferences and make sure "Paste to" is checked under the Services item. See the help file under automator/ for more instructions.

Something went wrong with that request. Please try again.