carbonyl README

The project's README from github.com/fathyb/carbonyl. As one markdown file: README.md.

   O    O
    \  /
O —— Cr —— O
    /  \
   O    O

Carbonyl

Carbonyl is a Chromium based browser built to run in a terminal. Read the blog post.

It supports pretty much all Web APIs including WebGL, WebGPU, audio and video playback, animations, etc..

It's snappy, starts in less than a second, runs at 60 FPS, and idles at 0% CPU usage. It does not require a window server (i.e. works in a safe-mode console), and even runs through SSH.

Carbonyl originally started as html2svg and is now the runtime behind it.

Usage

Carbonyl on Linux without Docker requires the same dependencies as Chromium.

Docker

$ docker run --rm -ti fathyb/carbonyl https://youtube.com

npm

$ npm install --global carbonyl
$ carbonyl https://github.com

Binaries

Demo

Known issues

Comparisons

Lynx

Lynx is the original terminal web browser, and the oldest one still maintained.

Pros

Cons

Some might sound like pluses, but Browsh and Carbonyl let you disable most of those if you'd like

Browsh

Browsh is the original "normal browser into a terminal" project. It starts Firefox in headless mode and connects to it through an automation protocol.

Pro

Cons

Operating System Support

As far as tested, the operating systems under are supported:

Contributing

Carbonyl is split in two parts: the "core" which is built into a shared library (libcarbonyl), and the "runtime" which dynamically loads the core (carbonyl executable).

The core is written in Rust and takes a few seconds to build from scratch. The runtime is a modified version of the Chromium headless shell and takes more than an hour to build from scratch.

If you're just making changes to the Rust code, build libcarbonyl and replace it in a release version of Carbonyl.

Core

$ cargo build

Runtime

Few notes:

Fetch

Fetch Chromium's code.

$ ./scripts/gclient.sh sync

Apply patches

Any changes made to Chromium will be reverted, make sure to save any changes you made.

$ ./scripts/patches.sh apply

Configure

$ ./scripts/gn.sh args out/Default

Default is the target name, you can use multiple ones and pick any name you'd like, i.e.:

$ ./scripts/gn.sh args out/release
$ ./scripts/gn.sh args out/debug
# or if you'd like to build a multi-platform image
$ ./scripts/gn.sh args out/arm64
$ ./scripts/gn.sh args out/amd64

When prompted, enter the following arguments:

import("//carbonyl/src/browser/args.gn")

# uncomment this to build for arm64
# target_cpu = "arm64"

# comment this to disable ccache
cc_wrapper = "env CCACHE_SLOPPINESS=time_macros ccache"

# comment this for a debug build
is_debug = false
symbol_level = 0
is_official_build = true

Build binaries

$ ./scripts/build.sh Default

This should produce the following outputs:

Build Docker image

# Build arm64 Docker image using binaries from the Default target
$ ./scripts/docker-build.sh Default arm64
# Build amd64 Docker image using binaries from the Default target
$ ./scripts/docker-build.sh Default amd64

Run

$ ./scripts/run.sh Default https://wikipedia.org

carbonyl (fathyb/carbonyl)

Searching Database…

19.6K ·GitHub
Что это такое?Carbonyl — это браузер на базе Chromium, который работает целиком внутри терминала, так что вы можете сидеть в современном интернете, не выходя из командной строки.
Это настоящий браузер или что-то вроде текстового, типа Lynx?Это настоящий Chromium, а не текстовый парсер: он поддерживает практически все Web API, включая WebGL, WebGPU, воспроизведение аудио и видео и анимации, и рендерит всё прямо в терминале.
Нужно ли сначала установить что-то ещё?Только на Linux без Docker: там Carbonyl требует те же зависимости, что и Chromium. Путь через Docker избавляет от этой настройки.
Что пока не работает?Полноэкранный режим пока не поддерживается, как и расширения браузера — расширения есть в планах (у Browsh они уже есть сегодня).
На каких системах он работает?Linux (проверены Debian, Ubuntu и Arch), macOS и Windows 11 через WSL. Бинарники есть для macOS и Linux на amd64 и arm64, а толком проект протестирован только на первых двух.
Будет ли он работать на сервере без графики по SSH?Да — ради этого он и создан: ему вообще не нужен оконный сервер, он работает в консоли в safe-mode и запускается через SSH.
Насколько он быстрый?Очень: запускается меньше чем за секунду, работает на 60 FPS и в простое грузит процессор на 0%. Он рендерит в нативном разрешении терминала, а не копирует и уменьшает фреймбуфер окна — поэтому он такой лёгкий.
Чем он отличается от Browsh?Browsh запускает Firefox в headless-режиме и управляет им через протокол автоматизации, из-за чего на тот же контент уходит примерно в 50 раз больше процессора. Carbonyl — это модифицированный Chromium с нативным рендерингом. Browsh проще обновлять и он уже поддерживает расширения, Carbonyl — пока нет.
Зачем его сделали — что такое html2svg?Carbonyl вырос из html2svg — проекта по превращению веб-страниц в SVG, и теперь Carbonyl служит для него движком.
Which topics is it in?webgpu, chromium, headless, webgl, ssh, app, tui, browser, performance, rust, free, npm
Creator
fathyb
Size
0.3 MB
Stars
19.6K
Age
3y
Commits · 90 Days