Automatically upload local images in Markdown files to a server and replace local paths with public URLs.
- 🔍 Automatically detects local images in Markdown files
- 📤 Uploads images to a configured server endpoint or Google Cloud Storage
- 🔄 Replaces local paths with public URLs
- ⚡ Supports concurrent uploads with progress display
- 🔐 Basic authentication support for API backend
- ☁️ Direct Google Cloud Storage integration
- 🎯 Configurable via JSON file or environment variables
pip install .Or install in development mode:
pip install -e .Basic usage:
omelet buildmarkdown ./readme.mdThis will:
- Scan the markdown file for local images (e.g.,
) - Upload each image to the configured server
- Replace local paths with the returned public URLs
- Update the original markdown file
Omelet can be configured via:
Create .omelet.json in your home directory or current working directory:
{
"backend_url": "https://your-backend-url.com/webhook",
"username": "your-username",
"password": "your-password",
"use_gcs": false,
"gcs_bucket": "your-bucket-name"
}export OMELET_USERNAME="your-username"
export OMELET_PASSWORD="your-password"
export OMELET_USE_GCS="true" # Set to "true" to use Google Cloud Storage
export OMELET_GCS_BUCKET="your-bucket-name"To use Google Cloud Storage instead of the API backend:
Omelet uses your existing gcloud CLI authentication. Make sure you're authenticated:
# Authenticate with gcloud CLI
gcloud auth application-default loginSet in configuration file:
{
"use_gcs": true,
"gcs_bucket": "your-bucket-name"
}Or use environment variable:
export OMELET_USE_GCS="true"
export OMELET_GCS_BUCKET="your-bucket-name"Run omelet on a markdown file:
omelet buildmarkdown ./readme.mdThe tool will upload images to: gs://your-bucket-name/public/blog/{folder}/{filename}
The upload endpoint should:
- Accept POST requests with
multipart/form-data - Expect fields:
data: The image file (binary)folder: The folder name (taken from the markdown file's parent directory)
- Support Basic Authentication (if configured)
- Return JSON response:
{ "public_url": "https://example.com/path/to/uploaded-image.png" }
Before:
# My Article

Some content here...
After:
# My Article

Some content here...
- PNG
- JPG/JPEG
- GIF
- SVG
- WebP
- BMP
- ICO
- Non-existent image files are reported but don't stop processing
- Failed uploads are logged with error messages
- Original paths are preserved if upload fails
- The tool continues processing remaining images even if some fail
Install development dependencies:
pip install -e ".[dev]"Run tests:
pytestNguyen Anh Binh
Email: socrat.nguyeannhbinh@gmail.com
Website: omelet.tech
MIT License - see LICENSE file for details