← 返回 Skills 市场
389
总下载
1
收藏
1
当前安装
4
版本数
在 OpenClaw 中安装
/install juejin-publisher
功能描述
掘金文章自动发布技能。通过掘金官方 API(Cookie 鉴权),支持将 Markdown 文章一键发布到稀土掘金平台,支持设置分类、标签、摘要和封面图。
使用说明 (SKILL.md)
掘金文章自动发布
本技能通过掘金官方 API,将 Markdown 文章自动发布到稀土掘金平台,无需打开浏览器,全程命令行完成。
⚙️ 快速配置
1. 获取掘金 Cookie
- 打开浏览器,登录 掘金
- 按
F12打开开发者工具 → Network 标签 - 随便点击一个请求(如
query_user_info) - 在 Request Headers 中找到
Cookie字段,复制完整内容 - 将 Cookie 填入配置文件(见下方步骤 2)
⚠️ Cookie 有效期约 30 天,过期后需重新获取
2. 配置凭证文件
# 在 skill 根目录创建配置文件
cp /data/workspace/skills/juejin-publisher/juejin.env.example \
/data/workspace/skills/juejin-publisher/juejin.env
# 编辑配置文件,填入你的 Cookie
nano /data/workspace/skills/juejin-publisher/juejin.env
配置文件内容:
# 掘金登录 Cookie(从浏览器 F12 获取)
JUEJIN_COOKIE="sessionid=xxx; ..."
# 默认分类 ID(可选,默认:后端)
# 常用分类 ID 见 references/category_ids.md
JUEJIN_DEFAULT_CATEGORY_ID="6809637769959178254"
# 默认标签 ID(逗号分隔,可选)
# 常用标签 ID 见 references/tag_ids.md
JUEJIN_DEFAULT_TAG_IDS="6809640408797167623"
🚀 使用指南
方式 A:智能助手(推荐)
直接对我说:
"帮我把
article.md发布到掘金,分类是前端,标签是 Vue.js"
我会自动:
- 读取
juejin.env获取 Cookie - 解析 Markdown 文件的 frontmatter(标题、摘要、封面等)
- 调用掘金 API 创建草稿并发布
- 返回文章链接
方式 B:命令行脚本
# 赋予执行权限
chmod +x /data/workspace/skills/juejin-publisher/scripts/publish.py
# 基本用法(使用默认分类和标签)
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md
# 指定分类和标签
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md \
--category "6809637767543259144" \
--tags "6809640407484334093,6809640445233070094"
# 仅创建草稿,不发布
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md --draft-only
📝 Markdown 文件格式
文章顶部支持 frontmatter 元数据(可选):
---
title: 我的技术文章标题
description: 这里是文章摘要,建议 50-100 字,会显示在文章列表中
cover: https://example.com/cover.jpg
category_id: "6809637767543259144"
tag_ids: "6809640407484334093,6809640445233070094"
---
# 正文内容开始
这里是 Markdown 正文...
如果 frontmatter 中没有提供
title,脚本会自动取 Markdown 第一个# 标题作为文章标题。
📚 常用分类 ID
| 分类名称 | category_id |
|---|---|
| 前端 | 6809637767543259144 |
| 后端 | 6809637769959178254 |
| Android | 6809635626879549454 |
| iOS | 6809635627209637895 |
| AI | 6809637773935378440 |
| 工具 | 6809637771511070734 |
| 阅读 | 6809637772874219534 |
🏷️ 常用标签 ID
| 标签名称 | tag_id |
|---|---|
| Python | 6809640408797167623 |
| JavaScript | 6809640407484334093 |
| Vue.js | 6809640445233070094 |
| React | 6809640407484334100 |
| Go | 6809640408797167624 |
| Docker | 6809640445233070095 |
| AI | 6809640445233070096 |
完整标签列表见
references/tag_ids.md,或通过以下命令查询:python3 /data/workspace/skills/juejin-publisher/scripts/query_tags.py "关键词"
🛠️ 故障排查
| 现象 | 原因 | 解决方案 |
|---|---|---|
err_no: 1 |
Cookie 失效 | 重新登录掘金并获取新 Cookie |
brief_content 长度不符 |
摘要太短或太长 | 摘要需 50-100 字 |
category_id 无效 |
分类 ID 错误 | 参考上方常用分类 ID 表 |
tag_ids 无效 |
标签 ID 错误 | 运行 query_tags.py 查询正确 ID |
文章重复 |
标题已存在 | 修改标题或删除掘金上的旧草稿 |
安全使用建议
This package appears to do exactly what it says: read a local juejin.env or JUEJIN_COOKIE environment variable and publish Markdown to api.juejin.cn. Before installing/using it, consider: 1) The JUEJIN_COOKIE is equivalent to a logged-in session — treat it as a secret. Only store it in secure, private locations and rotate/revoke it if you suspect compromise. 2) Test with --draft-only first to confirm behaviour. 3) The metadata unnecessarily lists curl as required even though the Python scripts don't use it — this is a minor inconsistency but not a security problem. 4) Review the scripts yourself (they are included) if you will run this in a shared or production environment. If you plan to run the skill in an environment accessible by others, avoid placing the Cookie in a world-readable file.
功能分析
Type: OpenClaw Skill
Name: juejin-publisher
Version: 1.0.3
The skill is a legitimate automation tool for publishing Markdown articles to the Juejin platform via its official API (api.juejin.cn). It handles sensitive session cookies for authentication as part of its core functionality, but there is no evidence of data exfiltration to unauthorized endpoints, malicious execution, or prompt injection. The code in scripts/publish.py and scripts/query_tags.py is transparent and aligns with the stated purpose.
能力评估
Purpose & Capability
Name/description match the included Python scripts which call api.juejin.cn to create drafts and publish articles. The only minor mismatch is that the SKILL.md metadata and registry metadata list 'curl' as a required binary while the provided scripts use Python's urllib and do not call curl — curl appears unnecessary but not malicious.
Instruction Scope
Runtime instructions explicitly say the skill will read a local juejin.env or environment variable to obtain the JUEJIN_COOKIE and then call the official 掘金 API endpoints. The scripts only read the declared config file / environment variables and the Markdown file to be published; they don't read other system files or contact unexpected external endpoints.
Install Mechanism
No install spec (instruction-only + shipped scripts). No external downloads or archive extraction. The package includes Python scripts and docs only — low install risk.
Credentials
The skill requires access to a login Cookie (JUEJIN_COOKIE), which is necessary for cookie-based auth to the 掘金 API and is described in SKILL.md. That credential is sensitive — but its use is proportionate to the stated purpose. The package also reads optional env vars for default category/tag IDs. The metadata did not list required env vars in the registry, but the SKILL.md documents which values are needed.
Persistence & Privilege
always is false and the skill does not attempt to modify other skills or global agent settings. It only reads a local config file in its own skill folder and environment variables; no elevated persistence or privileges are requested.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install juejin-publisher - 安装完成后,直接呼叫该 Skill 的名称或使用
/juejin-publisher触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
重新上架:移除内置Cookie,改为用户自行配置,保障账号安全
v1.0.2
- Bumped version to 1.0.2.
- Updated internal metadata and documentation.
- Removed the sample juejin.env configuration file.
- Minor script or documentation maintenance; no major user-facing feature changes.
v1.0.1
- Bump version to 1.0.1
- Update documentation in SKILL.md (no major user-facing changes)
- Adjust metadata and environment files for clarity and consistency
v1.0.0
Initial release: Easily publish Markdown articles to Juejin via API with full category, tag, and metadata control.
- Publish Markdown articles to Juejin using official API and Cookie authentication.
- Supports setting category, tags, summary, and cover image in one command.
- Configuration and credential setup guide included.
- Use via conversational assistant or command-line script.
- Handles frontmatter parsing for streamlined publishing.
- Provides troubleshooting tips and common category/tag references.
元数据
常见问题
Juejin Publisher 是什么?
掘金文章自动发布技能。通过掘金官方 API(Cookie 鉴权),支持将 Markdown 文章一键发布到稀土掘金平台,支持设置分类、标签、摘要和封面图。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 389 次。
如何安装 Juejin Publisher?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install juejin-publisher」即可一键安装,无需额外配置。
Juejin Publisher 是免费的吗?
是的,Juejin Publisher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Juejin Publisher 支持哪些平台?
Juejin Publisher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Juejin Publisher?
由 巫山老妖(@devilwwj)开发并维护,当前版本 v1.0.3。
推荐 Skills