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]
carbonyl [options] --input <file>

PARAMETERS

URL
    The web address to navigate to and render.

--input <file>
    Specifies a local HTML or JavaScript file to load and execute instead of a URL.

--output <file>
    Saves the resulting rendered HTML content or other output (e.g., PDF) to the specified file.

--screenshot <file>
    Captures a screenshot of the rendered page and saves it to the given file path.

--user-agent <string>
    Sets the User-Agent HTTP header for all requests made by the browser instance.

--no-javascript
    Disables JavaScript execution, rendering pages as static HTML.

--headers <JSON_string>
    Provides additional HTTP headers as a JSON string for all outgoing requests.

--timeout <seconds>
    Sets a maximum timeout for page loading and script execution in seconds.

DESCRIPTION

Carbonyl is an innovative open-source project that implements a headless web browser, leveraging the performance and safety characteristics of the Rust programming language. It is designed to provide a lightweight and efficient alternative to traditional headless browser solutions like Puppeteer or Selenium, which often rely on full instances of Chrome or Firefox. Carbonyl aims to offer a minimalistic yet powerful environment for web scraping, automated testing, and general web content interaction without the overhead of a visible graphical user interface.

At its core, Carbonyl functions by rendering web pages in a non-graphical context, allowing developers and system administrators to programmatically interact with web content. This makes it ideal for tasks such as extracting data from websites, validating website functionality, or performing automated tasks that require a full browser engine but do not need visual rendering. Its Rust foundation means it compiles to a single, self-contained binary, leading to faster startup times and lower resource consumption compared to solutions that launch a separate browser process. While not a standard Linux command distributed with most distributions, Carbonyl can be compiled and installed on Linux systems, providing a versatile tool for command-line driven web automation.

CAVEATS

Carbonyl is not a standard Linux command pre-installed on most distributions. It is an external open-source project that needs to be manually downloaded, compiled (if from source), and installed. Its features and stability might evolve as it is under active development. While aiming for high compatibility, it might not fully replicate every nuanced behavior of a full-fledged graphical browser like Chrome.

CORE USE CASES

Common applications for Carbonyl include automated web scraping for data collection, end-to-end testing of web applications, generating PDF reports or screenshots from web pages, and performing synthetic monitoring of website availability and performance from a command-line interface.

INSTALLATION

As Carbonyl is a Rust project, typical installation involves using Cargo, Rust's package manager. After installing Rust and Cargo, it can often be installed via cargo install carbonyl or by cloning its Git repository and building from source.

HISTORY

Carbonyl was initiated by Badr Bouslikhin (fathyb) as an open-source project in Rust. Its development stemmed from the desire for a more efficient, less resource-intensive, and more robust alternative to existing headless browser solutions, which often rely on complex setups involving large browser binaries and external driver programs. It aims to provide a fast and secure tool for headless web interaction by leveraging Rust's performance characteristics.

SEE ALSO

chromium, curl(1), wget(1), lynx(1)

Copied to clipboard