Skip to content

feat: add reddit post command#1247

Draft
xiaohei-info wants to merge 1 commit intojackwener:mainfrom
xiaohei-info:feat/reddit-post-flair-commit
Draft

feat: add reddit post command#1247
xiaohei-info wants to merge 1 commit intojackwener:mainfrom
xiaohei-info:feat/reddit-post-flair-commit

Conversation

@xiaohei-info
Copy link
Copy Markdown

Summary

  • add a new opencli reddit post browser command for creating text posts via Reddit's web composer
  • handle Reddit flair commit against the real composer form instead of only trusting staged UI state
  • add adapter coverage for success/failure plumbing and update docs + manifest

Why

Upstream already ships several Reddit browser commands, but it does not currently expose reddit post.

In live debugging against Reddit's current web composer, the tricky failure mode was not simple button clicking or backend/network failure. The submit pipeline could reach Reddit's internal onPostSubmit -> getRecaptchaToken -> checkSubredditRuleViolations -> submitPostForm path and still no-op because flair looked selected in the UI while the real composer form still considered flair invalid.

This patch adds a text-post command and commits flair against the actual composer form registry so the submit path can proceed.

What changed

  • add clis/reddit/post.js
  • add clis/reddit/post.test.js
  • regenerate cli-manifest.json
  • document reddit post in the Reddit adapter docs and adapter index

Verification

Ran locally in the upstream repo:

npx vitest run clis/reddit/post.test.js clis/reddit/read.test.js --project adapter
node dist/src/main.js reddit --help

Results:

  • clis/reddit/read.test.js passed
  • clis/reddit/post.test.js passed
  • built CLI help shows:
    • post [options] <subreddit> <title> <text> Create a text post in a subreddit via the Reddit web composer

Additional real-world validation before porting upstream:

  • the same posting logic was exercised against a live logged-in Reddit session on r/AI_Agents
  • a real text post was created successfully after fixing the flair commit path

Notes

  • this keeps the scope intentionally narrow: text-post creation only
  • it avoids adding local-only debug screenshot side effects to the upstream repo
  • flair handling is conservative because Reddit's web composer uses custom elements and a real composer form registry instead of a simple native form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant