CLI wrapper for the BlogIn REST API. Designed for easy use by AI agents — all output is JSON, commands are predictable, and help text is thorough.
npm install
npm link # makes `blogin` available globallySet your API key as an environment variable or in a .env file:
export BLOGIN_API_KEY=your_api_key_hereThe CLI also reads from ../.env.local (parent directory) automatically.
All requests use Bearer token auth via the BLOGIN_API_KEY environment variable. Generate an API key in BlogIn Settings > API tab.
blogin <resource> <action> [options]
All commands output JSON to stdout. Errors output JSON to stderr with the API error code.
blogin members list [--page N] [--limit N] [--sort FIELD]
blogin members get <id>
blogin members create --email <email> --username <username> [--name <name>] [--surname <surname>] [--access-level <level>] [--job-title <title>] [--phone <phone>]
blogin members update <id> [--email <email>] [--username <username>] [--name <name>] [--surname <surname>] [--access-level <level>] [--job-title <title>] [--phone <phone>]
blogin members delete <id>
blogin members deactivate <id>
blogin members activate <id>
blogin members posts <id> [--page N] [--limit N] [--sort FIELD]
blogin members teams <id>
blogin members assign-team <memberId> <teamId>
blogin members remove-team <memberId> <teamId>blogin posts list [--page N] [--limit N] [--sort FIELD] [--author <id>]
blogin posts get <id>
blogin posts create --title <title> --text <html> --author-id <id> [--published true|false] [--wiki] [--important] [--pinned] [--comments-disabled]
blogin posts update <id> [--title <title>] [--text <html>] [--author-id <id>] [--published true|false] [--wiki] [--important] [--pinned] [--comments-disabled]
blogin posts delete <id>
blogin posts tags <id>blogin comments list <postId> [--page N] [--limit N] [--sort FIELD]
blogin comments create <postId> --text <html> --author-id <id> [--parent <commentId>]
blogin comments update <postId> <commentId> --text <html> [--author-id <id>]
blogin comments delete <postId> <commentId>blogin pages list [--page N] [--limit N] [--sort FIELD]
blogin pages get <id>
blogin pages create --title <title> --author-id <id> [--text <html>] [--published true|false] [--position N]
blogin pages update <id> [--title <title>] [--text <html>] [--author-id <id>] [--published true|false] [--position N]
blogin pages delete <id>blogin categories list [--page N] [--limit N] [--sort FIELD]
blogin categories get <id>
blogin categories create --name <name> [--parent <id>] [--position N] [--locked]
blogin categories update <id> [--name <name>] [--parent <id>] [--position N] [--locked]
blogin categories delete <id>
blogin categories posts <id> [--page N] [--limit N] [--sort FIELD]
blogin categories followers <id> [--page N] [--limit N] [--sort FIELD]blogin tags list [--page N] [--limit N] [--sort FIELD]
blogin tags get <id>blogin teams list [--page N] [--limit N] [--sort FIELD]
blogin teams get <id>
blogin teams create --name <name> [--position N] [--locked]
blogin teams update <id> [--name <name>] [--position N] [--locked]
blogin teams delete <id>blogin search <terms> [--page N] [--limit N] [--sort FIELD] [--comments] [--pages]blogin stats posts [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--page N] [--limit N] [--sort FIELD]
blogin stats members [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--page N] [--limit N] [--sort FIELD]All list commands support pagination:
--page N— page number (default: 1)--limit N— results per page (min: 10, max: 100, default: 10)--sort FIELD— sort field, prefix with-for descending (e.g.,-date_published)
Response includes a meta.pagination object with total, count, per_page, current_page, total_pages, and links.
All successful responses are JSON objects with a data field (array for lists, object for single items) and a meta field for pagination info.
{
"data": [...],
"meta": {
"pagination": {
"total": 148,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 15
}
}
}Errors output JSON to stderr with status code and message:
{
"status": 404,
"error": {
"message": "Resource not found",
"code": 404
}
}| Code | Meaning |
|---|---|
| 400 | Invalid request |
| 401 | Invalid API key |
| 403 | Admin-only resource |
| 404 | Resource not found |
| 405 | Invalid HTTP method |
| 429 | Rate limit (10 req/sec) |
| 500 | Server error |
Base URL: https://blogin.co/api/rest/
Full docs: https://blogin.co/api/rest/docs/
Copy-paste the section below into a conversation with an AI agent to get it up to speed on using BlogIn through this CLI.
BlogIn (https://blogin.co) is an internal company blog platform. Teams use it to share updates, announcements, recaps, and knowledge with the rest of the organization. Think of it as a structured, searchable internal newsletter — posts are organized by categories (e.g., "Monthly Recap", "Engineering", "Sales") and teams, and people can comment and vote on posts.
Key concepts:
- Posts are the main content. They have an author, HTML body, categories, tags, and can be pinned/important/wiki.
- Members are people in the organization. Each has a role, teams, and activity history.
- Categories organize posts by topic (e.g., "Product", "Customer Success", "Monthly Recap").
- Teams represent departments or groups (e.g., "Engineering", "Marketing").
- Tags are freeform labels on posts.
- Pages are static wiki-style content (like a "Blog Guidelines" page).
- Comments are threaded discussions on posts.
The blogin CLI is installed at the repo blogin-cli. To set it up:
cd blogin-cli
npm install
npm linkIt needs a BLOGIN_API_KEY environment variable. Check for it in:
- A
.envfile in theblogin-cli/directory - A
.env.localfile in the parent directory
Once set up, verify it works by running:
blogin members listYou should get back a JSON response with member data.
Every command follows the pattern blogin <resource> <action> [options] and returns JSON. Run blogin --help to see all resources, or blogin <resource> --help to see actions for a resource.
Quick orientation commands to understand the blog:
# See what categories exist
blogin categories list
# See what teams exist
blogin teams list
# See recent posts
blogin posts list
# Read a specific post
blogin posts get <id>
# See comments on a post
blogin comments list <postId>
# Search for something
blogin search "quarterly update"
# See who's been active
blogin stats members --start-date 2026-01-01All list commands support --page N, --limit N (min 10, max 100), and --sort FIELD (prefix with - for descending, e.g., -date_published).
Post bodies use HTML for the --text field when creating or updating.
To use BlogIn effectively on someone's behalf, you should understand their context. Ask the user:
- What do you use BlogIn for? (e.g., writing monthly recaps, reading company updates, tracking team activity, managing members)
- What are you trying to accomplish right now? (e.g., "draft this month's engineering recap", "summarize what the sales team posted last quarter", "find all posts about a specific topic")
- What is your member ID or username? (needed if you'll be creating posts or comments on their behalf — you can look it up with
blogin members list) - Are there specific categories or teams you care about? (helps you filter results instead of pulling everything)
- Should posts be published immediately or saved as drafts? (when creating content,
--published truemakes it live right away)