LinkedIn帖子自动化工具

一个用于自动化生成LinkedIn帖子、图片和草稿的浏览器自动化和工作流执行工具。

  • by CopyPasteFail
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 CopyPasteFail/postforge

使用说明

邮政伪造

MCP服务器+LinkedIn后流程自动化技能。一个回购,两部分:

  1. MCP服务器 --用于图像生成和LinkedIn草稿准备的浏览器自动化后端
  2. 技能 --任何编码代理在撰写帖子、生成图像和准备草稿时都遵循的工作流指令

主机代理(Claude Code、Codex、Gemini CLI)拥有所有推理。此服务器拥有所有执行。服务器从不调用LLM,也从不单击Post。


快速开始

先决条件

  • Node.js>=20
  • 已安装Chrome或Chromium

1.克隆和构建

git clone https://github.com/CopyPasteFail/postforge.git
cd postforge
npm install
npx playwright install chromium
npm run build

2.配置环境

cp .env.example .env

编辑 .env --默认设置适用于大多数设置:

PIPELINE_DATA_DIR=~/.linkedin-pipeline
PLAYWRIGHT_HEADLESS=false
PLAYWRIGHT_CHANNEL=chrome

3.联系你的代理人

在下面选择您的代理,然后完成第一次运行检查表。


安装:克劳德代码

步骤1--注册MCP服务器

添加到您的Claude Code MCP设置(项目 .claude/settings.json 或全球 ~/.claude/settings.json):

{
  "mcpServers": {
    "linkedin-post-agent": {
      "command": "node",
      "args": ["/absolute/path/to/postforge/dist/server.js"]
    }
  }
}

步骤2--重新启动Claude代码

技能(skills/postforge/SKILL.md)克劳德的具体指导(CLAUDE.md)当Claude Code打开此仓库时,会自动拾取。

如果作为Claude Code插件安装,该技能也可以通过 /postforge 命令。

步骤3——首次运行检查 (见下面的检查表)


安装:Codex

告诉Codex:

Fetch and follow instructions from https://raw.githubusercontent.com/CopyPasteFail/postforge/main/.codex/INSTALL.md

完整指南: .codex/INSTALL.md --包括安装、验证、更新、卸载和故障排除。


首次运行检查表

在连接好您的代理后,请在第一次发帖前验证以下内容:

步骤 问你的经纪人什么 它做什么
1 “运行医生” 检查节点版本、Playwright、Chrome、数据目录、工具配置
2 “为领英运行ensure_auth” 在浏览器中打开领英——手动登录,会话保存
3 “对chatgpt运行ensure_auth” 对chatgpt也是如此(对每个启用的映像工具重复此操作)

对在中启用的每个图像工具重复步骤3 .env (双子座、人工智能工作室、flow、grok、副驾驶)。身份验证会话在浏览器配置文件中持续存在——每个工具只执行一次。

如果 doctor 报告问题,在继续之前解决问题。


Bootstrap提示

设置完成后,将此内容粘贴到您的代理中以开始运行:

Use the postforge skill.

First run doctor. Then run ensure_auth for linkedin and for any image tools
you have enabled. After both pass, follow the skill workflow exactly.

If I haven't provided a link or idea, start with Phase 0 news discovery.
Never click Post automatically — stop at the ready_to_post stage and confirm with me first.

回购是如何连接的

图层 文件 谁读取它
共享工作流 skills/postforge/SKILL.md 两位代理人
共享后端 src/ -> dist/server.js 两种代理(通过MCP)
克劳德指导 CLAUDE.md 仅限克劳德代码
食品法典委员会指南 AGENTS.md 仅限食品法典
食品法典元数据 agents/openai.yaml 仅限食品法典

要更深入地了解代理连接的不同之处以及管道调用序列的工作原理: docs/architecture.md


MCP工具

工具 说明
start_run 从链接、草稿或想法开始新的管道运行
submit_approved_copy 提交批准的帖子文本和图像提示
generate_image_candidates 跨启用的AI工具运行图像生成
select_image_candidate 按候选编号选择图像
prepare_linkedin_draft 填写LinkedIn编辑器并另存为草稿
ensure_auth 确保特定工具的身份验证
get_run 获取完整运行状态
cancel_run 取消活动跑步
doctor 运行诊断检查

管道阶段

created -> awaiting_content_approval (link accessible or non-link)
created -> blocked_on_source_access (link inaccessible)
awaiting_content_approval -> awaiting_image_generation (submit_approved_copy)
awaiting_image_generation -> generating_images -> awaiting_image_selection
awaiting_image_selection -> ready_for_linkedin (select_image_candidate)
ready_for_linkedin -> ready_to_post (prepare_linkedin_draft)

终端阶段: ready_to_post, failed, archived

许可证

国际协调委员会