LinuxCommandLibrary

carbon-now

Generate beautiful images of source code

TLDR

Generate image from file

$ carbon-now [file.js]
copy
Interactive mode
$ carbon-now [file.py] --interactive
copy
Save to specific location
$ carbon-now [file.rs] --save-to [~/images]
copy
Save with custom name
$ carbon-now [file.go] --save-as [my-code]
copy
From clipboard
$ carbon-now --from-clipboard
copy
Copy result to clipboard
$ carbon-now [file.ts] --to-clipboard
copy
Use preset
$ carbon-now [file.js] --preset [my-preset]
copy
Specific line range
$ carbon-now [file.py] --start [5] --end [15]
copy

SYNOPSIS

carbon-now file [options]
carbon-now --from-clipboard [options]

DESCRIPTION

carbon-now creates beautiful images of source code from the terminal using the Carbon service (carbon.now.sh). It renders code with syntax highlighting, customizable themes, and professional styling suitable for presentations, documentation, and social media.
The tool uses a headless browser (Playwright) to render images through the Carbon web service. It supports reading from files, clipboard, or stdin, and can output to files or clipboard. Interactive mode allows customizing appearance settings before generating the image. Presets save frequently used configurations for consistent styling.

PARAMETERS

-i, --interactive

Customize settings before generating
-s, --start line
Starting line of input
-e, --end line
Ending line of input
-p, --preset name
Apply existing preset
--save-to path
Image save location (default: cwd)
--save-as name
Image filename without extension
--from-clipboard
Read input from clipboard
--to-clipboard
Copy image to clipboard
--open-in-browser
Open in browser instead of saving
--config path
Use different config file
--settings json
Override specific settings
--disable-headless
Run browser in headful mode
--engine name
Rendering engine (default: chromium)

CONFIGURATION

~/.carbon-now.json

Saved settings and presets. Previous settings are reused automatically.

CAVEATS

Requires Node.js and npm. Uses headless browser (Playwright) for rendering. Internet connection required for Carbon service.

SEE ALSO

silicon(1), freeze(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community