clip

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: MIT

README

clip

A minimalist, self-hostable file upload and paste server written in Go. Helpful for sharing screenshots, code snippets, and other files on services that don't support media sharing like IRC or TeamSpeak.

Client

Installation

macOS

brew tap bemoty/tap
brew install clip

Windows

scoop bucket add bemoty https://github.com/bemoty/scoop-bucket
scoop install clip

Arch Linux

yay -S clip-bin
Usage
clip [file] [flags]

With no arguments, clip reads from the clipboard. If stdin is piped, it reads from stdin instead. A file path can be passed as an argument to upload a specific file. Pass - as the file argument to explicitly read from stdin.

clip                        # upload clipboard contents
clip note.txt               # upload a file
clip note.txt --ttl 7d      # upload with a time to live
cat main.go | clip -l go    # upload stdin with language hint
clip -c                     # uploads clipboard contents and copies the link to clipboard (recommended for hotkeys)
clip -                      # explicitly read from stdin
Flag Short Description
--url Server URL (overrides config)
--key Auth key (overrides config)
--lang -l Language hint for syntax highlighting
--ttl Time to live (e.g. 7d, 1h)
--copy -c Immediately copy the returned link to clipboard
Configuration

On first use, run clip config init to create a config file. Open it with clip config open.

Key Description
url Server URL to upload to
key Auth key for the server
ttl Default time to live for uploads

Configuration can also be provided via environment variables: CLIP_URL, CLIP_KEY, CLIP_TTL.

Server

Deployment

Run via Docker Compose using the GitHub Container Registry image.

services:
  clip:
    image: docker.pkg.github.com/bemoty/clip/app:latest
    container_name: clip
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./uploads:/data
    environment:
      - AUTH_KEY=your-secure-secret-key
      - BASE_URL=https://yourdomain.com
Configuration
Variable Description Default
PORT HTTP port to listen on :8080
STORAGE_PATH Directory where files are stored ./data
AUTH_KEY Secret key for upload auth no-auth
BASE_URL Public URL used to generate links http://i.bemoty.dev
MAX_FILE_MB Maximum file upload size in MB 100
PASTE_STYLE Chroma style for code pastes — available styles dracula

License

MIT

Directories

Path Synopsis
cmd
client command
gen-man command
server command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL