Documentation

Command line (curl)

Every machine with curl can work with Clipline – a server you just logged into, a colleague's laptop, a container, a VM console. Use a session if there is no account on that side, or your API token for your own entries.

Any machine with curl
$ curl clipline.roedlach.tirol/s/aB3-x9Z Clipline session aB3-x9Z, 12 min left # TYPE AGE ENTRY 1 file 6m deploy-notes.pdf (48 KB) 2 text 2m ssh [email protected] $ curl clipline.roedlach.tirol/s/aB3-x9Z/last ssh [email protected] $ ip a | curl -T - clipline.roedlach.tirol/s/aB3-x9Z Saved as entry 3 of session aB3-x9Z.
Nothing to install: any machine with curl reads a session and sends output back to it.

Sessions: short addresses

A session (see Sessions) has one short address, https://clipline.roedlach.tirol/s/{code}. It is the share link too: in a browser it opens the session page, in curl it lists the entries.

Fetch

curl https://clipline.roedlach.tirol/s/aB3-x9Z            # list: numbers, type, age, content
curl https://clipline.roedlach.tirol/s/aB3-x9Z/last       # print the newest entry (also: latest)
curl https://clipline.roedlach.tirol/s/aB3-x9Z/2          # print entry 2
curl -fOJ https://clipline.roedlach.tirol/s/aB3-x9Z/1     # save entry 1, a file, under its own name

The list looks like this, oldest first so the newest one is right above your prompt:

Clipline session aB3-x9Z, 12 min left

  #  TYPE  AGE    ENTRY
  1  file  6m     deploy-notes.pdf (48 KB)
  2  text  2m     ssh [email protected]

Print the newest:  curl https://clipline.roedlach.tirol/s/aB3-x9Z/last
Print entry N:     curl https://clipline.roedlach.tirol/s/aB3-x9Z/N
Save file N:       curl -fOJ https://clipline.roedlach.tirol/s/aB3-x9Z/N
Send text:         echo "hello" | curl -T - https://clipline.roedlach.tirol/s/aB3-x9Z
Send a file:       curl -T notes.txt https://clipline.roedlach.tirol/s/aB3-x9Z/

Entries keep their number for as long as they exist: entry 2 is still entry 2 when more arrive.

Send

No account needed – the code is enough, as on the session page.

ip a | curl -T - https://clipline.roedlach.tirol/s/aB3-x9Z          # output of a command (PUT)
echo "hello" | curl -T - https://clipline.roedlach.tirol/s/aB3-x9Z  # text
curl -d "hello" https://clipline.roedlach.tirol/s/aB3-x9Z           # text (POST)
curl -T notes.txt https://clipline.roedlach.tirol/s/aB3-x9Z/        # a file; keep the / – curl adds the file name
curl -F [email protected] https://clipline.roedlach.tirol/s/aB3-x9Z   # a file (POST, form upload)

The answer tells you the number:

Saved as entry 3 of session aB3-x9Z.
Get it with: curl https://clipline.roedlach.tirol/s/aB3-x9Z/3

Text loses the line break echo adds at the end, so it can be pasted into a shell without running right away. Data that isn't text (e.g. curl -T - < image.png) is saved as a file named upload.bin, and text longer than a million characters as upload.txt. Entries can be up to 100 MB.

Burn after reading

Add ?burn (with quotes, so the shell leaves the ? alone) and the text is deleted with its first copy – on the web page, in a client or with curl:

echo "$TOKEN" | curl -T - 'https://clipline.roedlach.tirol/s/aB3-x9Z?burn'

The list shows such an entry as 🔥 burn after reading (fetching it deletes it) instead of its text. Fetching it (curl https://clipline.roedlach.tirol/s/aB3-x9Z/3, or /last) prints the text once and deletes the entry for everyone, also when you sent it yourself. Text only: a file, binary data or text over a million characters with ?burn answer 422. Opening the address in a browser, a curl -I (HEAD) or a chat app's link preview doesn't burn it: they get a note instead of the text.

Errors

Answer Meaning
404 Session code is invalid or expired. Wrong code, or the 15 minutes are over. Start a new session.
404 No entry 9. The session has 1, 2, 3. That number doesn't exist (any more).
410 Already taken by someone else. A burn-after-reading entry was copied by someone else first.
413 Too large. More than 100 MB.
422 Nothing to save. You sent nothing, e.g. an empty pipe.
422 Burn after reading works for text only. ?burn together with a file or binary data.

Private entries of a session are not available via curl.

With your account

Create an API token with read (and create to add entries) and send it with --oauth2-bearer. You get the entries of all your teams, including your private ones. Here 1 is always the newest entry.

TOKEN=your-api-token
curl --oauth2-bearer $TOKEN https://clipline.roedlach.tirol/api/list
curl --oauth2-bearer $TOKEN https://clipline.roedlach.tirol/api/latest
curl -fOJ --oauth2-bearer $TOKEN https://clipline.roedlach.tirol/api/entry/2
curl --oauth2-bearer $TOKEN https://clipline.roedlach.tirol/api/team/1/list             # only team 1

curl --oauth2-bearer $TOKEN -F entry="hello" https://clipline.roedlach.tirol/api/entry
curl --oauth2-bearer $TOKEN -F [email protected] https://clipline.roedlach.tirol/api/entry
curl --oauth2-bearer $TOKEN -F entry="secret" -F password=true https://clipline.roedlach.tirol/api/entry   # only you

A missing or wrong token answers 401, a team you are not in 403.

The token is your login, and it is long – on a console without copy and paste, use a session instead. Keep the token out of shared shell histories: start the line with a space (bash with HISTCONTROL=ignorespace), or read it with read -s TOKEN.

All addresses

Method Address What it does
GET /s/{code} List the session (a browser opens the session page)
GET /s/{code}/{n} Entry n of the session
GET /s/{code}/last Newest entry of the session (latest works too)
PUT /s/{code} Add the request body as text (curl -T -)
PUT /s/{code}/{filename} Add the request body as a file (curl -T file …/)
POST /s/{code} Add a file (-F file=@…), a field entry or the body as text (-d)
GET /session/{code}/list, /latest, /entry/{n} The longer form of the same, still works
GET /api/list Numbered list of your entries (token)
GET /api/latest Your newest entry (token)
GET /api/entry/{n} Your entry n, 1 = newest (token)
GET /api/team/{team_id}/list, /latest, /entry/{n} The same for one team (token)

For everything else the clients use, see the API.