From e3a44af5c13388de7b55f6d0e562cdc38819aac4 Mon Sep 17 00:00:00 2001 From: minsoo-web Date: Fri, 13 Mar 2026 01:23:19 +0900 Subject: [PATCH] feat: add velog-cli plugin for managing velog.io blog posts (#19) Add a new plugin that provides CLI guidance for the velog blogging platform. The skill activates when users want to create, edit, publish, or browse posts on velog.io from the terminal. Co-Authored-By: Claude Opus 4.6 --- .claude-plugin/marketplace.json | 7 +- README.ko.md | 1 + README.md | 1 + plugins/velog-cli/.claude-plugin/plugin.json | 13 ++ plugins/velog-cli/README.md | 37 ++++ plugins/velog-cli/skills/velog-cli/SKILL.md | 207 +++++++++++++++++++ 6 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 plugins/velog-cli/.claude-plugin/plugin.json create mode 100644 plugins/velog-cli/README.md create mode 100644 plugins/velog-cli/skills/velog-cli/SKILL.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ede0c65..f432071 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,7 +1,7 @@ { "name": "kit", "description": "Community plugin & skills marketplace for Claude Code", - "version": "1.8.0", + "version": "1.9.0", "owner": { "name": "hamsurang", "email": "zlemzlem5656@naver.com" @@ -46,6 +46,11 @@ "name": "obsidian-brain", "source": "./plugins/obsidian-brain", "description": "Archive learnings from Claude Code sessions to Obsidian vault as Zettelkasten notes and use vault knowledge as conversational context" + }, + { + "name": "velog-cli", + "source": "./plugins/velog-cli", + "description": "Manage velog.io blog posts from the terminal — create, edit, publish, and browse posts via the velog CLI" } ] } diff --git a/README.ko.md b/README.ko.md index a799566..a307724 100644 --- a/README.ko.md +++ b/README.ko.md @@ -85,6 +85,7 @@ bash scripts/scaffold-plugin.sh | [obsidian](./plugins/obsidian) | Obsidian 볼트에서 노트 검색, 생성, 편집, 정리 및 obsidian-cli와 Obsidian Headless를 통한 프론트매터 관리 | [minsoo.web](https://github.com/minsoo-web) | | [library-analyzer](./plugins/library-analyzer) | 병렬 에이전트를 활용하여 오픈소스 라이브러리의 기여 준비도를 분석하는 스킬 | [minsoo.web](https://github.com/minsoo-web) | | [obsidian-brain](./plugins/obsidian-brain) | Claude Code 세션의 학습 내용을 Obsidian 볼트에 제텔카스텐 노트로 아카이빙하고 볼트 지식을 대화 컨텍스트로 활용하는 스킬 | [minsoo.web](https://github.com/minsoo-web) | +| [velog-cli](./plugins/velog-cli) | 터미널에서 velog.io 블로그 포스트를 관리 — velog CLI로 글 작성, 수정, 퍼블리시, 트렌딩 조회 | [minsoo.web](https://github.com/minsoo-web) | *플러그인을 기여하고 싶으신가요? [기여 방법](docs/contributors/contributing.md)을 확인하세요.* diff --git a/README.md b/README.md index 934086a..3c6ee41 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ bash scripts/scaffold-plugin.sh | [obsidian](./plugins/obsidian) | Work with Obsidian vaults — search, create, edit, organize notes and manage frontmatter via obsidian-cli and Obsidian Headless | [minsoo.web](https://github.com/minsoo-web) | | [library-analyzer](./plugins/library-analyzer) | Analyze open-source libraries for contribution readiness with parallel agents | [minsoo.web](https://github.com/minsoo-web) | | [obsidian-brain](./plugins/obsidian-brain) | Archive learnings from Claude Code sessions to Obsidian vault as Zettelkasten notes and use vault knowledge as conversational context | [minsoo.web](https://github.com/minsoo-web) | +| [velog-cli](./plugins/velog-cli) | Manage velog.io blog posts from the terminal — create, edit, publish, and browse posts via the velog CLI | [minsoo.web](https://github.com/minsoo-web) | *Have a plugin to share? See [Contributing](docs/contributors/contributing.md).* diff --git a/plugins/velog-cli/.claude-plugin/plugin.json b/plugins/velog-cli/.claude-plugin/plugin.json new file mode 100644 index 0000000..98b2737 --- /dev/null +++ b/plugins/velog-cli/.claude-plugin/plugin.json @@ -0,0 +1,13 @@ +{ + "name": "velog-cli", + "version": "1.0.0", + "description": "Manage velog.io blog posts from the terminal — create, edit, publish, and browse posts via the velog CLI.", + "author": { + "name": "minsoo.web", + "github": "minsoo-web" + }, + "license": "MIT", + "keywords": ["velog", "blog", "publishing", "markdown", "cli"], + "repository": "https://github.com/hamsurang/velog-cli", + "skills": "./skills/" +} diff --git a/plugins/velog-cli/README.md b/plugins/velog-cli/README.md new file mode 100644 index 0000000..bde365f --- /dev/null +++ b/plugins/velog-cli/README.md @@ -0,0 +1,37 @@ +# velog-cli + +Claude Code plugin for managing [velog.io](https://velog.io) blog posts from the terminal. + +## Installation + +```bash +# Install the velog CLI binary +brew tap hamsurang/velog-cli && brew install velog-cli + +# Install the Claude Code plugin +claude plugin install velog-cli@hamsurang/kit +``` + +## Features + +- **Authentication**: Login/logout with velog.io credentials +- **Post management**: Create, edit, delete, publish posts from markdown files +- **Browsing**: List your posts, drafts, trending, and recent posts +- **AI-optimized output**: `--format compact` for structured JSON output + +## Usage + +The skill activates automatically when you mention velog or want to manage blog posts: + +- "List my velog posts" +- "Publish this markdown as a velog post" +- "Show trending posts on velog" +- "Edit my post about Rust" + +## Prerequisites + +- [velog-cli](https://github.com/hamsurang/velog-cli) (`brew install velog-cli` or `cargo install velog-cli`) + +## License + +MIT diff --git a/plugins/velog-cli/skills/velog-cli/SKILL.md b/plugins/velog-cli/skills/velog-cli/SKILL.md new file mode 100644 index 0000000..0bc1f1f --- /dev/null +++ b/plugins/velog-cli/skills/velog-cli/SKILL.md @@ -0,0 +1,207 @@ +--- +name: velog-cli +description: > + Use when the user wants to manage velog.io blog posts from the terminal. + Activates when the user mentions velog, wants to publish a blog post, list + their velog posts, create or edit articles, manage drafts, or check trending + posts on velog.io. Also use when the user writes markdown content and wants + to publish it as a blog post, or when they ask about their velog account + status. Even if they just say "post this to my blog" or "publish this", + consider activating if velog-cli is installed. +--- + +# velog-cli Skill + +`velog` is a CLI client for [velog.io](https://velog.io), a developer blogging platform. +It lets you manage blog posts entirely from the terminal — create from markdown files, +edit, publish drafts, browse trending posts, and more. + +## Prerequisites + +The `velog` binary must be installed: + +```bash +# macOS +brew tap hamsurang/velog-cli && brew install velog-cli + +# Cargo (any platform) +cargo install velog-cli +``` + +If `velog` is not found, tell the user to install it first. + +## Authentication + +Most write operations require authentication. Check status before attempting mutations. + +```bash +# Check if logged in +velog auth status + +# Login (interactive — prompts for tokens from browser DevTools) +velog auth login + +# Logout +velog auth logout +``` + +**How to get tokens**: The user opens velog.io in their browser, opens DevTools (F12) → +Application → Cookies, and copies `access_token` and `refresh_token`. The CLI prompts +for these during `velog auth login`. + +Credentials are stored at `~/.config/velog-cli/credentials.json` and auto-refresh when expired. + +## Post Management + +### List Posts + +```bash +# List your own posts (requires auth) +velog post list + +# List your drafts +velog post list --drafts + +# Trending posts (filterable by period) +velog post list --trending +velog post list --trending --period week + +# Recent posts across velog +velog post list --recent + +# Posts by a specific user +velog post list -u + +# Control result count (1–100, default 20) +velog post list --limit 50 + +# Pagination +velog post list --recent --cursor +velog post list --trending --offset 20 +``` + +### Show a Post + +```bash +# Show your own post by slug +velog post show + +# Show another user's post +velog post show -u +``` + +The slug is the URL path segment (e.g., `my-first-post` from `velog.io/@user/my-first-post`). + +### Create a Post + +```bash +# From a markdown file (saved as draft by default) +velog post create -t "Post Title" -f article.md + +# From stdin +echo "# Hello World" | velog post create -t "Hello" + +# Publish immediately (not draft) +velog post create -t "Title" -f article.md --publish + +# With tags and custom slug +velog post create -t "Title" -f article.md --tags "rust,cli,velog" --slug my-custom-slug + +# Private post +velog post create -t "Title" -f article.md --publish --private +``` + +### Edit a Post + +```bash +# Update content from a file +velog post edit -f updated.md + +# Update title +velog post edit -t "New Title" + +# Update tags +velog post edit --tags "new,tags" + +# Update everything +velog post edit -t "New Title" -f updated.md --tags "new,tags" +``` + +### Publish a Draft + +```bash +velog post publish +``` + +### Delete a Post + +```bash +# With confirmation prompt +velog post delete + +# Skip confirmation +velog post delete -y +``` + +## Output Formats + +All commands accept `--format` to control output style: + +| Format | Use case | Description | +|--------|----------|-------------| +| `pretty` | Human reading (default) | Tables, colors, markdown rendering | +| `compact` | AI agents, scripts | Minified JSON on a single line | +| `silent` | CI/CD, exit-code-only checks | Queries emit JSON, mutations emit nothing | + +When Claude is running velog commands programmatically, use `--format compact` to get +structured JSON output that's easy to parse: + +```bash +velog post list --format compact +velog post show my-post --format compact +``` + +## Common Workflows + +### Write and publish a blog post + +1. Write markdown content to a file +2. Create as draft: `velog post create -t "Title" -f article.md --tags "tag1,tag2"` +3. Preview on velog.io if needed +4. Publish: `velog post publish ` + +### Update an existing post + +1. Find the slug: `velog post list --format compact` +2. Edit: `velog post edit -f updated.md` + +### Browse trending posts for inspiration + +```bash +velog post list --trending --period week --limit 10 +``` + +## Shell Completions + +```bash +# Generate completions +velog completions zsh # or bash, fish, elvish, powershell +``` + +## Error Handling + +1. **Not authenticated**: Run `velog auth status` first. If not logged in, guide + the user through `velog auth login`. +2. **Post not found**: Verify the slug with `velog post list --format compact`. +3. **Binary not found**: Tell the user to install via `brew` or `cargo`. + +## Tips for AI Agent Usage + +- Always use `--format compact` when you need to parse the output programmatically. +- Check auth status before attempting create/edit/delete/publish operations. +- When creating posts from user-written content, save to a temp file first, then + pass via `-f`. This avoids shell escaping issues with stdin piping. +- Default behavior is to save as draft — use `--publish` only when the user + explicitly asks to publish immediately. +- Use `--format silent` for mutations when you only care about success/failure + (check exit code).