You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Star0 (0)You must be signed in to star a repository
About
CLI tool for frontmatter‑based content management. Extracts metadata from Markdown, generates search‑ready JSON indexes, and simplifies article management with a minimal workflow.
A minimal CLI for personal content management based on Markdown. Create, build, and publish content on your own stack.
Commands
Command
Description
brite init
Generates a default brite.json in the current directory. Fails if one already exists.
brite setup
Creates the directories defined in brite.json (subdirectories under articleDir and imageDir).
brite new
Interactively creates a new Markdown article with front matter under articleDir. You will be prompted for a title, category, and tags. The slug is auto-generated as a UUID (cannot be entered manually), and the date is automatically set to the current datetime.
brite convert
Reads brite.json, scans .md files in articleDir, parses their front matter, and writes three JSON files (all / category / tag) to outputDir. Articles with unregistered categories or tags are skipped with a notification.
brite publish
Uploads changed images to Cloudflare R2 (diffs are tracked via .caches.json), then uploads the output JSON files to R2 as well. Requires the environment variables R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_ENDPOINT, and ENABLE_PATH_STYLE_ENDPOINTS. (Not required if you place the binary directly on the host PC or inside a Dev Container without using S3-compatible storage.)
Quick Start
# 1. Initialize the config file
brite init
# 2. Create directories
brite setup
# 3. Create a new article (interactive)
brite new
# 4. Output JSON
brite convert
# 5. Publish to R2
brite publish
Config File: brite.json
Field
Description
Required
articleDir
Directory where .md files are stored
true
imageDir
Root directory for storing images
true
outputDir
Output path for generated JSON files
true
cacheDir
Directory where cache files (.caches.json) are stored
true
categories
Whitelist of allowed categories
true
tags
Whitelist of allowed tags
true
r2.bucketName
R2 bucket name
false
r2.baseUrl
Base URL for image delivery (e.g. https://assets.your-domain.com)
Image uploads are incremental — only added, modified, or deleted files are synced to R2. Diff state is managed in .caches.json; committing this file ensures correct diff detection even in CI environments.
Output JSON files are fully re-uploaded on every publish.
Uploaded files are served with Cache-Control: public, max-age=31536000, immutable to maximize CDN caching and minimize R2 read costs.
Cloudflare R2 is the recommended storage backend (free tier: 10 GB storage, 1M writes/month, no egress fees). Any S3-compatible storage can be used by changing R2_ENDPOINT.
About
CLI tool for frontmatter‑based content management. Extracts metadata from Markdown, generates search‑ready JSON indexes, and simplifies article management with a minimal workflow.