Juejin Publisher
v1.0.3掘金文章自动发布技能。通过掘金官方 API(Cookie 鉴权),支持将 Markdown 文章一键发布到稀土掘金平台,支持设置分类、标签、摘要和封面图。
Security Scan
OpenClaw
Benign
high confidencePurpose & 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.
Assessment
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.Like a lobster shell, security has layers — review code before you run it.
Runtime requirements
⛏️ Clawdis
Binspython3, curl
latest
掘金文章自动发布
本技能通过掘金官方 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 |
文章重复 | 标题已存在 | 修改标题或删除掘金上的旧草稿 |
Comments
Loading comments...
