Glow is a CLI-based Markdown reader developed by Charm that formats structured Markdown documents into visually appealing, styled terminal text using ANSI escape sequences. By integrating Glow into a Bash shell environment, developers and system administrators can read documentation, repository README files, and remote Markdown resources directly within their terminal windows without relying on external web browsers or heavy graphical applications.
Understanding Glow and Its Core Terminal Features
Markdown has established itself as the standard markup language for technical documentation, software repositories, project notes, and issue tracking. While plain-text Markdown files remain legible in raw format, reading long documents inside standard terminal text editors or plain output streams often lacks visual hierarchy. Raw headers, unformatted tables, non-highlighted code fragments, and unparsed hyperlinks reduce scannability when viewing documentation inside standard Linux or macOS shell sessions.
Glow solves this readability challenge by processing raw Markdown markup and converting structural elements into rich terminal formatting. Powered by Charm's Glamour rendering engine, Glow dynamically calculates terminal window dimensions, applies syntax highlighting to fenced code blocks, formats tables into aligned grid layouts, and styles section headers with distinct ANSI color palettes.
Unlike simple text utilities that merely print static lines to standard output, Glow operates as both a command-line utility and an interactive Terminal User Interface (TUI). When launched without explicit arguments inside a directory, Glow scans the current working environment and presents an interactive file browser. This dual functionality allows users to instantly view single files, pipe output across Bash pipelines, or navigate entire document trees using intuitive keyboard shortcuts.
Beyond local file rendering, Glow natively handles remote document retrieval. Users can pass direct HTTPS URLs or repository paths to render remote technical guides instantly. Furthermore, Glow includes a local storage mechanism known as the "stash," which enables users to save documents into a localized cache for quick reference across terminal sessions without cluttering the project directory structure.
Installing Glow Across Operating Systems and Package Managers
Before rendering Markdown documents within a Bash environment, Glow must be installed and linked within your system executable search path (PATH). Official packages are available across major Linux distributions, macOS, and Windows environments via leading package management platforms.
macOS Installation
On macOS systems running standard Bash or Zsh shells, the easiest method to install Glow is through Homebrew. Running the standard installation command pulls the pre-compiled binary directly from official formula repositories:
brew install glow
Once installed, Homebrew automatically handles executable symlinking into standard binary paths such as /opt/homebrew/bin on Apple Silicon hardware or /usr/local/bin on Intel-based systems.
Linux Package Installation
For Linux distributions, Charm maintains official binary repositories that grant access to signed packages updated alongside upstream releases.
Debian and Ubuntu Derivatives
To configure the official APT repository on Debian, Ubuntu, Linux Mint, or Pop!_OS, import the Charm GPG key and register the package source before running apt updates:
sudo mkdir -p /etc/apt/keyringscurl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpgecho "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.listsudo apt updatesudo apt install glow
Fedora, RHEL, and CentOS
On Red Hat enterprise systems and Fedora distributions using the DNF package manager, add the repository configuration file directly to your system setup:
echo '[charm]' | sudo tee /etc/yum.repos.d/charm.repoecho 'name=Charm' | sudo tee -a /etc/yum.repos.d/charm.repoecho 'baseurl=https://repo.charm.sh/yum/metadata/' | sudo tee -a /etc/yum.repos.d/charm.repoecho 'enabled=1' | sudo tee -a /etc/yum.repos.d/charm.repoecho 'gpgcheck=1' | sudo tee -a /etc/yum.repos.d/charm.repoecho 'gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee -a /etc/yum.repos.d/charm.reposudo dnf install glow
Arch Linux
Arch Linux includes Glow in its extra official repository. You can install it using standard pacman operations:
sudo pacman -S glow
Installing via Go Package Manager
Because Glow is written in Go, developer environments equipped with a functional Go installation toolchain can build and install the binary directly from source code repositories:
go install github.com/charmbracelet/glow/v2@latest
Ensure that your GOPATH/bin directory (typically ~/go/bin) is included inside your local PATH variable within your ~/.bashrc file to execute the glow binary directly from any working directory.
Core Command Usage for Local Files and Data Streams
Using Glow in Bash involves commands designed for viewing local files, processing text streams, or launching interactive file browsers.
Rendering Local Markdown Files
To render a specific Markdown file directly within standard shell output, execute glow followed by the target file path:
glow README.md
Glow reads the content, determines your current terminal column width, renders inline Markdown formatting (such as bold emphasis, italicized text, blockquotes, and lists), applies code block color highlights, and outputs the result directly to standard output (stdout).
If the document length exceeds your visible terminal screen height, standard execution causes the top lines to scroll out of view. To force output through an interactive terminal pager, add the -p or --pager flag:
glow -p README.md
This opens the document inside an integrated terminal viewer that supports line-by-line or page-by-page scrolling using the arrow keys, Page Up, Page Down, or standard Vim navigation keys (j, k, g, G). Pressing q exits the pager and returns control to your Bash prompt.
Processing Standard Input Streams (Piping)
Bash shell scripting relies heavily on standard input and output streams. Glow fully supports receiving unrendered Markdown text via stdin pipes. To indicate that Glow should read from standard input rather than a physical file path, pass the - dash hyphen parameter:
curl -s https://raw.githubusercontent.com/git/git/master/README.md | glow -
This pipe operation fetches the remote text file using curl and seamlessly transforms the plain output stream into formatted terminal text without creating temporary files on disk.
Bash Pipeline Execution Flow:
- Data Source (cat / curl / echo)
- STDOUT Pipe
- Glow Renderer (glow - / glow -p)
Launching the Interactive TUI Document Browser
When invoked without any file arguments, Glow initiates its full-screen terminal user interface (TUI):
glow
The interactive interface displays a navigable list of Markdown files detected in the current directory and subdirectories. Using keybindings, users can browse local files, view recent documents, navigate stashed items, and search through document collections interactively.
Key controls within the interactive TUI mode include:
- Up/Down Arrows (or j/k): Move selection cursor up and down.
- Enter: Open and render the selected Markdown document.
- Esc or q: Navigate back to the document list or exit Glow.
- /: Initiate text search filtering across listed documents.
- Tab: Switch views between local directory files, stashed items, and news/documentation.
Fetching and Rendering Remote Resources Directly
Glow supports fetching remote documents directly using GitHub repository shorthands or raw web URLs, eliminating the need to explicitly chain curl or wget commands:
glow github.com/charmbracelet/glow
Executing this command queries the official GitHub API, locates the default branch README.md file for the targeted repository, fetches its raw contents, and renders the output directly inside your terminal window.
Customizing Visual Output, Themes, and Pager Configurations
Terminal environments vary widely, ranging from high-contrast dark themes to light background configurations and minimal ASCII terminal emulators. Glow includes built-in styling systems powered by JSON theme specifications.
Selecting Built-in Themes
Glow features several built-in color palettes selectable via the -s or --style command flag:
- dark: Default high-contrast dark mode palette optimized for standard dark terminal emulators.
- light: Optimized color scheme for light background terminal windows.
- dracula: Popular purple and pastel color scheme matching the Dracula theme specification.
- notty: Minimalist rendering mode that strips ANSI color codes while maintaining structural indentation and layout formatting, ideal for low-color terminals or plain text export.
- auto: Automatically detects whether the host terminal uses a dark or light background based on environment queries.
To apply a specific theme during single execution:
glow -s dracula documentation.md
Defining Environment Variables in Bash
To apply theme settings permanently across all command invocations without appending flags, define the GLOW_STYLE environment variable within your user shell profile (~/.bashrc or ~/.bash_profile):
export GLOW_STYLE="dracula"
After updating the file, apply the configuration to your active shell session:
source ~/.bashrc
From this point forward, running glow README.md automatically inherits the Dracula color palette.
Custom JSON Style Sheets
For enterprise brand consistency or specialized access requirements, users can construct custom theme configuration files in JSON format. A custom style file defines colors, margins, padding, border characters, and text decoration properties for individual Markdown syntax elements (such as headers, code blocks, lists, and tables).
To use a custom JSON stylesheet, supply the path to the style file:
glow -s ~/.config/glow/my_theme.json report.md
Alternatively, set GLOW_STYLE to point directly to the file path:
export GLOW_STYLE="$HOME/.config/glow/my_theme.json"
Controlling Output Width and Pager Behavior
By default, Glow detects the terminal width dynamically and reflows text paragraphs accordingly. However, on wide display monitors spanning hundreds of columns, reading long lines of text across full screen width can cause visual fatigue.
Use the -w or --width flag to cap the maximum rendering line width:
glow -w 80 detailed_guide.md
This setting restricts paragraph text to an 80-column boundary while keeping the output left-aligned within your active terminal frame.
To customize pager execution when using -p, Glow respects the system PAGER environment variable. By default, Glow invokes less -r to handle scrollable terminal buffers while preserving ANSI color strings. If your system pager strips color sequences, ensure your environment exports proper ANSI flags:
export PAGER="less -r"
Advanced Features: Local Stashing and Repository Browsing
Beyond viewing individual files, Glow contains built-in document management routines that streamline documentation access across complex development projects.
Working with Glow Stash
The Glow Stash functions as a persistent local cache for documentation. Stashing allows developers to quick-save crucial setup notes, cheat sheets, or remote API reference documents into an easily accessible list that remains available regardless of the active working directory.
To stash a local file:
glow stash memo.md
To stash remote documentation directly from a URL for offline reading:
glow stash https://raw.githubusercontent.com/docker/cli/master/README.md
To view all stashed documents inside an interactive TUI selection menu, run:
glow stash
From the stash menu, users can search through stashed files, view contents, rename internal titles, or delete cached entries without affecting original source files on disk.
Glow Stash Architecture:
- Local File / Remote URL
glow stash- Local Storage Cache (
~/.local/share/charm/glow/)
Git Repository Auto-Detection
When working within software project repositories, typing full file paths repeatedly reduces terminal efficiency. Glow incorporates automated directory inspection routines.
Executing glow without arguments inside the root directory of a software repository automatically isolates project documentation files (such as README.md, CONTRIBUTING.md, or files within a docs/ subdirectory) and displays them in the interactive selection menu.
Terminal Markdown Renderers Compared
Command-line environments offer several tools for reading formatted Markdown files. The table below compares Glow against alternative terminal renderers and utility tools.
| Tool Name | Primary Language | Interactive TUI | Remote URL Fetching | Syntax Highlighting Engine | Custom Style Sheets | Main Distribution Channels |
|---|---|---|---|---|---|---|
| Glow | Go | Yes | Native (URLs & GitHub) | Glamour (Chroma) | JSON Stylesheets | APT, DNF, Homebrew, Pacman, Go |
| Bat | Rust | No (Pager only) | No (Requires curl pipe) | Syntect | Sublime Themes (.tmTheme) | APT, DNF, Homebrew, Pacman, Cargo |
| Mdcat | Rust | No | No (Requires curl pipe) | Syntect | Terminal Color Palette | Homebrew, Pacman, Cargo |
| Lowdown | C | No | No | Custom ANSI | Command-line flags | Package managers, Source build |
| Pandoc | Haskell | No | No | Native syntax engines | Custom templates | APT, DNF, Homebrew, Binary packages |
Troubleshooting Common Glow Terminal Execution Issues
While Glow works reliably out of the box across standard terminal emulators, visual glitches or execution errors can occur due to terminal misconfigurations or missing dependencies.
Unformatted Plain Output or Missing ANSI Colors
If executing Glow results in raw text without color highlights, bold text, or layout boxes, your terminal session might not be reporting color capability support correctly.
First, check the value of your shell TERM environment variable:
echo $TERM
If output displays dumb or unknown, standard color sequences are disabled by default. Force color rendering by defining terminal capability variables inside your shell session:
export TERM="xterm-256color"export COLORTERM="truecolor"
Additionally, ensure that you have not configured GLOW_STYLE="notty", which explicitly strips ANSI output sequences.
Disrupted Layouts and Word-Wrapping Glitches
If table borders display broken characters or long code fragments wrap awkwardly across line boundaries, verify your terminal emulator font settings. Modern terminal renderers rely on UTF-8 character encoding to draw crisp table lines and block elements.
Ensure your shell locale environment variables specify UTF-8 encoding:
export LANG="en_US.UTF-8"export LC_ALL="en_US.UTF-8"
If visual glyphs appear corrupted inside custom terminal themes, ensure your chosen terminal font supports UTF-8 box-drawing characters and modern extended symbol sets.
Executable Path Errors After Installation via Go
When installing Glow using go install, running glow in Bash may trigger a shell error:
bash: glow: command not found
This indicates that the Go binary installation directory is missing from your system PATH variable. To fix this, add the Go binary path to ~/.bashrc:
export GOPATH="$HOME/go"export PATH="$PATH:$GOPATH/bin"
Then, reload your environment settings:
source ~/.bashrc
Mouse Scrolling and Pager Navigation Freezes
When opening long files using glow -p README.md, mouse wheel scrolling may occasionally fail to move text lines inside certain terminal emulators (such as GNOME Terminal or default macOS Terminal).
This behavior stems from default less pager configurations. You can fix mouse capture and navigation behaviors by explicitly setting the LESS configuration flags within your Bash environment:
export LESS="-R -F -X"
The -R flag preserves raw ANSI color codes, -F automatically exits the pager if the entire document fits onto a single screen height, and -X prevents clearing the terminal screen upon exit.
Practical Bash Aliases and Pipeline Integration Patterns
To integrate Glow into daily command-line workflows, configure Bash functions and custom shell aliases inside your ~/.bashrc file.
Quick Documentation Viewer Alias
Create shortcuts for rendering project documentation instantly:
alias helpme='glow README.md -p'
Executing helpme inside any directory automatically opens the local README.md file using the scrollable pager mode.
Interactive Web Documentation Fetcher
Add a custom Bash function to fetch and render raw Markdown documentation directly from remote GitHub repositories or web endpoints:
render_url() { if [ -z "$1" ]; then echo "Usage: render_url " return 1 fi curl -sSL "$1" | glow - -p}
After reloading your shell profile, execute the function with any remote HTTPS Markdown target:
render_url https://raw.githubusercontent.com/torvalds/linux/master/README
Git Commit and Diff Formatting Pipeline
Developers frequently write commit messages and pull request descriptions in Markdown format. To review rendered Markdown diffs or log entries directly within Git pipelines, chain Git output into Glow:
git log -1 --pretty=format:"%b" | glow -
This pipeline extracts the detailed extended body of your latest Git commit and renders it formatted inside the terminal interface.
Integrating Glow into Daily Command-Line Operations
Integrating Glow into your command-line workflow improves document scannability, terminal efficiency, and system administration productivity. By replacing raw text output with styled ANSI formatting, you can comfortably read technical manuals, review code repository documentation, and inspect remote project specs directly from your shell environment.
To maintain an efficient shell configuration:
- Standardize your terminal visual configuration by setting
GLOW_STYLEandPAGERinside your~/.bashrcshell profile. - Use
glow -pwhen reading large files locally to preserve line scrolling and prevent stdout overflow. - Leverage pipeline streams (
curl ... | glow -) to inspect remote script instructions securely before execution. - Organize frequent reference guides and technical cheat sheets into your local stash using
glow stash.
For complete source code configurations, custom theme specifications, and upstream releases, visit the official Charm Glow GitHub Repository.
Frequently Asked Questions
How do I force Glow to open Markdown files in a scrollable pager by default?
Pass the -p or --pager flag when invoking Glow (for example, glow -p file.md). To apply this behavior permanently, create a shell alias inside your ~/.bashrc file: alias glow='glow -p'.
Can Glow render embedded image graphics inside the terminal?
Glow does not render graphical raster images directly inside standard ASCII terminal environments. When encountering Markdown image syntax (), Glow displays styled textual alt-caption representations and hyperlinked image URLs within the rendered terminal output.
What is the difference between Glow and traditional utilities like Bat or Mdcat?
While utilities like bat focus primarily on file viewing with line numbers and standard code syntax highlighting, Glow is specifically designed for rendering structured Markdown syntax. Glow provides full table alignment, structural header scaling, list formatting, local document stashes, and an interactive full-screen TUI browser.
How do I configure Glow to automatically match my terminal light or dark theme?
You can set Glow to automatically adapt to system backgrounds by passing the auto style flag: glow -s auto README.md. Alternatively, set export GLOW_STYLE="auto" in your ~/.bashrc shell environment file.
Is it possible to edit Markdown files directly from within the Glow terminal interface?
Glow operates primarily as a document reader and terminal browser. While you can view, search, and stash documents inside the interactive TUI, editing files requires opening the document in a dedicated terminal text editor such as Neovim, Vim, or Nano.