Skip to main content
command

publisher-medium — Claude Code command: convert posts for Medium

Turns a blog post from markdown, PDF or a URL into HTML you can paste into Medium, with markers showing where images go.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command marketing/publisher-medium
Open on GitHub

What publisher-medium does

The publisher-medium command takes your draft and produces an HTML file built for Medium. Feed it a file path, a post URL or a slug from the codebase. A second argument sets the language: en by default, ja for Japanese.

Source detection happens on its own. Markdown, PDF, HTML and plain text get read locally; a link goes through WebFetch; a slug is looked up in the repo. Headers, lists, code blocks and quotes survive the trip. Diagrams get upload markers plus their file paths, so you know what to attach by hand once you are in the editor.

The result is medium-article-[LANG].html, with a copy button for one-click transfer. The command opens that preview and the Medium editor for you. No dependencies to install — Read, Write and Bash cover it. Without filesystem or browser access in your agent environment, you handle the preview step yourself.

What it helps with

  • turn a markdown draft into Medium-ready HTML
  • pull a post from a URL and strip the extra markup
  • mark where diagrams need uploading during publishing
  • keep headers, lists and code blocks intact in the export
  • prepare a preview file with a one-click copy button

Example prompts for the agent

  • Convert my-post into Medium format
  • Build a Medium version of article.md in Japanese
  • Fetch https://blog.com/post and produce the Medium HTML

How to install publisher-medium

1claude-code-templates

npx claude-code-templates@latest --command marketing/publisher-medium

2Manually: put the files in place

.claude/commands/publisher-medium.md

Call it with /publisher-medium. For all projects use ~/.claude/commands/

Questions about publisher-medium

How do I install publisher-medium in Claude Code?

Run npx claude-code-templates@latest --command marketing/publisher-medium. The command file then lives at .claude/commands/publisher-medium.md.

What does publisher-medium do?

It reads a post from a file, URL or slug, converts it to HTML suited to Medium, and adds image upload markers with the paths to each file.

Which tools does the command use?

Read, Write, Bash, Glob and WebFetch. Nothing external is required, though WebFetch handles the URL input.

Source text

publisher-medium.md · MIT
---
allowed-tools: Read, Write, Bash, Glob, WebFetch
argument-hint: <input> [lang]
description: Convert blog posts to Medium-ready HTML format with image upload markers
---

# Medium Article Converter

Convert blog posts to Medium-ready format with proper HTML structure and image handling.

**Usage:** `$ARGUMENTS`

**Examples:**
```bash
/publisher:medium my-post           # Default English
/publisher:medium my-post ja        # Japanese
/publisher:medium article.md        # From file path
/publisher:medium https://blog.com/post  # From URL
```

**Process:**

1. **Parse Input & Detect Source**
   - File path, URL, or blog post slug
   - Optional language parameter (en/ja)

2. **Universal Input Detection**
   - **File**: Read markdown, PDF, HTML, or text
   - **URL**: WebFetch to retrieve content
   - **Slug**: Search codebase for blog post

3. **Convert to Medium Format**
   - Parse markdown and extract frontmatter
   - Convert to clean HTML suitable for Medium
   - Preserve headers, lists, code blocks, quotes
   - Add image upload markers for diagrams
   - Include image paths for easy upload reference

4. **Create HTML Preview File**
   - Generate `medium-article-[LANG].html` preview
   - Include one-click copy button
   - Add image upload instructions with file paths
   - Use Medium-style formatting and colors

5. **Open in Browser**
   - Open HTML preview file
   - Open Medium editor (https://medium.com/new-story)
   - User can copy HTML and paste into Medium
   - Follow image markers to upload diagrams

**Output:**
- HTML preview file with copy button
- Clear image upload markers
- File paths shown for each image
- Ready to paste into Medium editor

**Note**: Works universally - no dependencies required, just Read, Write, and Bash tools.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

Everything for Marketing and content →

From the same set361

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor