LinuxCommandLibrary

carbonyl

Render HTML to terminal

TLDR

Open an about:blank page

$ carbonyl
copy

Open a webpage
$ carbonyl [https://example.com]
copy

Exit carbonyl
$ <Ctrl c>
copy

Display help
$ carbonyl [[-h|--help]]
copy

SYNOPSIS

carbonyl [options] [URL]

PARAMETERS

--listen-addr
    Listen for HTTP API on address (default :0)

--screenshot[=]
    Save PNG/JPEG screenshot of URL to file (default stdout)

--print-to-pdf[=]
    Save PDF of URL to file (default stdout)

--headless
    Run headlessly (default)

--no-sandbox
    Disable sandboxing (recommended in containers/root)

--disable-gpu
    Disable GPU acceleration (default, CPU-only)

--user-data-dir


    Use dir for profile/cache

--window-size ,
    Set viewport to width x height

--format
    Screenshot format (default png)

--quality <1-100>
    JPEG quality (default 90)

--wait-until
    Wait condition before capture

--wait-for
    Wait for CSS selector to appear

DESCRIPTION

Carbonyl is a statically-linked Chromium browser engineered to run in a single process, eliminating the multi-process architecture of standard Chromium. This design drastically reduces memory usage and startup time, making it perfect for Docker containers, serverless platforms, CI/CD pipelines, and embedded systems.

Key capabilities include generating screenshots and PDFs from URLs via command-line or an integrated HTTP server. For example, render a page directly with ./carbonyl --screenshot=example.png https://example.com, or start a server with --listen-addr=:8000 for API access like /screenshot?url=https://cloudflare.com.

It inherits most Chromium flags (e.g., --no-sandbox, --user-agent), supports custom viewports, selectors to wait for elements, URL blocking, and image formats. No system dependencies are needed beyond glibc; prebuilts are available for Linux x86_64.

Ideal for web scraping, thumbnail generation, and automated reporting without full browser bloat.

CAVEATS

CPU-only rendering; no extensions, WebGL, or multi-process features; Linux x86_64 focus; high CPU for complex JS pages; verify SHA256 checksums for binaries.

HTTP SERVER API

On --listen-addr=:8000:
- GET /screenshot?url=<url>&output=file.png
- GET /pdf?url=<url>&output=file.pdf
Supports ?format=png|jpeg&quality=95

BUILD FROM SOURCE

Requires depot_tools and Chromium src; gn gen out/Default --args='is_debug=false is_component_build=false' then ninja -C out/Default carbonyl

HISTORY

Developed by Cloudflare and open-sourced in July 2019 (v75). Tracks Chromium releases (latest ~v124). Focuses on static linking, dep minimization, and server/container optimization.

SEE ALSO

chromium-browser(1), google-chrome(1), wkhtmltopdf(1)

Copied to clipboard