Skip to content

ZhouYinLong-lab/Dog-RigLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Bash Claude Code Zero Dependencies Platform License CI

๐Ÿ• RigLine

The first Claude Code statusline with real-time GPU & system monitoring
Pure Bash ยท Zero Dependencies ยท Windows-Native ยท CJK-Aware

Screenshot


What is RigLine?

RigLine is a pure Bash status line for Claude Code that monitors your machine's vital signs alongside your coding session. Built for AI/ML developers who want to keep an eye on their GPU, VRAM, CPU, and RAM while working with Claude.

No npm. No pip. No Go. No Rust. No Deno. Just Bash and jq.

โœฆ MODEL Claude Opus 4.8  ยท  โŒ‚ DIR ~/projects  ยท  โ‡‹ GIT main
โ—‰ CPU  12% ยท โฌข GPU   8% ยท โฌก VRAM 3.8G/11.9G ยท โŠ˜ TEMP 48C ยท โŠ— RAM 20.1G/31.5G
โ—” CTX  62% ยท โ– CACHE 40% ยท โ‡… TDK 45k^ 8.2kv ยท โ—ท TIME 5m ยท โŒ˜ TIP  Keep shipping!
ctx โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 62% used

Features

  • ๐ŸŽฎ GPU Monitoring โ€” utilization, VRAM usage, and temperature via nvidia-smi
  • ๐Ÿ’ป CPU & RAM โ€” real-time usage with precise formatting
  • ๐Ÿ“Š Context Window โ€” visual progress bar with color thresholds (green โ†’ yellow โ†’ red)
  • ๐Ÿ’ฐ Token Tracking โ€” input/output tokens with smart formatting (k/m)
  • โฑ๏ธ Session Timer โ€” know how long you've been working
  • ๐ŸŒฟ Git Integration โ€” branch name with dirty-state indicator (*)
  • ๐Ÿง  CJK-Aware โ€” proper display width handling for Chinese/Japanese/Korean characters
  • ๐ŸŽจ N-width Icons โ€” every icon is guaranteed single-width, perfectly aligned on East Asian terminals
  • ๐Ÿ”Œ Zero Dependencies โ€” only needs bash, nvidia-smi (optional), and jq
  • ๐ŸชŸ Windows-Native โ€” PowerShell-based system metrics, works out of the box on Windows 11

Quick Install

Option 1: One-liner

curl -fsSL https://raw.githubusercontent.com/ZhouYinLong-lab/Dog-RigLine/main/install.sh | bash

Option 2: Manual

# Clone the repo
git clone https://github.com/ZhouYinLong-lab/Dog-RigLine.git ~/.claude/rigline

# Add to Claude Code config (~/.claude/settings.json)
jq '.statusLine = {"type": "command", "command": "bash ~/.claude/rigline/rigline.sh"}' \
   ~/.claude/settings.json > /tmp/cfg.json && mv /tmp/cfg.json ~/.claude/settings.json

Then restart Claude Code to see your new status line.


Requirements

Component Required? Purpose
bash 4+ โœ… Required Script runtime
jq โœ… Required JSON parsing (Claude Code sends status as JSON)
nvidia-smi โš ๏ธ Optional GPU metrics (shows N/A if not available)
powershell ๐ŸชŸ Windows only CPU/RAM metrics via Get-CimInstance
git โš ๏ธ Optional Branch name display (shows no-git if not in a repo)

Usage

Once installed, RigLine runs automatically as your Claude Code status line. There's nothing to launch โ€” it appears at the bottom of every Claude Code session.

Environment Variables

Customize RigLine's behavior by setting these environment variables before launching Claude Code:

Variable Default Description
RIGLINE_TIP ไฟๆŒๆญฃๅฟต๏ผ The motivational tip shown on line 3 (supports CJK)
RIGLINE_BAR_WIDTH 30 Width of the context window progress bar in characters
NO_COLOR (unset) Set to any value to disable all ANSI color output

Examples:

# Change the tip message (macOS/Linux)
export RIGLINE_TIP="Ship it! ๐Ÿš€"

# Change the tip message (Windows PowerShell)
$env:RIGLINE_TIP = "Stay focused!"

# Wider progress bar
export RIGLINE_BAR_WIDTH=40

# Disable colors (useful for light terminals)
export NO_COLOR=1

Status Line Layout

RigLine renders 4 lines, refreshed every time Claude Code updates:

Line Content
Line 1 Model name ยท Working directory ยท Git branch
Line 2 CPU usage ยท GPU utilization ยท VRAM usage ยท GPU temp ยท RAM usage
Line 3 Context % ยท Cache hit rate ยท Tokens in/out ยท Session time ยท Tip
Line 4 Context window progress bar with percentage

Color Thresholds

