“Can AI reply to my comments?” is usually two questions. Can it write a decent reply? Yes. Can it be trusted to press send on its own? Only for some comments. A “thanks, glad it helped!” under a post is low stakes. A reader asking whether your advice applies to their visa, or pushing back on a number, is not.
This recipe builds that split into the task. Every morning, Codex reads the new comments on your recent LinkedIn posts and sorts them:
- SAFE: a plain thank-you, agreement or emoji-only comment. Codex replies itself, in your voice.
- REVIEW: a question, criticism, or anything touching money, legal, health or hiring. Codex writes a draft into
queue.mdand sends nothing. You read it with your coffee and say which to send.
By the end you’ll have a folder with voice.md, handled.md and queue.md, and a daily 8 am scheduled task. Setup takes about 20 minutes, mostly signing in.
Who this fits: someone whose LinkedIn posts get more comments than they want to answer one by one, with a computer that is on at 8 am. Local scheduled tasks in the ChatGPT desktop app need the computer on and the app running, per OpenAI’s docs.
What it can and can’t do
Checked against the PublishPort command set (publishport-opencli 1.0.48):
| Step | LinkedIn command | Notes |
|---|---|---|
| List your posts | posts |
Your own recent posts with reaction and comment counts |
| Read comments | post-comments |
Returns each comment’s id, author, text, time and whether it is itself a reply; up to 100 per post, newest first with --sort recent |
| Reply | reply |
Replies to one comment, up to 1,250 characters. Without --send true it only checks your session and posts nothing |
That last row is what makes the first run safe: until the AI passes --send true, nothing leaves your account. Comments and replies on X work similarly (notifications can be read and replies sent), and you can add them later with the same pattern. This post sticks to LinkedIn to keep the first run simple.
The recipe
You’ll paste this to Codex in step 2:
Read https://www.publishport.app/skill.md and follow it to set up PublishPort for me, then check that LinkedIn is connected, list my 5 most recent LinkedIn posts, read the new comments on each, and for every comment not already in handled.md write a proposed reply into queue.md, marking each one SAFE (a plain thank-you or agreement) or REVIEW (a question, criticism, or anything about money, legal, health or hiring); run every LinkedIn reply as a dry run only, send nothing, and after that help me turn it into a scheduled task that runs every morning at 8.
The skill file is a short public instruction sheet. It tells the AI how to sign in, see which accounts your computer has connected, run commands and verify results. Authorization is one click from you, and every AI you authorize is listed under AI access on your account page, where you can revoke it any time.
Step 0: Get three things ready
1. The ChatGPT desktop app (Codex lives inside it). Install it from OpenAI’s download page and sign in. The Codex CLI and IDE extension have no Scheduled screen, so create the task in the desktop app.
2. The PublishPort desktop app, signed in to LinkedIn. Install it from the download page, open Platform accounts, click Sign in next to LinkedIn, sign in as you normally would in the window that opens, then click I’ve signed in (walkthrough).
3. A folder and three small files. Create a folder called comment-desk containing:
handled.md: empty. The AI appends every comment id it has dealt with, so tomorrow’s run skips them.queue.md: empty. Drafts for you to review land here.voice.md: how you talk to readers. Three or four sentences and two real replies you’ve sent are enough:
Warm, short, first name only. No emojis except one at most. Never promise a future post or a discount.
Examples of my replies:
- "Thanks Maria, glad the checklist helped. The next step is the one people skip."
- "Fair point, David. I didn't cover teams over 50."
Node.js is needed for the publishing commands: ask Codex to run node -v, or install the LTS release from nodejs.org.
Step 1: Open the folder in Codex
In the ChatGPT desktop app, switch to Codex and open comment-desk as your workspace.
Step 2: Paste the recipe and watch one dry run
Send the recipe. Here’s what happens:
- Codex installs the PublishPort skill and gives you an authorization link and a confirmation code. Open the link, sign in or create a PublishPort account, check the code matches, click Authorize. The link lasts 10 minutes.
- It reports whether LinkedIn is signed in. If not, sign in again under Platform accounts and ask it to re-check.
- It lists your posts, reads their comments and fills
queue.md. Each entry has the commenter, the comment, SAFE or REVIEW, and the proposed reply. - Nothing was sent. Read
queue.mdthe way a stranger would read your replies.
Look hardest at the SAFE labels. If anything labelled SAFE should have been REVIEW (say, a polite comment that quietly contains a question), tell Codex the rule (“a comment with a question mark is always REVIEW”) and ask it to add that to voice.md. Tighten until you’d send every SAFE reply under your name without reading it.
Step 3: Let the task reach the network (once)
Scheduled tasks run unattended in the default sandbox, and the default blocks network access, which every LinkedIn call needs (OpenAI docs). The fix is a rule allowing one command prefix. Send this in the same chat and approve what it asks:
Install the publishport CLI globally with npm, then add a rule to ~/.codex/rules/default.rules that allows commands starting with "publishport" to run outside the sandbox. Tell me when to restart the app.
Or do it by hand: run npm install -g publishport, add this to ~/.codex/rules/default.rules, then restart the ChatGPT app:
prefix_rule(
pattern = ["publishport"],
decision = "allow",
justification = "PublishPort needs network access to read and reply to comments",
)
Only commands starting with publishport run outside the sandbox.
Step 4: Create the morning task
Open Scheduled in the sidebar. If Codex didn’t already create the task for you, create a new one, pick the comment-desk folder, set it to daily at 8 am, and paste:
This is a pre-approved daily comment task. Work without asking me to confirm.
1. List my 5 most recent LinkedIn posts with PublishPort. For each, read the comments newest first. Run publishport guide linkedin first to check the live command options.
2. Skip any comment whose id is already in handled.md, any comment written by me, and any comment that is itself a reply.
3. Classify each remaining comment using voice.md. SAFE means only a plain thank-you, agreement or reaction. Everything else is REVIEW, including every comment with a question, a disagreement, a link, a sales pitch, or anything about money, legal, health or hiring. When unsure, REVIEW.
4. For SAFE comments: write a reply of one or two sentences in my voice, using the commenter's first name, and send it with the linkedin reply command and --send true. After each send, check the post's comments to confirm the reply appears. Never send the same text twice in one run, and never send more than 10 replies in one run.
5. For REVIEW comments: append to queue.md the date, post, commenter, comment id, comment text and a draft reply. Do not send.
6. Append every comment id you handled, SAFE or REVIEW, to handled.md.
7. If a command fails, don't retry it blindly. Check whether the reply already appears, retry once only if it does not, and otherwise note the failure at the top of queue.md.
8. Finish with a summary: how many sent, how many waiting in queue.md.
The prompt says it is pre-approved because nobody is at the keyboard at 8 am. Click Run now on the first day and read what it did. Watch the first few runs, as OpenAI recommends, and adjust the SAFE rules rather than loosening the review step.
Step 5: The morning routine
Open queue.md. Edit any draft you like, then open a Codex chat in the same folder and say:
Send the LinkedIn replies for queue items 2 and 5 exactly as written. Show me the final text first. Then delete the items I didn't send.
Because you’re in the room, the AI can show you the text and send. It’s two minutes a day for the comments that actually need you.
If something doesn’t run
- Nothing happened at 8: the computer was off, or the ChatGPT desktop app wasn’t running. Keep the PublishPort app running as well.
- A network error: revisit step 3. Check the rule file, restart the app, and make sure the prompt says
publishport, notnpx. - LinkedIn says you’re signed out: sign in again under Platform accounts; tomorrow’s run picks it up.
- The AI stopped asking for confirmation: the prompt must state that this is a pre-approved task; re-read step 4.
- Replies feel samey: add three more real replies to
voice.md. Variety comes from examples. - A comment was missed: comments that are already replies to someone else are skipped on purpose. Ask the AI to include them if you want.
Make it yours
- Narrower auto-send: change rule 3 so only comments of five words or fewer count as SAFE.
- No auto-send at all: remove rule 4. You get the same queue and decide on everything.
- Close the loop: pair this with the weekly analytics review so the posts that draw questions inform next week’s plan, or see more on automated replies and where to draw the line.
- Posting itself: the LinkedIn weekly cadence recipe handles the posts these comments come from.
The free plan covers setting all of this up; plan limits and pricing are on the pricing page.
