Skip to content

Getting started

Install dog, highlight a file, change themes, and optionally wire it into fzf as a previewer.

Install

The quick ways — install script picks the right build for your machine, installs it, and sets up shell completions:

sh
curl -fsSL https://sh.dog/install | sh

Or Homebrew:

sh
brew tap edden27/dog
brew trust edden27/dog
brew install dog

TIP

All installation options, including prebuilt binaries, building from source, custom language subsets, and no-sudo installs, can be found here.


Verify:

sh
dog --version

Expected output:

0.1.0

TIP

Tab completions are set up for you if you installed via the script or Homebrew. Installed another way? dog can generate them for your shell in one command.

First highlight

Try dog right away — no file needed:

sh
echo 'struct Woof { let barks: Int, goodBoy: Bool = true }' | dog -l swift

TIP

dog reads from stdin when no file argument is given. The -l flag tells it the language since there's no filename to detect from. See configuration for the full flag.

Point dog at a file in one of the 17 supported languages:

sh
dog Sources/dog/Dog.swift

dog auto-detects the language and shows you the file rendered in the default UtilityDark theme.

Change themes

Flip to the light built-in with --light:

sh
dog --light Sources/dog/Dog.swift

List what's available:

sh
dog --list-themes

You'll see the two built-ins (UtilityDark and UtilityBright) plus any themes in ~/.config/dog/themes/.


Any Zed-format theme works — download one into ~/.config/dog/themes/ and it shows up in --list-themes, or point --theme-dir at your existing Zed themes:

sh
dog --theme-dir ~/.config/zed/themes --theme 'Catppuccin Mocha' Sources/dog/Dog.swift

TIP

For picking, installing, and authoring themes, see Theming.


Make a theme your default with --set-default-theme — every run uses it from then on, no --theme needed:

sh
dog --set-default-theme 'Catppuccin Mocha'

TIP

For setting, clearing, and how the default theme works, see Theming.

Watch the pager kick in

Highlight a long file. When the output exceeds your terminal height, dog hands off to less -R:

sh
dog /path/to/long-file.rs

Quit the pager with q. Disable the pager with -P or --paging=never:

sh
dog -P /path/to/long-file.rs

See pager behavior for the full matrix.

Use dog as a file previewer

dog's ~5ms startup shines when used with tools that use preview commands.

sh
fzf --preview 'dog --color=always {}'
sh
tv files -p 'dog --color=always {}'
sh
# Install the dog.yazi plugin, then register it — see the tip below
ya pkg add edden27/dog

Navigate files with the arrow keys. The preview pane renders each file with the current theme. Exit with Esc.

Two flags worth knowing when piping into a previewer:

  • --color=always — forces ANSI color through the pipe. Without it, the previewer receives plain text.
  • --wrap=never — optional. dog already defaults to no-wrap when piped into a previewer. Pass this explicitly to force that behavior.
sh
fzf --preview 'dog --color=always --wrap=never {}'

TIP

For ways to use dog with fzf, tv, yazi, and ripgrep — including recipes that also set a theme or language filter — check out Integrate dog.

Where to go next


🦮 Dog Fact

Scientific proof confirms your dog's devotion is genuine love.