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 \
  --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"

# 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.0.tar.gz (7.5 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.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blog_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 7.5 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.0.tar.gz
Algorithm Hash digest
SHA256 ce41ff13bcfb09792b1f4392d4b2d0a1eb3cab975ed1f6eca382b87a01eddd90
MD5 0f4aabb4ea8e236200f5e861406f5ed4
BLAKE2b-256 17e05ddf5ae40b91923de6de7566bedff99bd1725df8dfd16eccabfaec374381

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blog_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2cdaa9bf03353e11359c32dea88052245f102bfc077f34701c531805d4e927e
MD5 e0c8bd182a69ac1148a08ed1f49e3637
BLAKE2b-256 b87012c653f4bcb152cc1a88dc07385c5d0ff10d12412e9d1e6982a0d97886ae

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