Skip to Content

cmdop highlight

Display files with syntax highlighting in your terminal. Like cat but pretty.

Basic usage

cmdop highlight main.py cmdop highlight main.py main.go README.md # multiple files cmdop highlight -n config.yaml # line numbers cmdop highlight -l python script # force language cmdop highlight -t dracula main.go # different theme

List supported languages and themes

cmdop highlight --list-languages cmdop highlight --list-themes

Default theme is monokai. Bundled themes include dracula, solarized-dark, solarized-light, gruvbox, nord, one-dark, github.

Flags

FlagDescription
-n, --line-numbersShow line numbers
-l, --language <lang>Force language (auto-detect by default)
-t, --theme <theme>Color theme (default: monokai)
--list-languagesList supported languages
--list-themesList available themes

The ccat shell alias

When you run cmdop register or cmdop connect, cmdop auto-installs a shell alias ccat:

ccat main.py # same as: cmdop highlight main.py ccat -n config.yaml

The alias is added to your shell rc file (~/.zshrc, ~/.bashrc). Disable it with:

cmdop register --no-aliases cmdop connect --no-aliases

Combining with files

# Pull a remote file and highlight it locally cmdop files cat vps-audi:/etc/nginx/nginx.conf | cmdop highlight -l nginx

Inside chat output

The chat surface uses the same renderer for code blocks. If you set a theme via cmdop highlight -t <theme>, that theme also applies to code in chat replies.

Auto-detection

If no -l is passed, cmdop detects language by file extension first, then by content (shebang, MIME). Falls back to plain text on miss.

Last updated on