{{template "header" .}}

Never seen this service before? Want to know how to use it? This page will help you learn more about your tailnet's pastebin tool.

Command-line tool

You can pipe commands or paste files to the pastebin using the command tclip. You can install it by installing the Go compiler toolkit and then running this command:

go get github.com/tailscale-dev/tclip/cmd/tclip@main

Once it is installed, invoke it with the command tclip:

tclip ./foo.txt

and the program will print a URL that you can share with your team. You can also pipe the output from any command to it:

go test &2<1 | tclip -n go-test.txt

API

The pastebin service has an API call at /api/post that you can use to submit new pastes from command-line tools or your text editor. You use it by constructing either a basic HTML form post or a multipart form with these fields (both are required):

Name Description
filename The name of the file you want to paste.
The file extension of the name will determine the syntax highlighting for that paste.
content The literal content of the paste.
This can be a function, a bit of prose, or an entire buffer of text.

The Accept header will determine what kind of response you get. By default, this service will return a redirect to the paste upon pastes being successfully created. If you do not want this behavior (such as if you are implementing support for your favorite text editor or testing with curl), set the Accept header to the value text/plain. This will make the server return the paste URL as normal text.

Here is an example curl command you can use to paste data to the service:

curl http://paste/api/post -F filename=filename.txt -F content="test paste from curl" -H "Accept: text/plain"

Emacs package

The default distribution of tclip ships with a package for GNU Emacs. This package will let you submit pastes from your editor. It requires the request package and exposes two interactive functions:

You can download this package from the tclip repository. You can install it by using M-x package-install-file or by opening it in Emacs and running M-x package-install-from-buffer. Please be sure that request is installed.

{{template "footer" .}}