简体中文 | English
Share local files, folders, stdin content, and Git diffs through time-limited preview URLs.
drop is a small CLI for turning local content into browser-friendly preview links. It starts a local web server when needed, stores share state under ~/.drop, and renders common developer formats with readable previews.
| Need | Command |
|---|---|
| Share one file | drop README.md |
| Share a browsable folder | drop . |
| Share terminal output | command | drop share --type text |
| Share Markdown from stdin | echo "# Hi" | drop share --type markdown |
| Share current Git diff | git diff | drop share --type diff |
| Share a commit | drop allow-git . HEAD |
| List active shares | drop list |
| Stop the daemon | drop stop |
Install the latest release:
curl -fsSL https://raw.githubusercontent.com/junping1/drop/master/install.sh | bash
Share a file:
drop README.md
Share a directory:
drop .
Share piped content:
git diff | drop share --type diff --title "current changes"
Each command prints a URL. Open it in a browser or send it to someone who should be able to preview the content.
/f/:token, /d/:token, or /git/:token.Runtime state lives in ~/.drop/:
| Path | Purpose |
|---|---|
~/.drop/drop.db |
SQLite authorization database |
~/.drop/config.json |
config and owner key |
~/.drop/drop.pid |
daemon PID |
~/.drop/drop.log |
daemon log |
~/.drop/shares/ |
temporary files created from stdin shares |
Copy this block into your coding agent instructions so it can install and use drop consistently:
Install and use `drop`, a CLI tool for sharing local files through time-limited preview URLs.
Install:
curl -fsSL https://raw.githubusercontent.com/junping1/drop/master/install.sh | bash
Expose links:
drop serve
# If you use an external tunnel, set the public URL:
drop config set base_url https://your-domain.example
Use:
drop /path/to/file # share a file
drop /path/to/dir # share a browsable directory
drop /path/to/file --ttl 3600 # custom TTL in seconds
drop /path/to/file --live # auto-refresh when the file changes
echo "content" | drop share --type markdown # share piped content
git diff | drop share --type diff # share a diff
drop list # list active shares
Behavior:
- After creating or editing a file that the user should inspect, run `drop` on it and send the URL.
- When the user asks to see a file, show a preview, or get a link, use `drop`.
- For directories, use `drop /path/to/dir` so the user gets the browsable UI.
- Do not share secrets, `.env` files, API keys, tokens, or credential backups.
| User intent | Agent action |
|---|---|
| "Show me this file" | Run drop /path/to/file and return the URL. |
| "Show me this folder/project" | Run drop /path/to/dir and return the URL. |
| "Show me your changes" | Prefer git diff | drop share --type diff --title "changes". |
| "Share the generated report" | Run drop on the generated artifact. |
| "Make this public" | Ask which tunnel/base URL to use, then set base_url. |
| Content may contain secrets | Do not share; ask for confirmation or exclude sensitive paths. |
Machine-readable summary:
tool: drop
purpose: Share local content through temporary preview URLs.
default_ttl_seconds: 86400
state_dir: ~/.drop
share_file: drop /path/to/file
share_directory: drop /path/to/dir
share_stdin: command | drop share --type text
share_diff: git diff | drop share --type diff
list_shares: drop list
stop_daemon: drop stop
never_share:
- .env
- API keys
- OAuth credentials
- tokens
- password files
- database backups
One-line install for Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/junping1/drop/master/install.sh | bash
Install from a fork or another release repository:
curl -fsSL https://raw.githubusercontent.com/owner/drop/master/install.sh | DROP_REPO=owner/drop bash
Build from source:
git clone https://github.com/junping1/drop.git
cd drop
bun install
bun run build
cp dist/drop-linux-x64 ~/.local/bin/drop
Source builds require Bun v1.0+.
The allow subcommand is implicit:
drop ~/file.py
drop allow ~/file.py
Both commands share the same file. The daemon starts automatically if it is not already running.
| Content | Best command |
|---|---|
| Existing file | drop /path/to/file |
| Existing directory | drop /path/to/dir |
| Generated text | drop share --content "..." --type text |
| Command output | command | drop share --type text |
| Markdown output | command | drop share --type markdown |
| Code snippet | drop share --content "..." --type code |
| Git diff | git diff | drop share --type diff |
| Git commit | drop allow-git . HEAD |
drop ~/file.py # share a file
drop ~/file.py --ttl 300 # expire in 5 minutes
drop ~/file.py --head 50 # show only the first 50 lines
drop ~/file.py --tail 50 # show only the last 50 lines
drop ~/file.py --live # reload preview when the file changes
drop ~/project/ # share a browsable file tree
drop ~/project/ --ttl 7200 # custom TTL
drop ~/project/ --exclude '*.log' # add exclude patterns
drop ~/project/ --live # refresh when the directory changes
Default excludes: .git/, __pycache__/, .env, node_modules/, .DS_Store, *.pyc, .venv/.
echo "# Hello" | drop share --type markdown
git diff | drop share --type diff --title "my changes"
drop share --content "print('hi')" --type python
Supported types: markdown, python, javascript, json, yaml, html, css, shell, diff, code, text.
drop allow-git /path/to/repo abc1234
drop allow-git . HEAD
Git commit shares render commit metadata, changed files, and expandable highlighted diffs.
| Command | Description |
|---|---|
drop <path> |
share a file or directory |
drop allow <path> |
explicit form of drop <path> |
drop share |
share stdin or inline text |
drop allow-git <repo> <commit> |
share a Git commit diff |
drop list |
list active and expired shares |
drop list --json |
list shares as JSON |
drop revoke <token> |
revoke a file, directory, or Git share token |
drop owner-url |
print the owner dashboard URL |
drop status |
check daemon status |
drop stop |
stop the daemon |
drop serve |
start the server in the foreground |
drop config get <key> |
read a config value |
drop config set <key> <value> |
write a config value |
drop config set base_url https://files.example.com
drop config get base_url
| Key | Default | Description |
|---|---|---|
base_url |
http://localhost:17173 |
public URL prefix for generated links |
port |
17173 |
server listen port |
file_ttl |
86400 |
default file-share TTL in seconds |
dir_default_ttl |
86400 |
default directory-share TTL in seconds |
auto_stop |
false |
stop the daemon when all shares expire |
| Type | Rendering |
|---|---|
Code (.py, .js, .ts, .go, .rs, etc.) |
syntax highlighting via highlight.js |
Markdown (.md) |
rendered HTML with readable document styling |
| CSV/TSV | styled HTML table |
| browser-native PDF viewer | |
| SVG | image preview via data URI |
| Audio/video | HTML5 player |
| Images | inline display |
| Git commits | metadata and expandable highlighted diffs |
| Other files | raw response with guessed content type |
robots.txt disallows indexing.DROP_TRUST_PROXY=1 is set for a trusted reverse proxy.Important boundaries:
.env files, API keys, OAuth credentials, database backups, or directories that may contain them.For local-only use, the default URL is usually enough:
drop README.md
For public sharing, run your preferred tunnel and set base_url:
cloudflared tunnel --url http://localhost:17173
ngrok http 17173
tailscale funnel 17173
drop config set base_url https://your-domain.example
The CLI exposes a drop serve --tunnel option, but verify the current implementation before relying on built-in tunnel behavior in production workflows.
bun install
bun run dev:serve # start server in foreground
bun run build:web # build the Svelte directory browser
bun run dev:web # run the Svelte dev server
bun run build # compile a standalone binary
bun run verify # run the project verification entrypoint
MIT