DevOps Patterns
These are kitty workflows for real server administration, designed for reliability and repeatability.
Core Idea
Kitty's value in DevOps comes from four things: GPU-accelerated multi-window views, kittens for inline data (images, diffs), SSH terminfo forwarding, and scriptable remote control.
Pattern 1: Server Health Dashboard
Monitor a server's health from a single kitty tab with tiled windows:
~/bin/healthdash.sh
#!/bin/bash
# Create a health monitoring tab in the current kitty window
# Launch the main monitoring layout
kitty @ launch --type=tab --title "health"
kitty @ launch --type=window --location=hsplit
kitty @ launch --type=window --location=vsplit
kitty @ launch --type=window --location=vsplit
# Small delay for layout to settle
sleep 0.3
# Send commands to each window
kitty @ send-text --match-title health -m "title:health" "htop\n"
kitty @ send-text --match-title health -m "title:health" "watch -n 3 df -h\n"
kitty @ send-text --match-title health -m "title:health" "watch -n 3 free -h\n"
kitty @ send-text --match-title health -m "title:health" "tail -f /var/log/syslog\n"
echo "Health dashboard created in new tab"
Pattern 2: Deployment Workspace
A deployment tab with role-isolated windows:
~/bin/deploy-tab.sh
#!/bin/bash
APP_DIR="/srv/myapp"
kitty @ launch --type=tab --title "deploy"
kitty @ launch --type=window --location=hsplit
kitty @ launch --type=window --location=vsplit
kitty @ send-text --match-title deploy "cd $APP_DIR && echo 'Ready to deploy'\n"
kitty @ send-text --match-title deploy "watch systemctl status myapp.service\n"
kitty @ send-text --match-title deploy "tail -f $APP_DIR/logs/app.log\n"
echo "Deployment tab created"
Pattern 3: Incident Response Tab
When something is on fire, open a structured incident workspace:
~/bin/incident.sh
#!/bin/bash
TAB_TITLE="incident-$(date +%Y%m%d-%H%M)"
kitty @ launch --type=tab --title "$TAB_TITLE"
# Window 1: triage (htop)
kitty @ send-text --match-title "$TAB_TITLE" "htop\n"
# Window 2: logs (split)
kitty @ launch --type=window --location=vsplit
kitty @ send-text --match-title "$TAB_TITLE" "journalctl -f -u myapp.service\n"
# Window 3: error logs
kitty @ launch --type=window --location=hsplit
kitty @ send-text --match-title "$TAB_TITLE" "tail -f /var/log/nginx/error.log\n"
echo "Incident tab '$TAB_TITLE' created — naming creates an automatic audit trail"
Pattern 4: Multi-Server SSH in Windows
Open SSH connections to multiple servers in a single tab:
~/bin/multiserver.sh
#!/bin/bash
SERVERS=("web01" "web02" "db01" "cache01")
kitty @ launch --type=tab --title "servers"
kitty @ send-text --match-title servers "ssh ${SERVERS[0]}\n"
for SERVER in "${SERVERS[@]:1}"; do
kitty @ launch --type=window --location=hsplit
kitty @ send-text --match-title servers "ssh $SERVER\n"
done
echo "Multi-server tab opened with ${#SERVERS[@]} connections"
Pattern 5: Long-Running Job Monitoring
For jobs that take hours:
~/bin/longrun.sh
#!/bin/bash
LOG_FILE="/var/log/backup.log"
kitty @ launch --type=tab --title "longrun"
# Window for the job itself
kitty @ send-text --match-title longrun \
"time rsync -avz /data /backup 2>&1 | tee $LOG_FILE\n"
# Second window for monitoring progress
kitty @ launch --type=window --location=vsplit
kitty @ send-text --match-title longrun \
"tail -f $LOG_FILE\n"
echo "Long-running job tab created"
Using Kitty SSH for Remote Sessions
# Connect to remote with full kitty support
kitty +kitten ssh admin@prod-server
# Inside the SSH session, you can still use remote control
kitty @ launch --type=window --cwd=current
kitty @ send-text --match-title "prod" "htop\n"
Session Management for Different Environments
~/.bashrc
# Quick-launch aliases
alias dev="kitty @ launch --type=tab --title dev && \
kitty @ send-text --match-title dev 'cd ~/projects/myapp\n'"
alias staging="kitty @ launch --type=tab --title staging && \
kitty @ send-text --match-title staging 'ssh deploy@staging.example.com\n'"
alias prod="kitty +kitten ssh admin@prod.example.com"
Workflow Summary
| Pattern | Windows | Layout | Use Case |
|---|---|---|---|
| Health dashboard | 4 | 2x2 tiled | Real-time server monitoring |
| Deployment workspace | 3 | Main-vertical | Zero-downtime deploys |
| Incident response | 3 | Separate windows | Emergency triage |
| Multi-server SSH | N | Horizontal split | Parallel server access |
| Long-running job | 2 | Vertical split | Backup or build monitoring |
Common Pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
kitty @ commands not found | Remote control disabled | Must set allow_remote_control yes in kitty.conf |
| Window title matching wrong window | Command sent to incorrect window | Use unique titles and verify with kitty @ ls |
| Timing issues with layout | Commands run before window created | Add sleep 0.3 between launch and send-text |
| SSH kitten not needed for local | Unnecessary overhead | Use plain ssh for kitty-to-kitty connections |
Hands-On Practice
# Test the health dashboard pattern manually
kitty @ launch --type=tab --title "practice"
kitty @ launch --type=window --location=hsplit
kitty @ launch --type=window --location=vsplit
kitty @ launch --type=window --location=vsplit
# Verify layout
kitty @ ls
# Send practice commands
kitty @ send-text --match-title practice "echo 'Pane 1'\n"
kitty @ send-text --match-title practice "echo 'Pane 2'\n"
kitty @ send-text --match-title practice "echo 'Pane 3'\n"
kitty @ send-text --match-title practice "echo 'Pane 4'\n"