Skip to main content
Glow provides a main command for rendering markdown and several subcommands for managing configuration and manpages.

Main Command

glow [SOURCE|DIR]

Render markdown on the CLI, with pizzazz! Usage:
glow [SOURCE|DIR] [flags]
Arguments:
  • SOURCE - Optional path to a markdown file, directory, or URL to render
  • DIR - Optional directory path (Glow will search for README files)
Behavior:
When run without arguments, Glow launches the TUI (Text User Interface) in the current working directory.
glow
When given a directory path, Glow launches the TUI in that directory.
glow ~/projects/my-docs
When given a file path, Glow renders the markdown file to stdout.
glow README.md
Use - or pipe content to read from stdin.
echo "# Hello World" | glow -
cat README.md | glow
Glow can fetch and render markdown from HTTP/HTTPS URLs.
glow https://github.com/charmbracelet/glow/raw/master/README.md
Glow automatically fetches README files from GitHub and GitLab repository URLs.
glow github.com/charmbracelet/glow
glow gitlab.com/user/project
Examples:
# Render a local file with pager
glow -p README.md

# Render with custom width
glow -w 100 document.md

# Open TUI with all files visible
glow -a ~/docs

# Render from URL with custom style
glow -s dark https://example.com/doc.md

# Use stdin with line numbers
cat notes.md | glow -l

Subcommands

glow config

Edit the glow config file. Usage:
glow config [flags]
Description: Opens the Glow configuration file in your default editor (determined by the EDITOR environment variable). If the config file doesn’t exist, it will be created with default settings. Default config location:
  • $GLOW_CONFIG_HOME/glow.yml (if GLOW_CONFIG_HOME is set)
  • $XDG_CONFIG_HOME/glow/glow.yml (if XDG_CONFIG_HOME is set)
  • Platform-specific config directory otherwise
Examples:
# Edit default config file
glow config

# Edit specific config file
glow config --config ~/.config/glow/custom.yml
Default configuration:
# style name or JSON path (default "auto")
style: "auto"
# mouse support (TUI-mode only)
mouse: false
# use pager to display markdown
pager: false
# word-wrap at width
width: 80
# show all files, including hidden and ignored.
all: false

glow man

Generates manpages. Usage:
glow man
Description: Outputs the Glow manual page in roff format to stdout. This command is primarily used for generating manual pages during installation or packaging. Example:
# Generate and view manpage
glow man | man -l -

# Save manpage to file
glow man > glow.1
The glow man command is hidden by default and primarily intended for package maintainers and advanced users.

Command Behavior Details

When given a directory, Glow searches for README files in this order:
  1. README.md
  2. README
  3. Readme.md
  4. Readme
  5. readme.md
  6. readme
Source: main.go:35

TUI vs CLI Mode

Glow automatically determines whether to use TUI or CLI mode:
  • TUI mode: Activated when no file argument is provided, or when the --tui flag is used
  • CLI mode: Activated when a file is provided, stdin is piped, or when the --pager flag is used
You cannot use both --pager and --tui flags simultaneously.

Code File Rendering

Glow can render non-markdown files as syntax-highlighted code blocks. The file extension is used to determine the appropriate syntax highlighting. Source: main.go:289-307

Build docs developers (and LLMs) love