Use the Reddit CLI from KosmoKrator to call Reddit tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Reddit can be configured headlessly with `kosmokrator integrations:configure reddit`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure reddit --set access_token="$REDDIT_ACCESS_TOKEN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor reddit --jsonkosmokrator integrations:status --json
Credentials
Authentication type: Manual OAuth tokenoauth2_manual_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
access_token
REDDIT_ACCESS_TOKEN
Secret secret
yes
Access Token
url
REDDIT_URL
URL url
no
API Base URL
Call Reddit Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Reddit.
reddit.reddit_create_comment
Write write
Post a comment on a Reddit post or reply to an existing comment. The comment body supports Markdown formatting. Use "t3_" prefix for post IDs or "t1_" prefix for comment IDs as the parent.
List posts from a subreddit or the Reddit front page. Supports hot, new, top, rising, and controversial sorting with pagination via after/before cursors.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
reddit.reddit_create_comment
Post a comment on a Reddit post or reply to an existing comment. The comment body supports Markdown formatting. Use "t3_" prefix for post IDs or "t1_" prefix for comment IDs as the parent.
List posts from a subreddit or the Reddit front page. Supports hot, new, top, rising, and controversial sorting with pagination via after/before cursors.
Result type: "link" (posts), "sr" (subreddits), "user", or comma-separated combinations. Default: "link".
sort
string
no
Sort order: "relevance", "hot", "top", "new", or "comments". Default: "relevance".
time
string
no
Time range: "hour", "day", "week", "month", "year", or "all". Default: "all".
limit
integer
no
Maximum number of results (default: 25, max: 100).
after
string
no
Pagination cursor — fullname of the last result from a previous response.
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.