Skip to main content

Agent-friendly CLI for managing a blog. Create drafts, upload media, generate time-limited preview links.

Project description

blog-cli

Agent-friendly CLI for managing a personal blog. Create drafts, upload media, generate time-limited preview links — all from the command line.

Designed for use by both humans and AI agents.

Install

pip install blog-cli

Or via pipx/uv:

pipx install blog-cli
uv tool install blog-cli

For development:

git clone https://github.com/tanaka-mambinge/personal-cli
cd personal-cli
uv sync --extra dev

Configure

All three are required:

export PERSONAL_SERVER_URL="<your-server-url>"
export PERSONAL_API_KEY="<your-api-key>"
export PERSONAL_SITE_URL="<your-site-url>"

Usage

Articles

# Create a draft
blog-cli article create \
  --title "My Post" \
  --description "A short summary" \
  --type blog \
  --cover-image my-post-cover \
  --markdown "# My Post\n\nHello."

# List published blog posts
blog-cli article list --type blog

# Show an article
blog-cli article show my-post

# Update an article
blog-cli article update my-post --title "Better Title"

# Set or clear the cover image
blog-cli article update my-post --cover-image my-post-cover
blog-cli article update my-post --clear-cover-image

# Generate a 24h preview link for a draft
blog-cli article preview my-post

# Custom TTL (1–168 hours)
blog-cli article preview my-post --ttl-hours 4

# Publish
blog-cli article publish my-post --published-by agent

# Delete (soft)
blog-cli article delete my-post

# Unarchive (restore deleted)
blog-cli article unarchive my-post

All commands support --json for machine-readable output and --server-url to override the server.

Media

# Upload (name is the unique key used in markdown)
blog-cli media upload --name hero-image ./hero.jpg

# Update (replace the file, keep the name)
blog-cli media update --name hero-image ./new-hero.jpg

# Delete (soft)
blog-cli media delete --name hero-image

Markdown Image References

Upload media with a name, then reference it in article markdown:

![Hero image](hero-image)

<video controls width="100%" src="ambulance-video"></video>

The site resolves these to full URLs automatically.

Testing

uv run pytest -v

Spins up a temp MongoDB + server via test fixtures. No external deps needed.

Architecture

CLI (httpx) → FastAPI server → Motor/GridFS → MongoDB
  • Public endpoints (GET) — list and read published articles, download media
  • Protected endpoints (POST/PATCH/PUT/DELETE) — require Authorization: Bearer <key>

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blog_cli-0.2.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blog_cli-0.2.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file blog_cli-0.2.2.tar.gz.

File metadata

  • Download URL: blog_cli-0.2.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Nobara Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for blog_cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5443f0047affd0f9d4962a4d0a1289c4b291c7a3ec351af527537eebf7f2c576
MD5 065de2b82484258a31923c004ee97d8a
BLAKE2b-256 a3db4158ca6e784d8c670e5a74d019ca5928ea1844ce5b34516fb23a8f0ce73f

See more details on using hashes here.

File details

Details for the file blog_cli-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: blog_cli-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Nobara Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for blog_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfa7dc686622b436b8485af24ffc27c18cf5e45ee60a4d07414c8cbfb74bd8ac
MD5 e02d8d3a801a22293fbe96e59774f7d1
BLAKE2b-256 82289465fac19e9c8f16438f8645f481d4509efca2ca74b6b11a123992bb2702

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page