lbin

A friendly CLI client for bin.liminal.cafe - a temporary file hosting service.

Download

Installation

# Download the script
curl -o ~/.local/bin/lbin https://txt.liminal.cafe/sh/lbin/lbin
chmod +x ~/.local/bin/lbin

# Optional: download completions
curl -o ~/.local/share/bash-completion/completions/lbin \
     https://txt.liminal.cafe/sh/lbin/lbin-completion.bash

Or with wget:

wget -O ~/.local/bin/lbin https://txt.liminal.cafe/sh/lbin/lbin
chmod +x ~/.local/bin/lbin

Usage

lbin <file>                   Upload file directly
lbin <command> <argument>     Upload with specific mode
command | lbin [options]      Upload from stdin

Commands

Command Short Description
file <path> f Upload a file and get a link
oneshot <path> o Upload a file with one-time use link
url <url> u Generate a shortened URL
oneshot_url <url> ou Generate a one-time use shortened URL
remote <url> r Paste file from remote URL
- Read from stdin

Options

Option Description
-h, --help Show help message
-o, --oneshot When reading stdin, use oneshot mode
-d, --debug Show curl command and full response

Examples

# Upload a file
lbin example.txt

# Upload with explicit command
lbin f example.txt

# Upload a one-time-use file (link expires after first view)
lbin o secret.txt

# Shorten a URL
lbin u https://example.com/very/long/path

# Pipe from stdin
echo "hello world" | lbin

# Pipe with oneshot mode
cat script.sh | lbin -o

# Debug mode (see the curl command)
lbin -d example.txt

Environment Variables

Variable Description
LBIN_URL Override base URL (default: https://bin.liminal.cafe)
LBIN_AUTH Authorization token (if required by the server)

Tab Completion

Bash

Add to your ~/.bashrc:

source ~/.local/share/bash-completion/completions/lbin
# or wherever you saved lbin-completion.bash

Zsh

Add to your ~/.zshrc:

source /path/to/lbin-completion.zsh

Or add to your fpath:

fpath=(~/.zsh/completions $fpath)
# then copy lbin-completion.zsh to ~/.zsh/completions/_lbin

How It Works

lbin uses curl to send multipart form data to the bin.liminal.cafe API:

The script is pure POSIX sh with no dependencies beyond curl and standard Unix utilities.


~byakuren
   ^ ^
 =(o.o)=