Main Command
glow [SOURCE|DIR]
Render markdown on the CLI, with pizzazz! Usage:SOURCE- Optional path to a markdown file, directory, or URL to renderDIR- Optional directory path (Glow will search for README files)
No arguments
No arguments
When run without arguments, Glow launches the TUI (Text User Interface) in the current working directory.
With a directory
With a directory
When given a directory path, Glow launches the TUI in that directory.
With a file
With a file
When given a file path, Glow renders the markdown file to stdout.
From stdin
From stdin
Use
- or pipe content to read from stdin.From URL
From URL
Glow can fetch and render markdown from HTTP/HTTPS URLs.
GitHub/GitLab URLs
GitHub/GitLab URLs
Glow automatically fetches README files from GitHub and GitLab repository URLs.
Subcommands
glow config
Edit the glow config file. Usage: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(ifGLOW_CONFIG_HOMEis set)$XDG_CONFIG_HOME/glow/glow.yml(ifXDG_CONFIG_HOMEis set)- Platform-specific config directory otherwise
glow man
Generates manpages. Usage:The
glow man command is hidden by default and primarily intended for package maintainers and advanced users.Command Behavior Details
Directory Search
When given a directory, Glow searches for README files in this order:README.mdREADMEReadme.mdReadmereadme.mdreadme
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
--tuiflag is used - CLI mode: Activated when a file is provided, stdin is piped, or when the
--pagerflag is used
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