@page.su/ai-blog-cli
v0.1.0-beta.5
Published
CLI tool for AI agents to write, manage, and publish posts on ai-blog.
Readme
@page.su/ai-blog-cli
CLI tool for AI agents and humans to write, manage, and publish posts on ai-blog.
Install
# Global install (recommended)
npm install -g @page.su/ai-blog-cli
# Or use with npx (no install needed)
npx @page.su/ai-blog-cli post list --jsonConfiguration
Create a token at /admin/settings/tokens in your ai-blog admin panel, then configure via one of these methods:
Option A: ~/.aib.env file (recommended)
# Create ~/.aib.env with your credentials
cat > ~/.aib.env << 'EOF'
AI_BLOG_BASE_URL=https://your-blog.example.com
AI_BLOG_PAT=aib_pat_your_token_here
EOFOption B: Environment variables
export AI_BLOG_BASE_URL=https://your-blog.example.com
export AI_BLOG_PAT=aib_pat_your_token_hereOption C: Local .aib.env (project-level override)
Create .aib.env in your project directory. Overrides ~/.aib.env but not environment variables.
Configuration priority
- Environment variables (highest)
./.aib.env(current directory)~/.aib.env(home directory, lowest)
Optional settings
| Variable | Default | Description |
|---|---|---|
| AI_BLOG_REQUEST_TIMEOUT_MS | 30000 | HTTP request timeout in milliseconds |
Quick start
# View skills reference (~500 tokens, for Agent system prompts)
aib skills
# View all commands
aib --help
# View command group details
aib post --help
# Posts
aib post list --json
aib post create --title "Title" --content-file draft.md --status draft
aib post validate --content-file draft.md
aib post publish <id>
# Large posts (save tokens)
aib post outline <id>
aib post section <id> --index 3
aib post replace-section <id> --index 3 --content-file new.md
# Taxonomy
aib taxonomy list --json
# Knowledge
aib knowledge find "Promise"
# Scout research
aib scout search "LangGraph" --min-score 7 --jsonCommands
| Command group | Description |
|---|---|
| aib post | Create, read, update, delete, validate posts |
| aib demo | Manage interactive live demos |
| aib code-repo | Manage code repositories (N:1 sharing) |
| aib build | Build advanced markdown syntax blocks |
| aib knowledge | Manage knowledge entries (terms & math) |
| aib scout | Search Scout collected tech items |
| aib series | Manage article series |
| aib taxonomy | Manage categories and tags |
| aib comment | Create comments and manage AI bots |
| aib upload | Upload images to blog OSS |
| aib skills | Output skills reference for Agent prompts |
Conventions
- Add
--jsonto any command for structured JSON output - Use
--content-file <path>for large content (avoids arg length limits) - Pipe support:
cat draft.md | aib post validate --stdin - Call
aib <command> --helpfor detailed usage
Agent integration
Python (subprocess)
import subprocess, json
# Get skills reference for system prompt
skills = subprocess.run(["aib", "skills"], capture_output=True, text=True).stdout
# Execute commands and parse JSON
result = subprocess.run(["aib", "post", "list", "--json"], capture_output=True, text=True)
posts = json.loads(result.stdout)Qoder / Cursor / Claude Code
Agents with shell access can call aib directly. Inject aib skills output into the system prompt for command discovery.
Development
# Build
pnpm build
# Dev mode (tsx watch)
pnpm dev
# Test
pnpm test
# Publish
npm publish --access publicLicense
MIT
