Skip to main content

Kitten Commands Reference

Kittens are auxiliary programs that ship with kitty. They extend kitty's functionality for tasks like image display, file comparison, theme management, SSH, and remote control.

Learning Focus

Kittens are launched with kitty +kitten <name>. They inherit kitty's terminal capabilities, so they can use kitty-specific protocols (images, hyperlinks, etc.) even over SSH.

Image Display: icat

Display images directly in the terminal.

# Basic image display
kitty +kitten icat image.png

# Display with specific size
kitty +kitten icat --scale-up --place 80x40@0x0 image.png

# Display multiple images
kitty +kitten icat image1.jpg image2.jpg

# Image from stdin
curl -s https://example.com/image.png | kitty +kitten icat

# Clear displayed images
kitty +kitten icat --clear
OptionDescription
--scale-upScale image up to fill available space
--place WxH@XxYPlace at specific position and size (cell units)
--stdin noRead from stdin (default: auto-detect)
`--align leftcenter
`--transfer-mode filestream
--clearRemove all displayed images
--print-window-sizePrint terminal window dimensions

File Comparison: diff

Visual diff tool using kitty's terminal hyperlinks.

# Compare two files
kitty +kitten diff file1.txt file2.txt

# Compare with context
kitty +kitten diff --context 5 file1.txt file2.txt

# Diff directories
kitty +kitten diff dir1/ dir2/

# Use with git
git diff --no-index file1.txt file2.txt | kitty +kitten diff
OptionDescription
--context NContext lines around changes (default: 3)
--ignore-all-spaceIgnore whitespace changes
--ignore-blank-linesIgnore blank line changes
--recursiveRecursively diff directories
--exclude PATTERNExclude files matching pattern

Theme Management: themes

Browse and apply color themes interactively.

# Browse and select a theme
kitty +kitten themes

# List all available themes
kitty +kitten themes --list

# Preview a specific theme
kitty +kitten themes --theme="Solarized Dark"

# Apply theme via config
kitty +kitten themes --reload-in=parent

# Cache themes for offline use
kitty +kitten themes --cache-update
OptionDescription
--listList all themes without interactive UI
--theme NAMEApply theme directly (no interactive)
`--reload-in=parentchild`
--cache-updateUpdate theme cache from GitHub

Text Selection / Actions: hints

Select visible text on screen and perform actions (copy, open, insert).

# Copy a visible path/filename
kitty +kitten hints

# Open a URL
kitty +kitten hints --type url

# Copy a specific pattern
kitty +kitten hints --type path --program @copy

# Hyperlink grep results
kitty +kitten hints --type grep --program @open

# Custom type (regex match)
kitty +kitten hints --customize "regex:0x[0-9a-fA-F]+"
OptionDescription
--type url|path|line|word|hash|grepWhat to select
--program @copy|@open|@pasteWhat to do with selection
--customize PATTERNCustom regex hint type
--multipleSelect multiple items sequentially
--terminalUse terminal to display choices

SSH with Terminfo: ssh

SSH into a remote host with automatic terminfo transfer.

# Basic SSH (transfers xterm-kitty terminfo)
kitty +kitten ssh user@host

# With ports and options
kitty +kitten ssh -p 2222 user@host

# Command mode
kitty +kitten ssh user@host "tail -f /var/log/syslog"

# Verbose debug
kitty +kitten ssh -v user@host

# With X11 forwarding
kitty +kitten ssh -X user@host
OptionDescription
-p PORTSSH port
-vVerbose output
-XEnable X11 forwarding
-AEnable agent forwarding
-i KEYIdentity file
-o OPTIONSAdditional SSH options
--ssh-transferred-filesPath for transferred files

The SSH kitten is superior to plain ssh because it:

  1. Transfers the xterm-kitty terminfo to the remote host automatically
  2. Enables true color, italic, and kitty protocol features on remote sessions
  3. Supports image transfer over SSH (with --remote-pwd)

File Transfer: transfer

Transfer files between kitty instances or to remote hosts.

# Send file to remote via SSH
kitty +kitten transfer local-file.txt user@host:/remote/path/

# Receive file from remote
kitty +kitten transfer user@host:/remote/file.txt ./local-dir/

# Transfer between kitty instances
kitty +kitten transfer --direction send /path/to/file

# With compression
kitty +kitten transfer --compress local-file.txt user@host:~/files/

File Selection: choose-files

Interactive file chooser dialog in the terminal.

# Basic file selection
kitty +kitten choose-files

# Multiple file selection
kitty +kitten choose-files --multiple

# Start in specific directory
kitty +kitten choose-files --cwd /var/log

# Filter by type
kitty +kitten choose-files --pattern "*.log"

# Output as JSON
kitty +kitten choose-files --json

Clipboard Access: clipboard

Read and write the system clipboard.

# Show clipboard contents
kitty +kitten clipboard

# Write to clipboard
echo "hello" | kitty +kitten clipboard

# Read clipboard
kitty +kitten clipboard --get-clipboard

# Write to primary selection (X11)
echo "text" | kitty +kitten clipboard --primary

Multi-Window Input: broadcast

Send input to multiple kitty windows simultaneously.

# List broadcast groups
kitty +kitten broadcast

# Send command to all windows
kitty +kitten broadcast "ls -la"

# Send to specific windows by ID
kitty +kitten broadcast --match id:1,id:2 "echo hello"

# Send control character
kitty +kitten broadcast --send-keys "Ctrl+c"

# Toggle broadcast mode for active windows
kitty +kitten broadcast --toggle

# Create named broadcast group
kitty +kitten broadcast --group servers "uptime"
OptionDescription
--match PATTERNMatch windows (id:, title:, env:, etc.)
--group NAMEBroadcast to named group
--toggleToggle broadcast mode on/off
--send-keys KEYSSend specific key events

Desktop Panel: panel

Create a kitty desktop panel (like a dock widget).

# Show system info panel
kitty +kitten panel htop

# Show clock panel
kitty +kitten panel --clock

# Custom command panel
kitty +kitten panel --title "watch" "watch -n 1 date"

# Panel placement
kitty +kitten panel --placement top-left --size 400x200 htop

Hyperlinked Grep: hyperlinked_grep

Run grep with clickable hyperlinks to files.

# Basic grep with hyperlinks
kitty +kitten hyperlinked_grep "pattern" src/

# With line numbers
kitty +kitten hyperlinked_grep -n "pattern" src/

# Recursive with context
kitty +kitten hyperlinked_grep -rn -C 3 "function" src/

# Use with hints to open results
kitty +kitten hyperlinked_grep "TODO" . | kitty +kitten hints

Remote Control: kitten @

Control a running kitty instance programmatically.

# List all windows/tabs
kitty @ ls

# Create new window
kitty @ new-window --cwd /var/log --title logs

# Create new tab
kitty @ new-tab --tab-title "monitoring"

# Send text to a window
kitty @ send-text --match title:logs "tail -f syslog\n"

# Set colors dynamically
kitty @ set-colors --match all foreground=#ffffff

# Get current colors
kitty @ get-colors

# Resize window
kitty @ resize-window --match id:1 --axis horizontal --increment 20

# Focus specific window
kitty @ focus-window --match title:logs

# Close window
kitty @ close-window --match id:3

# Load config
kitty @ load-config

# Get remote control help
kitty @ --help
CommandDescriptionCommon Options
lsList all windows/tabs
new-windowCreate new window--cwd, --title, --match, --location
new-tabCreate new tab--tab-title, --cwd
close-windowClose window--match, --all
send-textSend text to window--match, stdin
set-colorsChange colors--match, foreground=, background=
get-colorsGet current colors--match
resize-windowResize window--axis, --increment, --match
focus-windowFocus window--match
load-configReload config
set-tab-titleSet tab title--match, title string
set-window-titleSet window title--match, title string

Kitten Quick Reference Table

KittenCommandPrimary Use
icatkitty +kitten icat <file>Display images in terminal
diffkitty +kitten diff <a> <b>Visual file comparison
themeskitty +kitten themesBrowse and apply themes
hintskitty +kitten hints --type <type>Click-to-select visible text
sshkitty +kitten ssh <user>@<host>SSH with auto terminfo
transferkitty +kitten transfer <src> <dst>File transfer with progress
choose-fileskitty +kitten choose-filesInteractive file picker
clipboardkitty +kitten clipboardClipboard read/write
broadcastkitty +kitten broadcast <text>Multi-window input
panelkitty +kitten panel <cmd>Desktop panel widget
hyperlinked_grepkitty +kitten hyperlinked_grep <pat> <dir>Grep with clickable results
query_terminalkitty +kitten query_terminalQuery terminal capabilities
benchmarkkitty +kitten benchmarkPerformance benchmark
@ (remote)kitty @ <command>Programmatic kitty control

Common Pitfalls

PitfallSymptomFix
icat shows garbled outputImage protocol blocked by tmuxExit tmux or use kitty +kitten icat directly
themes can't fetch listNo internet connectionUse --cache-update when online, then themes works offline
ssh fails with "not a kitty terminal"Called from non-kitty terminalAlways use inside kitty or set TERM=xterm-kitty
broadcast sends to wrong windowsMatch pattern too looseUse --match id:1,id:2 instead of title matching
remote control commands failallow_remote_control not setSet allow_remote_control yes and restart kitty
clipboard read permission deniedclipboard_control restricts readsSet clipboard_control read-clipboard write-clipboard
diff shows no outputFiles are identicaldiff only shows when differences exist
hyperlinked_grep links not clickableNot inside kittyOnly works in kitty (uses kitty hyperlink protocol)

Hands-On Practice

# 1. Test icat with kitty's own icon (if available)
kitty +kitten icat /usr/share/icons/hicolor/48x48/apps/kitty.png 2>/dev/null || echo "icat unavailable (not in kitty or no image)"

# 2. Browse themes
kitty +kitten themes

# 3. Compare two files
echo "hello" > /tmp/a.txt
echo "world" > /tmp/b.txt
kitty +kitten diff /tmp/a.txt /tmp/b.txt

# 4. Test clipboard
echo "kitty test" | kitty +kitten clipboard

# 5. List remote control info
kitty @ ls 2>/dev/null || echo "Remote control not enabled (set allow_remote_control yes)"

# 6. Benchmark your kitty
kitty +kitten benchmark

# 7. Query terminal capabilities
kitty +kitten query_terminal | head -15

What's Next