Skip to main content

Overview

Proxy for git commands with token-optimized output. Supports all git flags and subcommands with specialized filtering for common operations.

Syntax

rtk git [GLOBAL_OPTIONS] <SUBCOMMAND> [ARGS...]

Global Options

All git global options are supported and passed through correctly:
-C <path>
string
Run as if git was started in <path> (can be repeated)
-c <key>=<value>
string
Override git config for this command
--git-dir <path>
string
Set path to .git directory
--work-tree <path>
string
Set path to working tree
--no-pager
flag
Disable pager output
--no-optional-locks
flag
Skip optional locks
--bare
flag
Treat repository as bare

Optimized Subcommands

rtk git status

Compact status with grouped changes.
rtk git status [FLAGS]
Output:
📌 main...origin/main
✅ Staged: 2 files
   src/main.rs
   src/lib.rs
📝 Modified: 1 files
   Cargo.toml
❓ Untracked: 3 files
   temp.txt
   debug.log
   ... +1 more
Token savings: 70%

rtk git log

One-line commit history with auto-truncation.
rtk git log [FLAGS]
Default flags applied:
  • --pretty=format:%h %s (%ar) <%an> (if not specified)
  • -10 (if no limit specified)
  • --no-merges (unless --merges requested)
Output:
abc1234 Add feature (2 days ago) <author>
def5678 Fix bug (1 week ago) <other>
Token savings: 60%

rtk git diff

Stat summary + compacted diff.
rtk git diff [FLAGS]
Output:
src/main.rs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

--- Changes ---
📄 src/main.rs
  @@ -42,3 +42,4 @@ fn main() {
  +    println!("new line");
  +5 -6
Flags:
  • --stat - Show only stat (no diff)
  • --no-compact - Disable RTK compacting
Token savings: 80%

rtk git show

Commit summary + stat + compacted diff.
rtk git show [COMMIT] [FLAGS]
Output:
abc1234 Add feature (2 days ago) <author>
src/main.rs | 5 +++--

📄 src/main.rs
  @@ -10,2 +10,3 @@
  +    new_code();
Special cases:
  • git show rev:path - Shows blob content (no diff formatting)
  • --stat - Shows only stat
  • --pretty=... - Custom format (no RTK filtering)
Token savings: 80%

rtk git add/commit/push/pull

Ultra-compact confirmations.
rtk git add [FILES...]
rtk git commit -m "message"
rtk git push [REMOTE] [BRANCH]
rtk git pull [REMOTE] [BRANCH]
Outputs:
ok ✓ 3 files changed, 10 insertions(+), 2 deletions(-)
ok ✓ abc1234
ok ✓ origin/main
ok ✓ 5 files +20 -10
Token savings: 59%

rtk git branch

Compact branch list with remote-only section.
rtk git branch [FLAGS]
Output:
* main
  develop
  feature/auth
  remote-only (2):
    release/v2
    hotfix/bug
Token savings: 65%

rtk git fetch/stash/worktree

rtk git fetch [REMOTE]
rtk git stash [list|show|pop|apply|drop|push]
rtk git worktree [list|add|remove]
All operations have compact output formats with essential info preserved.

Passthrough Support

Any git subcommand not listed above is passed through unchanged:
rtk git tag --list      # Full output
rtk git remote -v       # Full output
rtk git bisect start    # Full output
Savings: 0% (raw git output, but usage tracked)

Token Savings Summary

CommandSavings
status70%
log60%
diff80%
show80%
add/commit/push/pull59%
branch65%
fetch/stash/worktree60-70%
rtk git status
# 📌 main...origin/main
# ✅ Staged: 2 files

Exit Codes

All git exit codes are preserved:
  • 0 - Success
  • 1 - Generic error
  • 128+N - Fatal error
  • rtk gh - GitHub CLI operations
  • rtk diff - Universal diff command
  • rtk log - Log file filtering