Upload a PDF, HTML, or Markdown file and get a short URL that renders it directly in the browser. No login walls, no download prompts, no ugly Google Drive links.
- One command —
docs upload report.pdf→ short URL copied to clipboard - Renders in browser — PDFs display inline, HTML served as-is, Markdown rendered with GitHub styling
- Short URLs —
https://your-domain.com/xK9mRt2p— clean and shareable - Fast & global — served from Cloudflare's edge network via R2 + Workers
- Simple auth — bearer token for uploads, public read for viewing
Requires Go 1.22+.
git clone <repo>
cd docs
make installcd worker
npm install
npx wrangler login # if not already logged in
npx wrangler r2 bucket create docs-cli
npx wrangler deploy
npx wrangler secret put AUTH_TOKENGenerate a token with openssl rand -hex 32 and paste when prompted.
docs configEnter your worker URL (printed after wrangler deploy) and the same auth token.
Config stored at ~/.config/docs/config.yaml:
url: https://docs.yourdomain.workers.dev
token: your-auth-tokendocs upload report.pdf # upload PDF, get short URL
docs upload page.html # upload HTML page
docs upload notes.md # upload Markdown (rendered with GitHub CSS)The URL is printed and copied to your clipboard automatically.
| Extension | Rendering |
|---|---|
.pdf |
Displayed inline in browser's PDF viewer |
.html, .htm |
Served as-is with original formatting |
.md, .markdown |
Rendered with GitHub-flavored Markdown (light theme) |
docs upload file.pdf
│
▼
┌─────────┐ PUT /upload ┌──────────────────┐ put() ┌─────────┐
│ CLI │ ──────────────▶ │ Cloudflare │ ──────────▶ │ R2 │
│ (Go) │ Bearer token │ Worker │ │ Bucket │
└─────────┘ └──────────────────┘ └─────────┘
▲ │
│ │
└── { url: "https://…/xK9mRt2p" }
Browser GET /xK9mRt2p ──▶ Worker ──▶ R2 ──▶ file served
- CLI sends the file to the Worker with a bearer token
- Worker generates an 8-character short ID, stores the file in R2
- Worker returns the short URL, CLI copies it to clipboard
- Anyone with the URL can view the document — no auth required
| Command | Description |
|---|---|
docs upload <file> |
Upload a file and get a short URL |
docs config |
Set worker URL and auth token |
docs help |
Show help |
To use your own domain instead of *.workers.dev:
- Add a custom domain in the Cloudflare dashboard under Workers → your worker → Triggers → Custom Domains
- Update your CLI config:
docs configwith the new URL
Built for sharing docs fast between co-founders. No frills, just works.