KosmoKrator

data

Reddit CLI for AI Agents

Use the Reddit CLI from KosmoKrator to call Reddit tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

9 functions 7 read 2 write Manual OAuth token auth

Reddit CLI Setup

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 --json
kosmokrator integrations:doctor reddit --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
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.

kosmo integrations:call reddit.reddit_create_comment '{
  "parent": "example_parent",
  "text": "example_text"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:reddit reddit_create_comment '{
  "parent": "example_parent",
  "text": "example_text"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs reddit --json
kosmo integrations:docs reddit.reddit_create_comment --json
kosmo integrations:schema reddit.reddit_create_comment --json
kosmo integrations:search "Reddit" --json
kosmo integrations:list --json

All CLI Functions

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.

Parameters
parent, text

Generic CLI call

kosmo integrations:call reddit.reddit_create_comment '{"parent":"example_parent","text":"example_text"}' --json

Provider shortcut

kosmo integrations:reddit reddit_create_comment '{"parent":"example_parent","text":"example_text"}' --json

reddit.reddit_create_post

Write write

Submit a new post to a subreddit. Supports text (self), link, image, and video post types.

Parameters
subreddit, title, kind, text, url, nsfw, spoiler

Generic CLI call

kosmo integrations:call reddit.reddit_create_post '{"subreddit":"example_subreddit","title":"example_title","kind":"example_kind","text":"example_text","url":"example_url","nsfw":true,"spoiler":true}' --json

Provider shortcut

kosmo integrations:reddit reddit_create_post '{"subreddit":"example_subreddit","title":"example_title","kind":"example_kind","text":"example_text","url":"example_url","nsfw":true,"spoiler":true}' --json

reddit.reddit_get_current_user

Read read

Get the profile of the currently authenticated Reddit user. Useful for verifying credentials and displaying account information.

Parameters
none

Generic CLI call

kosmo integrations:call reddit.reddit_get_current_user '{}' --json

Provider shortcut

kosmo integrations:reddit reddit_get_current_user '{}' --json

reddit.reddit_get_post

Read read

Get details for a specific Reddit post by subreddit and post ID. Returns the post listing and its top-level comments.

Parameters
subreddit, post_id

Generic CLI call

kosmo integrations:call reddit.reddit_get_post '{"subreddit":"example_subreddit","post_id":"example_post_id"}' --json

Provider shortcut

kosmo integrations:reddit reddit_get_post '{"subreddit":"example_subreddit","post_id":"example_post_id"}' --json

reddit.reddit_get_subreddit

Read read

Get information about a specific subreddit including subscriber count, description, and settings.

Parameters
subreddit

Generic CLI call

kosmo integrations:call reddit.reddit_get_subreddit '{"subreddit":"example_subreddit"}' --json

Provider shortcut

kosmo integrations:reddit reddit_get_subreddit '{"subreddit":"example_subreddit"}' --json

reddit.reddit_list_comments

Read read

List comments for a specific Reddit post. Supports sorting (best, top, new, controversial, old, q&a) and depth limiting.

Parameters
subreddit, post_id, limit, sort, depth

Generic CLI call

kosmo integrations:call reddit.reddit_list_comments '{"subreddit":"example_subreddit","post_id":"example_post_id","limit":1,"sort":"example_sort","depth":1}' --json

Provider shortcut

kosmo integrations:reddit reddit_list_comments '{"subreddit":"example_subreddit","post_id":"example_post_id","limit":1,"sort":"example_sort","depth":1}' --json

reddit.reddit_list_posts

Read read

List posts from a subreddit or the Reddit front page. Supports hot, new, top, rising, and controversial sorting with pagination via after/before cursors.

Parameters
subreddit, sort, limit, after, before

Generic CLI call

kosmo integrations:call reddit.reddit_list_posts '{"subreddit":"example_subreddit","sort":"example_sort","limit":1,"after":"example_after","before":"example_before"}' --json

