chroma
chroma
CLI, syntax highlighter, and terminal-UI companion for the tree-sitter-manager Crystal runtime. The runtime owns grammar installation, loading, parsing, and cache management; chroma owns the presentation layer: themes, renderers, and Tree-sitter query assets.
Features
- Syntax highlighting for 306 languages via per-language Tree-sitter queries.
- 63 built-in color themes.
- Interactive terminal UI with incremental reparsing (
chroma-tui). - Grammar status, query inspection, installation statistics, diagnostics.
- Shell completion scripts for bash, zsh, and fish.
Install
Prerequisites: Crystal >= 1.21.0 and Shards, plus the tree-sitter-manager runtime checked out as ../tree-sitter-manager next to this repository (path dependency). See docs/development.md for the full checkout guide.
shards build # build bin/chroma and bin/chroma-tui
make install PREFIX=/usr/local
Installs binaries to $PREFIX/bin and query assets to $PREFIX/share/chroma/queries, so highlighting does not depend on the current working directory.
Usage
CLI
chroma highlight FILE Highlight a source file.
chroma languages List supported languages.
chroma themes List available themes.
chroma queries LANG Show preprocessed queries for a language.
chroma groups List semantic language groups.
chroma stats Show installation statistics.
chroma doctor Check grammar, query, and cache health.
chroma completions SHELL Generate completions (bash, zsh, fish).
chroma version Print version information.
highlight accepts an explicit language, theme, and output format:
chroma highlight path/to/file.cr
chroma highlight path/to/file.cr -l crystal -t catppuccin::frappe
chroma highlight path/to/file.cr -f html
Terminal UI
chroma-tui # pick a file to open
chroma-tui path/to/file.cr
Shell completions
eval "$(chroma completions bash)" # bash
source <(chroma completions zsh) # zsh
chroma completions fish | source # fish
Configuration
CHROMA_QUERIES_DIRoverrides the query assets directory.
Documentation
License
MIT.
chroma
- 0
- 0
- 0
- 0
- 4
- about 6 hours ago
- September 5, 2026
MIT License
Sat, 05 Sep 2026 20:30:45 GMT