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.1.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.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blog_cli-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 97ed54530a892a854b0a45a46d299047c1e98c4f1c70f1a2eebebfd2eeba548c
MD5 02b62869e438a3464c29dc917caf7a18
BLAKE2b-256 6e7a26a216e51c9fcfcfcd496513fcb2aceb1a571c5b38d06fe63bfe85749b52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blog_cli-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60a88a38bea4a9e31e8ccbdc7857799cb8f623829107b5dd3ff47dde7a514ba1
MD5 4f354d408134756cdb059ef05f65cfa7
BLAKE2b-256 4fe23fb7866feccd19dfb57b4c79c18eb951d140ec1198ab4ad8aa166d3e6100

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