9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
93 lines
3.3 KiB
Markdown
93 lines
3.3 KiB
Markdown
# Reddit
|
|
|
|
**Mode**: 🔐 Browser · **Domain**: `reddit.com`
|
|
|
|
## Commands
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `opencli reddit hot` | Hot posts from a subreddit (or frontpage if none) |
|
|
| `opencli reddit frontpage` | Frontpage / r/all listing |
|
|
| `opencli reddit home` | **Personalized Best feed (requires login)** |
|
|
| `opencli reddit popular` | Trending posts on /r/popular |
|
|
| `opencli reddit search` | Search posts |
|
|
| `opencli reddit subreddit` | Posts from a specific subreddit, with sort and time filters |
|
|
| `opencli reddit subreddit-info` | **Subreddit metadata (subscribers, active, NSFW, created, description)** |
|
|
| `opencli reddit read` | Read a post thread with comments |
|
|
| `opencli reddit user` | View a user profile |
|
|
| `opencli reddit user-posts` | A user's submitted posts |
|
|
| `opencli reddit user-comments` | A user's comments |
|
|
| `opencli reddit whoami` | **Show the currently logged-in Reddit identity** |
|
|
| `opencli reddit upvote` | Vote on a post or comment |
|
|
| `opencli reddit save` | Save / unsave a post or comment |
|
|
| `opencli reddit comment` | Comment on a post |
|
|
| `opencli reddit reply` | Reply to a comment |
|
|
| `opencli reddit subscribe` | Join / leave a subreddit |
|
|
| `opencli reddit subscribed` | List subreddits you are subscribed to |
|
|
| `opencli reddit saved` | List your saved items |
|
|
| `opencli reddit upvoted` | List your upvoted posts |
|
|
|
|
## Usage Examples
|
|
|
|
```bash
|
|
# Quick start
|
|
opencli reddit hot --limit 5
|
|
|
|
# Read one subreddit
|
|
opencli reddit subreddit python --limit 10
|
|
|
|
# Subreddit metadata (subscribers / active / NSFW / created / description)
|
|
opencli reddit subreddit-info AskReddit
|
|
|
|
# Personalized Best feed (requires login)
|
|
opencli reddit home --limit 10
|
|
|
|
# Who am I logged in as?
|
|
opencli reddit whoami
|
|
|
|
# Subscribed subreddits (requires login)
|
|
opencli reddit subscribed --limit 50
|
|
|
|
# Read a post thread
|
|
opencli reddit read 1abc123 --depth 2
|
|
|
|
# Read with "more comments" expansion via /api/morechildren.json
|
|
opencli reddit read 1abc123 --depth 3 --expand-more --expand-rounds 3
|
|
|
|
# Comment on a post
|
|
opencli reddit comment 1abc123 "Great post"
|
|
|
|
# Reply to a comment
|
|
opencli reddit reply okf3s7u "Thanks for the context"
|
|
|
|
# JSON output
|
|
opencli reddit hot -f json
|
|
|
|
# Verbose mode
|
|
opencli reddit hot -v
|
|
```
|
|
|
|
## Auth-required commands
|
|
|
|
`whoami`, `home`, `subscribed`, `saved`, `upvoted`, `subscribe`, `upvote`,
|
|
`save`, `comment`, and `reply` all require a logged-in `reddit.com` cookie session. When the
|
|
session is missing or expired they raise `AuthRequiredError` (exit code 5)
|
|
instead of silently returning empty rows.
|
|
|
|
For `subreddit-info`, missing / banned / private / quarantined subreddits raise
|
|
`EmptyResultError` (exit code 6) so the output table never contains a silent
|
|
sentinel row.
|
|
|
|
For `read`, deleted / quarantined / private posts (HTTP 401/403/404 on
|
|
`/comments/<id>.json`) also raise `EmptyResultError`. `--expand-more` follows
|
|
Reddit's "more comments" stubs by calling `/api/morechildren.json` up to
|
|
`--expand-rounds` times (default 2, max 5). If the morechildren endpoint
|
|
itself rejects the request with 401/403, that's surfaced as
|
|
`AuthRequiredError` because writeable/expand endpoints often require a logged-
|
|
in session even though the post listing is public.
|
|
|
|
## Prerequisites
|
|
|
|
- Chrome running and **logged into** reddit.com
|
|
- [Browser Bridge extension](/guide/browser-bridge) installed
|