Provider shortcut

kosmo integrations:reddit reddit_list_posts '{"subreddit":"example_subreddit","sort":"example_sort","limit":1,"after":"example_after","before":"example_before"}' --json

reddit.reddit_list_subreddits

Read read

List popular or new subreddits. Supports pagination with after/before cursors.

Parameters
sort, limit, after, before

Generic CLI call

kosmo integrations:call reddit.reddit_list_subreddits '{"sort":"example_sort","limit":1,"after":"example_after","before":"example_before"}' --json

Provider shortcut

kosmo integrations:reddit reddit_list_subreddits '{"sort":"example_sort","limit":1,"after":"example_after","before":"example_before"}' --json

Function Schemas

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.

Operation
Write write
Schema command
kosmo integrations:schema reddit.reddit_create_comment --json
ParameterTypeRequiredDescription
parent string yes The fullname of the thing to comment on. Use "t3_{post_id}" to comment on a post, or "t1_{comment_id}" to reply to a comment.
text string yes The comment body. Supports Markdown formatting.

reddit.reddit_create_post

Submit a new post to a subreddit. Supports text (self), link, image, and video post types.

Operation
Write write
Schema command
kosmo integrations:schema reddit.reddit_create_post --json
ParameterTypeRequiredDescription
subreddit string yes Subreddit name (without r/ prefix).
title string yes Post title.
kind string no Post type: self (text), link, image, or video (default: self).
text string no Post body text (for self/text posts). Supports Markdown.
url string no URL (required for link posts).
nsfw boolean no Whether the post is NSFW (default: false).
spoiler boolean no Whether the post is a spoiler (default: false).

reddit.reddit_get_current_user

Get the profile of the currently authenticated Reddit user. Useful for verifying credentials and displaying account information.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

reddit.reddit_get_post

Get details for a specific Reddit post by subreddit and post ID. Returns the post listing and its top-level comments.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_get_post --json
ParameterTypeRequiredDescription
subreddit string yes Subreddit name (without r/ prefix).
post_id string yes The base36 post ID (e.g., "abc123").

reddit.reddit_get_subreddit

Get information about a specific subreddit including subscriber count, description, and settings.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_get_subreddit --json
ParameterTypeRequiredDescription
subreddit string yes Subreddit name (without r/ prefix).

reddit.reddit_list_comments

List comments for a specific Reddit post. Supports sorting (best, top, new, controversial, old, q&a) and depth limiting.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_list_comments --json
ParameterTypeRequiredDescription
subreddit string yes Subreddit name (without r/ prefix).
post_id string yes The base36 post ID (e.g., "abc123").
limit integer no Maximum number of comments to return (default: 25, max: 100).
sort string no Comment sort order: best, top, new, controversial, old, q&a (default: best).
depth integer no Maximum comment depth (default: unlimited).

reddit.reddit_list_posts

List posts from a subreddit or the Reddit front page. Supports hot, new, top, rising, and controversial sorting with pagination via after/before cursors.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_list_posts --json
ParameterTypeRequiredDescription
subreddit string no Subreddit name (without r/ prefix). Leave empty for front page.
sort string no Sort method: hot, new, top, rising, controversial (default: hot).
limit integer no Number of posts to return (default: 25, max: 100).
after string no Fullname of a post to fetch results after (for pagination).
before string no Fullname of a post to fetch results before (for pagination).

reddit.reddit_list_subreddits

List popular or new subreddits. Supports pagination with after/before cursors.

Operation
Read read
Schema command
kosmo integrations:schema reddit.reddit_list_subreddits --json
ParameterTypeRequiredDescription
sort string no Sort method: popular or new (default: popular).
limit integer no Number of subreddits to return (default: 25, max: 100).
after string no Fullname of a subreddit to fetch results after (for pagination).
before string no Fullname of a subreddit to fetch results before (for pagination).

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.