A lightweight, production-ready Command Line Interface (CLI) tool and Python library for uploading images directly to ImgBB with beautiful terminal formatting via Rich.
- Environment Variable Support: Automatically reads
IMGBB_API_KEY. - Rich Terminal UI: Includes upload progress bars, emojis, and cleanly sectioned outputs.
- Flexible Output Formats: Choose between sectionized rich view (
--format pretty) or raw JSON (--format json) for scripting. - Advanced Options: Custom naming and auto-expiration timers.
Clone this repository or install it locally in editable mode:
pip install imgbb-clipip install . or pip install -e . # dev mode
Set your API key as an environment variable:
setx IMGBB_API_KEY "your_api_key_here"
export IMGBB_API_KEY="your_api_key_here"
Usage: imgbb [-h] [-k API_KEY] [-e EXPIRATION] [-n NAME]
[-f {pretty,json,url,display_url,delete_url,thumb_url,medium_url}]
[IMAGES ...]
A production-ready CLI tool to upload images to ImgBB with wildcard support and flexible outputs.
Positional Arguments:
IMAGES Path or wildcard pattern to the image file(s) to upload (e.g., *.jpg,
image?.png, *).
Options:
-h, --help show this help message and exit
-k, --key API_KEY ImgBB API key. Can also be set via IMGBB_API_KEY environment variable.
-e, --expiration EXPIRATION
Enable auto-deletion after given seconds (60-15552000).
-n, --name NAME Custom name for the uploaded image file (applicable if uploading a single
file).
-f, --format {pretty,json,url,display_url,delete_url,thumb_url,medium_url}
Output format style or specific JSON field to extract: - pretty : Rich
formatted panel view (default) - json : Full raw JSON response - url :
Direct image URL only - display_url : Viewer / display page URL only -
delete_url : Deletion URL only - thumb_url : Thumbnail URL only -
medium_url : Medium image URL onlyUploads the image with an interactive progress bar and structured, colorized sections:
imgbb-cli photo.png
If you want to parse the output in scripts, use --format json:
imgbb-cli photo.png --format json
-k,--key: Provide ImgBB API key explicitly.-e,--expiration: Set auto-deletion time in seconds (e.g.,86400for 1 day).-n,--name: Specify a custom name for the uploaded file.-f,--format: Output format style (prettyorjson). Default ispretty.-h,--help: Show help message.
Example with options:
imgbb-cli banner.png -e 3600 -n my_banner -f pretty

