LinuxCommandLibrary

glow

Render Markdown files with syntax highlighting

TLDR

Run glow and select a file to view

$ glow
copy

Render a Markdown file to the terminal
$ glow [path/to/file]
copy

View a Markdown file using a paginator
$ glow [[-p|--pager]] [path/to/file]
copy

View a file from a URL
$ glow [https://example.com/file.md]
copy

View a GitHub/GitLab README
$ glow [github.com/owner/repository]
copy

SYNOPSIS

glow [OPTIONS] [FILE_OR_URL...]

PARAMETERS

-s, --style
    Specify the rendering style or theme to use (e.g., dark, light, auto, dracula).
Defaults to auto based on terminal background.

-p, --pager
    Pipe the output through an external pager command, typically less, allowing scrolling for long documents.

-l, --local
    Render local files only; ignore remote content, even if a URL is provided as an argument.

-w, --width
    Set a specific rendering width for the output, overriding auto-detection based on terminal size.

--hd
    Render soft-wrapped text with 'hard breaks', treating each line as a distinct paragraph line rather than allowing soft line wrapping.

--show-local-path
    Display the local file path of the Markdown document being rendered above its content.

--copy
    Copy the rendered Markdown content to the system clipboard instead of displaying it in the terminal.

--config
    Specify a custom configuration file path for glow settings.

--version
    Show the version information of glow and exit.

--help
    Display a comprehensive help message with all available options and their usage.

DESCRIPTION

glow is a powerful and aesthetic command-line utility designed to render Markdown files directly within your terminal emulator. Developed by Charm (creators of many popular CLI tools like Bubble Tea and Gum), glow transforms raw Markdown text into a beautifully formatted, syntax-highlighted, and easily readable output. It supports local files, including automatic detection and rendering of README.md in the current directory or parent directories. Additionally, glow can fetch and display Markdown content from URLs, making it useful for reading GitHub READMEs or other online documentation without leaving the terminal. Its features include pagination for longer documents, customizable themes (styles), and the ability to linkify URLs. glow aims to enhance the terminal experience for developers and users who frequently interact with Markdown-formatted content.

CAVEATS

glow is primarily a viewer and does not provide editing capabilities. Complex Markdown features, such as highly customized embedded HTML or certain diagram syntaxes, may not render perfectly or at all. Rendering remote URLs requires an active internet connection. The visual appearance is highly dependent on your terminal emulator's font and color scheme capabilities.

DEFAULT BEHAVIOR

When glow is executed without any specific file or URL arguments in a directory, it automatically searches for and renders common Markdown files like README.md, README.markdown, etc., within the current directory or its parent directories.

CONFIGURATION

glow supports a persistent configuration file, typically located at ~/.config/glow/glow.yml. Users can define default rendering styles, preferred pager settings, and other customization options within this file, ensuring consistent behavior across sessions.

HISTORY

glow was developed by Charm, a company renowned for creating elegant and robust open-source command-line tools, predominantly using the Go programming language. It was initially released around late 2019 / early 2020. It rapidly gained popularity among developers for its polished Markdown rendering capabilities and user-friendly interface, quickly becoming a go-to tool for viewing README.md files and other Markdown-formatted documentation directly in the terminal.

SEE ALSO

less(1), cat(1), pandoc(1), bat(1)

Copied to clipboard