Skip to content

Upload a markdown file, get a shareable rendered preview URL. Includes a Claude Code /mdshare command.

Notifications You must be signed in to change notification settings

jordanbench/mdshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdshare

Upload a markdown file, get a shareable rendered preview URL instantly.

/mdshare path/to/file.md
→ https://mdshare.fly.dev/xK9p3f

Deploy to Fly.io

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 deploy

Claude Code command setup

Create ~/.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

API

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 @-

About

Upload a markdown file, get a shareable rendered preview URL. Includes a Claude Code /mdshare command.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors