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 themeList supported languages and themes
cmdop highlight --list-languages
cmdop highlight --list-themesDefault theme is monokai. Bundled themes include dracula, solarized-dark, solarized-light, gruvbox, nord, one-dark, github.
Flags
| Flag | Description |
|---|---|
-n, --line-numbers | Show line numbers |
-l, --language <lang> | Force language (auto-detect by default) |
-t, --theme <theme> | Color theme (default: monokai) |
--list-languages | List supported languages |
--list-themes | List 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.yamlThe alias is added to your shell rc file (~/.zshrc, ~/.bashrc). Disable it with:
cmdop register --no-aliases
cmdop connect --no-aliasesCombining with files
# Pull a remote file and highlight it locally
cmdop files cat vps-audi:/etc/nginx/nginx.conf | cmdop highlight -l nginxInside 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.
Related
Last updated on