mirror of
https://github.com/theniceboy/.config.git
synced 2025-12-26 14:44:57 +08:00
claude status
This commit is contained in:
parent
955c0656e6
commit
8fd95dbf47
2 changed files with 15 additions and 6 deletions
8
claude/scripts/statusline.sh
Normal file
8
claude/scripts/statusline.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Read the JSON input from stdin
|
||||
input=$(cat)
|
||||
|
||||
# Pass the input to both commands and concatenate their outputs
|
||||
echo "$input" | ccusage statusline
|
||||
echo "$input" | ccstatusline
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"model": "opusplan",
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "printf '%s | %s | %s' \"$(ccusage statusline | tr -d '\\n')\" \"$(pwd | sed \"s|$HOME|~|\" | sed 's|.*/\\([^/]*/[^/]*\\)$|\\1|')\" \"$(git status --porcelain 2>/dev/null | awk 'BEGIN{staged=0; modified=0; untracked=0} /^M/{staged++} /^.M/{modified++} /^\\?\\?/{untracked++} END{if(staged+modified+untracked>0) printf \"git: %s%s%s\", (staged>0?staged\"s\":\"\"),(modified>0?modified\"m\":\"\"),(untracked>0?untracked\"u\":\"\"); else printf \"git: clean\"}' || printf 'not a git repo')\""
|
||||
}
|
||||
}
|
||||
"model": "opusplan",
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "bash ~/.config/claude/scripts/statusline.sh",
|
||||
"padding": 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue