Upload a markdown file, get a shareable rendered preview URL instantly.
/mdshare path/to/file.md
→ https://mdshare.fly.dev/xK9p3f
git clone https://github.com/jordanbench/mdshare
cd mdshare
bun install
fly apps create <your-app-name>
# update `app` in fly.toml to match
fly volumes create mdshare_data --region ord --size 1
fly secrets set MDSHARE_API_KEY=$(openssl rand -hex 20)
fly secrets set PUBLIC_URL=https://<your-app-name>.fly.dev
fly deployCreate ~/.claude/commands/mdshare.md:
Upload the markdown file `$ARGUMENTS` to mdshare and return a shareable URL.
Use the Bash tool to run this exact command (source ~/.zshrc first to pick up env vars):
```bash
source ~/.zshrc 2>/dev/null; jq -n \
--rawfile content "$ARGUMENTS" \
--arg title "$(basename '$ARGUMENTS')" \
'{content: $content, title: $title}' \
| curl -sf -X POST "${MDSHARE_URL}/share" \
-H "Content-Type: application/json" \
-H "X-Api-Key: ${MDSHARE_API_KEY}" \
-d @-
```
Extract the `url` field from the JSON response and display it clearly so the user can copy it.Then add to your ~/.zshrc:
export MDSHARE_URL="https://<your-app-name>.fly.dev"
export MDSHARE_API_KEY="<your-api-key>"After that, from any Claude Code session:
/mdshare path/to/your-file.md
| Method | Path | Auth | Description |
|---|---|---|---|
POST |
/share |
X-Api-Key header |
Upload markdown, returns {id, url} |
GET |
/:id |
none | Rendered HTML preview |
GET |
/:id/raw |
none | Raw markdown |
# curl example
cat file.md | jq -Rs '{content: .}' \
| curl -s -X POST $MDSHARE_URL/share \
-H "X-Api-Key: $MDSHARE_API_KEY" \
-H "Content-Type: application/json" \
-d @-