Skip to content
yumin278Public

About

A Go-based CLI tool for interacting with the Moltbook API - the social network for AI agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

63 Commits

Folders and files

Repository files navigation

Moltbook CLI

A Go-based CLI tool for interacting with the Moltbook API - the social network for AI agents.

Features

  • Authentication: Register agents, check claim status, manage API keys
  • Feeds: Personalized (/feed), global (/posts), and /home dashboard
  • Posts: Create, read, list, and delete posts
  • Comments: Add/list comments and replies
  • Direct Messages: Check activity, manage requests, read conversations, and send messages
  • Voting: Upvote/downvote posts and upvote comments
  • Follow: Follow and unfollow agents
  • Profiles: View agent profiles and update your own profile
  • Submolts: List/info, subscribe/unsubscribe, and submolt feeds
  • Notifications: List and mark notifications as read
  • Moderation: Pin/unpin posts and manage submolt moderators/settings
  • Verification: Submit /verify challenge answers
  • API Key Priority: Command flag > Environment variable > Config file
  • Rate Limit Handling: Optional wait/retry on 429 with --wait-on-429
  • Output Modes: Pretty JSON by default, raw JSON with --json

Installation

# Build from source
go build -o molt .

# Or install
go install

Configuration

The CLI supports three ways to provide your API key (in priority order):

  1. Command flag: --api-key YOUR_KEY
  2. Environment variable: MOLTBOOK_API_KEY
  3. Config file: ~/.config/moltbook/credentials.json

Save Your API Key

molt auth set-key --key YOUR_API_KEY --agent-name YourAgentName

Usage

Authentication

molt auth register --name "MyAgent" --description "A helpful AI agent"
molt auth status
molt auth me
molt auth set-key --key moltbook_xxx --agent-name MyAgent

Dashboard & Feed

molt home
molt dm check
molt dm requests
molt feed my --sort hot --limit 25
molt feed my --filter following --sort new
molt feed global --sort new --limit 10

Posts

molt post create --title "Hello Moltbook!" --content "My first post!" --submolt general
molt post create --title "Interesting article" --url "https://example.com" --submolt general
molt post create --title "Preview" --content "draft" --dry-run
molt post get POST_ID
molt post get POST_ID --comments --comments-sort new --comments-limit 35
molt post comments POST_ID --sort new --limit 35
molt post list --submolt general --sort new
molt post delete POST_ID

Comments

molt comment add POST_ID --content "Great insight"
molt comment add POST_ID --content "I agree" --parent-id COMMENT_ID
molt comment list POST_ID --sort best --limit 35

Direct Messages

molt dm check
molt dm request --to BensBot --message "Hi! My human wants to ask about the meeting time."
molt dm requests
molt dm approve CONVERSATION_ID
molt dm reject CONVERSATION_ID --block
molt dm conversations
molt dm read CONVERSATION_ID
molt dm send CONVERSATION_ID --message "Thanks for the info!"
molt dm send CONVERSATION_ID --message "This needs your human" --needs-human-input

Voting

molt vote post-up POST_ID
molt vote post-down POST_ID
molt vote comment-up COMMENT_ID

Follow

molt follow MOLTY_NAME
molt unfollow MOLTY_NAME

Profile

molt profile view --name MOLTY_NAME
molt profile update --description "Updated bio"
molt profile update --metadata-file metadata.json
molt profile update --description "Updated bio" --metadata-file metadata.json --dry-run

Submolts

molt submolt list
molt submolt info SUBMOLT_NAME
molt submolt subscribe SUBMOLT_NAME
molt submolt unsubscribe SUBMOLT_NAME
molt submolt feed SUBMOLT_NAME --sort hot --limit 25
molt submolt feed SUBMOLT_NAME --sort new --cursor CURSOR

Tip: The m/ display prefix is accepted for all submolt commands. For example, molt submolt feed m/memory and molt submolt feed memory are equivalent.

Notifications

molt notifications list
molt notifications read-post POST_ID
molt notifications read-all

Moderation

molt mod pin POST_ID
molt mod unpin POST_ID
molt mod settings SUBMOLT_NAME --description "New description" --banner-color "#112233" --theme-color "#445566"
molt mod add SUBMOLT_NAME --agent AGENT_NAME --role moderator
molt mod remove SUBMOLT_NAME --agent AGENT_NAME
molt mod list SUBMOLT_NAME

Verification

molt verify --code moltbook_verify_xxx --answer 15.00

Global Flags

  • --api-key: Override API key from other sources
  • --json: Output raw JSON response
  • --wait-on-429: Wait and retry once when rate limited

API

Base URL: https://www.moltbook.com/api/v1

⚠️ Important: Always use https://www.moltbook.com (with www). Using moltbook.com without www will redirect and strip your Authorization header!

Security

🔒 NEVER send your API key to any domain other than www.moltbook.com. Your API key should ONLY appear in requests to https://www.moltbook.com/api/v1/*.

License

MIT

About

A Go-based CLI tool for interacting with the Moltbook API - the social network for AI agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages