home / dev-tools / silicon

silicon

3.5k

CLI for rendering syntax-highlighted code snippets into styled PNG screenshots from files, stdin, or the clipboard.

$brew install silicon
Language
Rust
Stars
3,477
Category
Dev Tools
Agent
AI Analysis

silicon renders syntax-highlighted code into styled PNG screenshots. It is a browser-free alternative to Carbon for documentation, blog, and sharing workflows.

What It Enables
  • Render source files or piped snippets into code images for docs, blog posts, release notes, or social sharing.
  • Generate consistent screenshots in scripts with theme, font, padding, line-number, highlighted-line, window-title, and background controls.
  • Pull code from the clipboard and copy the finished image back to the clipboard for editor-centric publishing workflows.
Agent Fit
  • File and stdin input plus explicit flags make it easy to batch-generate screenshots in shell scripts or docs pipelines.
  • The automation surface is narrow: output is a PNG file or clipboard image only, with no JSON or text mode for downstream parsing.
  • Best fit when an agent already knows which snippet to present and needs a polished asset rather than system inspection or mutation.
Caveats
  • Clipboard workflows depend on platform-specific integration such as macOS pasteboard, wl-copy, or xclip.
  • Custom syntaxes and themes rely on local cache files and may need an explicit cache rebuild.