Skip to main content

CLI Behavior

Input sources

  • if a path is provided, Lumis reads that file
  • if no path is provided, Lumis reads from stdin
  • you can pipe content directly into lumis highlight
  • terminal output is the default formatter unless you pass --formatter
cat main.rs | lumis highlight -l rust
echo 'fn main() {}' | lumis highlight -l rust

When to set --language

Pass --language when you already know the correct parser and do not want detection to depend on the filename or input content.

lumis highlight main.txt --language rust

When to rely on auto-detection

Omit --language when the path, shebang, or source content should drive detection.

lumis highlight main.rs

If no language can be inferred, plaintext is the safe fallback.

Parser cache lifecycle

The CLI stores parser WASM files under the data directory.

  • first use may trigger a parser download
  • lumis parsers fetch ... downloads ahead of time
  • lumis parsers update ... refreshes cached parsers
lumis parsers fetch rust javascript elixir
lumis parsers update rust

Data directory

Default location depends on the OS. Override it with:

  • --data-dir
  • LUMIS_DATA_DIR

The data dir stores:

  • parser WASM files
  • custom theme JSON files

Local custom themes

Themes placed in the data directory can be discovered by lumis themes list and used by name.

That is useful when you generate themes with lumis themes generate and want to keep using them locally.

See CLI Commands for theme generation flags and CLI for highlight workflow examples.

Nested languages and parser availability

Some formats depend on nested parsers. If embedded languages are missing from the cache, those nested regions cannot be fully highlighted.

If you work with mixed-language content, prefetch all relevant parsers.

Verbose mode

Use --verbose to inspect cache hits, parser paths, and downloads.