The context window progress bar changes color automatically:

  • ๐ŸŸข Green โ€” 0โ€“59% (healthy, plenty of room)
  • ๐ŸŸก Yellow โ€” 60โ€“79% (getting full, consider /compact)
  • ๐Ÿ”ด Red โ€” 80โ€“100% (almost full, run /compact soon)

Customizing Colors

Edit the C_* variables at the top of rigline.sh to change any color. Colors use 256-color ANSI codes (values 0โ€“255):

C_MINT=$'\033[38;5;121m'    # CPU, Context โ€” change 121 to any 256-color index
C_PURPLE=$'\033[38;5;183m'  # GPU
C_YELLOW=$'\033[38;5;221m'  # VRAM, Cache
C_PEACH=$'\033[38;5;216m'   # Temp, Model, TIP
C_BLUE=$'\033[38;5;117m'    # RAM, Time
C_GREEN=$'\033[38;5;114m'   # Bar (low) โ€” edit bar() thresholds too
C_RED=$'\033[38;5;203m'     # Bar (high)
C_MUTED=$'\033[38;5;245m'   # Separator dots
C_TEXT=$'\033[38;5;230m'    # Metric values

๐Ÿ’ก Want different icons? Check out icons.md โ€” 130+ N-width Unicode icons across 13 slots with 5 ready-to-use theme presets.


Uninstall

# Remove the script
rm -rf ~/.claude/rigline

# Remove from Claude Code config
jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/cfg.json && mv /tmp/cfg.json ~/.claude/settings.json

Troubleshooting

Status line shows "no-git" even though I'm in a repo

Make sure git is in your PATH and you're in a git worktree. RigLine reads the working directory from Claude Code's JSON input โ€” it uses the project directory, not your shell's $PWD.

GPU metrics show N/A

  • Make sure nvidia-smi is installed and working: run nvidia-smi in a terminal
  • If you don't have an NVIDIA GPU, the N/A display is expected
  • AMD GPUs and Apple Silicon are not yet supported (contributions welcome!)

CPU/RAM shows N/A (Windows)

PowerShell must be available. If you're using Git Bash, make sure powershell.exe is in your PATH.

CJK characters look misaligned

RigLine uses manual width calculation for CJK text. If your terminal uses a font where CJK characters are not exactly 2ร— width, you may see slight misalignment. Try a patched Cascadia Code or Hack font.

Colors look wrong on light terminal

Set NO_COLOR=1 before launching Claude Code to disable colors entirely.


Why "RigLine"?

A rig is what AI/ML developers call their GPU workstations. RigLine monitors your rig while you build.


Similar Projects

Project Language GPU Monitor CJK Support Zero Deps
RigLine Bash โœ… โœ… โœ…
ccstatusline Node.js โŒ โŒ โŒ
claude-statusline Go โŒ โŒ โŒ
cc-statusline Rust โŒ โŒ โŒ
c-c-statusline Deno โŒ โŒ โŒ

Testing

RigLine includes a snapshot test suite:

# Run all tests
bash test/run.sh

# Update snapshots after intentional changes
bash test/run.sh --update

Tests cover: normal input, empty JSON, boundary values (150% ctx, 999k tokens), malformed JSON, zero values, CJK paths, and small values. CI runs on Ubuntu, macOS, and Windows via GitHub Actions.


Contributing

PRs welcome! Especially for:

  • Linux/macOS native system metrics (/proc/stat, sysctl, vm_stat)
  • AMD GPU support (rocm-smi)
  • Apple Silicon GPU support
  • Additional widgets (network I/O, disk usage, battery)
  • Theme presets (dracula, solarized, tokyo-night)

Repository Structure

dog-rigline/
โ”œโ”€โ”€ rigline.sh               # The status line script (~420 lines of pure Bash)
โ”œโ”€โ”€ install.sh               # One-line installer
โ”œโ”€โ”€ icons.md                 # 130+ alternative icons with 5 theme presets
โ”œโ”€โ”€ screenshot.png           # Screenshot for the README
โ”œโ”€โ”€ test/                    # Snapshot test suite (7 fixtures + snapshots)
โ”‚   โ”œโ”€โ”€ run.sh               #   Test runner (--update to regenerate)
โ”‚   โ”œโ”€โ”€ fixtures/            #   Known JSON inputs
โ”‚   โ””โ”€โ”€ snapshots/           #   Expected ANSI output
โ”œโ”€โ”€ .github/workflows/ci.yml # CI: lint + test on ubuntu/macOS/windows
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .gitattributes
โ”œโ”€โ”€ LICENSE                  # MIT License
โ””โ”€โ”€ README.md                # You are here

License

MIT ยฉ 2025 ZhouYinLong-lab


Built with โค๏ธ for the AI/ML community

About

๐Ÿ• Pure Bash statusline for Claude Code with real-time GPU & system monitoring. Zero dependencies. Windows/Linux/macOS. CJK-aware.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages