Chibi can render images inline in the terminal when the markdown
renderer is active. Images referenced in LLM responses (e.g.,
) are displayed using truecolor ANSI
escape codes, which work in most modern terminals.
- Local file paths (relative or absolute):
./diagram.png,/tmp/chart.jpg file://URLs:file:///home/user/image.png- Data URIs:
data:image/png;base64,... - HTTPS URLs:
https://example.com/photo.png - HTTP URLs (disabled by default):
http://example.com/photo.png— requiresallow_http = truein the[image]config section
Remote images (https:// and optionally http://) are fetched at
render time with the following safeguards:
- HTTPS only by default. Plain
http://URLs are rejected unlessallow_http = true. - Size limit. Downloads are capped at
max_download_bytes(default: 10 MB). BothContent-Lengthheaders and streamed body size are checked. - Timeout. Fetches time out after
fetch_timeout_seconds(default: 5 seconds). - Content-Type check. If the server provides a
Content-Typeheader, it must start withimage/. - Redirect safety. Up to 5 redirects are followed, but
HTTPS-to-HTTP downgrades are blocked (unless
image_allow_httpis enabled). - Fallback. If a remote fetch fails for any reason, the image falls back to the standard placeholder display — no error is shown to the user.
Image rendering is enabled by default. To disable it, set
render_images = false in your config:
Global (~/.chibi/config.toml):
[image]
render_images = falsePer-context (~/.chibi/contexts/<name>/local.toml):
[image]
render_images = false[image]
# Maximum bytes to download per image (default: 10485760 = 10 MB)
max_download_bytes = 10485760
# Timeout in seconds for each image fetch (default: 5)
fetch_timeout_seconds = 5
# Allow fetching images over plain HTTP (default: false)
allow_http = falseRemote images are cached locally to avoid re-fetching on log review,
compaction replay, or repeated renders. The cache lives at
~/.chibi/image_cache/ and is content-addressed by SHA-256 of the URL.
[image]
# Enable/disable image caching (default: true)
cache_enabled = true
# Maximum total cache size in bytes (default: 104857600 = 100 MB)
cache_max_bytes = 104857600
# Maximum age of cached images in days (default: 30)
cache_max_age_days = 30Eviction runs automatically after each command:
- Entries older than
cache_max_age_daysare removed first. - If total size still exceeds
cache_max_bytes, the least-recently-accessed entries are removed until under the limit.
Cache writes are best-effort — failures never block rendering.
[image]
# Maximum image height in terminal lines (default: 25)
max_height_lines = 25
# Percentage of terminal width to use for images (default: 80)
max_width_percent = 80
# Image alignment: "left", "center", or "right" (default: "center")
alignment = "center"[image]
# Image rendering mode (default: "auto")
# Options: "auto", "truecolor", "ansi", "ascii", "placeholder"
render_mode = "auto"
# Enable individual rendering modes (default: all enabled)
# These control which modes are available to "auto" detection
# and whether explicit mode selection works
enable_truecolor = true # 24-bit color (best quality)
enable_ansi = true # 16-color ANSI (compatible)
enable_ascii = true # ASCII art (universal)Mode descriptions:
-
auto(default) - Automatically detect terminal capabilities:- Checks
COLORTERMenvironment variable fortruecoloror24bit - Checks
TERMenvironment variable for color support level - Falls back through enabled modes: truecolor → ansi → ascii → placeholder
- Checks
-
truecolor- Force 24-bit (16.7M colors) ANSI rendering. Best quality but requires modern terminal support. Falls back to placeholder ifenable_truecolor = false. -
ansi- Force 16-color ANSI rendering. Compatible with most terminals since the 1990s. Lower quality than truecolor but universally supported. -
ascii- Force ASCII art rendering. Works in any terminal, including those without color support. Uses 8 characters to represent intensity:.,-~+=@ -
placeholder- Disable inline rendering entirely. Images show as[🖼 alt text]placeholders.
Disabling rendering modes:
Set any enable_* option to false to disable that mode. This affects
both auto-detection and explicit mode selection:
[image]
# Disable truecolor (useful for old terminals)
enable_truecolor = false
# Now auto mode will skip to ansi
render_mode = "auto"
# Or force a specific mode (ansi/ascii only)
render_mode = "ansi"If you explicitly select a disabled mode (e.g., render_mode = "truecolor" with enable_truecolor = false), chibi falls back to
auto-detection logic.
All settings can be overridden per-context in local.toml.
render_markdown = false(or the--rawCLI flag) disables the entire markdown rendering pipeline, which includes image rendering.render_imagesonly takes effect when the pipeline is active (i.e., stdout is a TTY and markdown rendering is enabled).
When image rendering is disabled or an image cannot be loaded (e.g.,
missing file, unsupported format, network error), the image falls back
to the standard placeholder: [🖼 alt text].
Alt text is only shown in this fallback placeholder. When the image is successfully rendered, alt text is omitted to avoid visual noise (it serves as a replacement for the image, not a caption).
Image rendering supports three modes with different compatibility levels:
Uses 24-bit (16.7M colors) ANSI escape codes. Supported by:
- kitty, iTerm2, WezTerm, Alacritty, Windows Terminal
- xterm (with
--enable-truecolor) - Most terminals from ~2016 onwards
Enable explicitly with render_mode = "truecolor" or rely on
auto-detection via COLORTERM and TERM environment variables.
Uses 16-color ANSI codes (8 colors + bright variants). Supported by virtually all color terminals since the 1990s:
- All modern terminals (truecolor-capable terminals also support ANSI)
- xterm, urxvt, gnome-terminal, konsole (without truecolor)
- PuTTY, macOS Terminal.app
- Linux virtual console (with framebuffer)
Enable with render_mode = "ansi".
Uses ASCII characters to represent image intensity. Works in any terminal, including:
- Non-color terminals
- Serial consoles
- Text-mode virtual terminals
- Screen readers (though usefulness varies)
Enable with render_mode = "ascii".
By default (render_mode = "auto"), chibi detects terminal
capabilities:
- Checks
$COLORTERMfortruecoloror24bit→ truecolor mode - Checks
$TERMfortruecolor,24bit→ truecolor mode - Checks
$TERMfor256colororcolor→ ansi mode - Falls back to ansi mode (safe default for unknown terminals)
Then applies the fallback chain based on enabled modes: truecolor → ansi → ascii → placeholder.
To force a specific mode regardless of detection, set render_mode
explicitly.