Global Flags
—config
Specify a custom configuration file path.Path to a custom glow config file. When not specified, Glow searches for config files in standard locations.
main.go:397
Rendering Flags
—pager / -p
Display rendered markdown using a pager.When enabled, Glow pipes the rendered output to your system pager (defined by the
PAGER environment variable, defaults to less -r).Cannot be used simultaneously with
--tui. The pager flag is mutually exclusive with TUI mode.main.go:398, main.go:316-329
—tui / -t
Display the rendered content in TUI (Text User Interface) mode.Forces TUI mode even when a file is specified. Useful for viewing a specific file in the interactive interface.
main.go:399
—style / -s
Specify the rendering style.Style name (e.g.,
dark, light, notty) or path to a custom JSON style file. When set to auto, Glow automatically selects an appropriate style based on your terminal’s color scheme.auto- Automatically detect terminal backgrounddark- Optimized for dark backgroundslight- Optimized for light backgroundsnotty- Plain output for non-terminal environments- Custom JSON file path for advanced styling
main.go:400
—width / -w
Set the word-wrap width.Maximum line width for word-wrapping. When set to
0, Glow automatically detects terminal width (capped at 120 characters for readability). For non-terminal output, defaults to 80.main.go:401, main.go:193-207
—preserve-new-lines / -n
Preserve newlines in the rendered output.When enabled, Glow preserves newlines as they appear in the source markdown instead of reflowing text.
main.go:404
TUI-Only Flags
The following flags only affect behavior when Glow is running in TUI mode.—all / -a
Show system files and directories.Show hidden files, dot files, and system files in the TUI file browser. This flag only affects TUI mode.
main.go:402
—line-numbers / -l
Display line numbers in the TUI.Enable line numbers when viewing files in TUI mode. This flag only affects TUI mode.
main.go:403
—mouse / -m
Enable mouse wheel support.Enable mouse wheel scrolling in TUI mode. This is a hidden flag and only affects TUI mode.
This is a hidden flag primarily for testing and advanced use. Mouse support may vary depending on your terminal emulator.
main.go:405-406
Flag Combinations
Common Patterns
Mutually Exclusive Flags
Source:main.go:175-177
Configuration File vs Flags
Flags specified on the command line take precedence over settings in the configuration file. This allows you to override config file defaults on a per-invocation basis. Priority order:- Command-line flags (highest priority)
- Configuration file settings
- Built-in defaults (lowest priority)
main.go:166-173, main.go:409-417
Auto-Detection Behavior
Style Auto-Detection
When--style is not specified or set to auto, Glow detects the terminal environment:
- Terminal output: Automatically matches your terminal’s color profile
- Non-terminal output (pipes, redirects): Uses the
nottystyle for plain text
main.go:186-190
Width Auto-Detection
When--width is not specified or set to 0:
- Terminal output: Detects terminal width, capped at 120 characters
- Non-terminal output: Defaults to 80 characters
main.go:193-207