Skip to content

Commit e7b619d

Browse files
duyetduyetbot
andcommitted
fix(commands): correct shell syntax and enhance statusline visualization
- Remove invalid `!` prefix from bash commands in commit/ and fix/ plugins - Update co-author email to bot@duyet.net - Add visual progress bars to statusline context and rate limits display Co-Authored-By: duyetbot <bot@duyet.net>
1 parent 0f9a12c commit e7b619d

6 files changed

Lines changed: 43 additions & 30 deletions

File tree

commit/commands/and-create-pr.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Create a semantic commit and open a pull request for the changes.
1616

1717
## Context
1818

19-
- Current Git status: !`git status`
20-
- Current Git diff (staged and unstaged changes): !`git diff HEAD --`
21-
- Current branch: !`git branch --show-current`
22-
- Default branch: !`git remote show origin | grep 'HEAD branch' | cut -d' ' -f5'
23-
- Recent commits: !`git log --oneline -5`
19+
- Current Git status: `git status`
20+
- Current Git diff (staged and unstaged changes): `git diff HEAD --`
21+
- Current branch: `git branch --show-current`
22+
- Default branch: `git remote show origin | grep 'HEAD branch' | cut -d' ' -f5'
23+
- Recent commits: `git log --oneline -5`
2424

2525
## Your task
2626

@@ -58,7 +58,7 @@ If current branch is NOT main/master:
5858
git add .
5959
git commit -m "type(scope): description
6060
61-
Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>"
61+
Co-Authored-By: duyetbot <bot@duyet.net>"
6262
```
6363

6464
### Step 4: Push Branch
@@ -149,7 +149,7 @@ git checkout -b feat/user-authentication
149149
git add .
150150
git commit -m "feat(auth): add user authentication flow
151151
152-
Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>"
152+
Co-Authored-By: duyetbot <bot@duyet.net>"
153153

154154
# Push new branch
155155
git push -u origin feat/user-authentication

commit/commands/and-push.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ description: Create a git commit with semantic commit message format and push to
77

88
## Context
99

10-
- Current Git status: !`git status`
11-
- Current Git diff (staged and unstaged changes): !`git diff HEAD --`
12-
- Current branch: !`git branch --show-current`
13-
- Recent commits: !`git log --oneline -10`
10+
- Current Git status: `git status`
11+
- Current Git diff (staged and unstaged changes): `git diff HEAD --`
12+
- Current branch: `git branch --show-current`
13+
- Recent commits: `git log --oneline -10`
1414

1515
## Your task
1616

commit/commands/commit.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ description: Create a git commit with semantic commit message format
77

88
## Context
99

10-
- Current Git status: !`git status`
11-
- Current Git diff (staged and unstaged changes): !`git diff HEAD --`
12-
- Current branch: !`git branch --show-current`
13-
- Recent commits: !`git log --oneline -10`
10+
- Current Git status: `git status`
11+
- Current Git diff (staged and unstaged changes): `git diff HEAD --`
12+
- Current branch: `git branch --show-current`
13+
- Recent commits: `git log --oneline -10`
1414

1515
## Your task
1616

17-
Based on the above changes, create a single Git commit.
17+
Based on the above changes, create one single or separated git commits.
1818

1919
You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
2020

fix/commands/and-create-pr.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ Fix any failing tests or issues on the current branch, commit the fixes, and cre
2626

2727
```bash
2828
# Current branch
29-
!`git branch --show-current`
29+
git branch --show-current
3030

3131
# Default branch (usually main or master)
32-
!`git remote show origin | grep 'HEAD branch' | cut -d' ' -f5`
32+
git remote show origin | grep 'HEAD branch' | cut -d' ' -f5
3333

3434
# Uncommitted changes
35-
!`git status --short`
35+
git status --short
3636

3737
# Commits ahead of base
38-
!`git log origin/$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)..HEAD --oneline 2>/dev/null || echo "Branch not pushed yet"`
38+
git log origin/$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)..HEAD --oneline 2>/dev/null || echo "Branch not pushed yet"
3939
```
4040

4141
## Execution Flow

fix/commands/and-update-pr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Fix failing CI checks, tests, or requested changes on an existing pull request,
2525

2626
```bash
2727
# Current branch
28-
!`git branch --show-current`
28+
`git branch --show-current`
2929

3030
# PR information (if PR number provided as $ARGUMENTS)
31-
!`gh pr view $ARGUMENTS --json number,title,url,state,statusCheckRollup,headRefName,baseRefName 2>/dev/null || echo "No PR number provided"`
31+
`gh pr view $ARGUMENTS --json number,title,url,state,statusCheckRollup,headRefName,baseRefName 2>/dev/null || echo "No PR number provided"`
3232

3333
# Or find PR for current branch
34-
!`gh pr view --json number,title,url,state,statusCheckRollup 2>/dev/null || echo "No PR found for current branch"`
34+
`gh pr view --json number,title,url,state,statusCheckRollup 2>/dev/null || echo "No PR found for current branch"`
3535
```
3636

3737
## Execution Flow

statusline/scripts/format-status.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@ function formatContext(metrics: SessionMetrics): string | null {
338338

339339
const usedK = formatTokenCount(used);
340340
const totalK = formatTokenCount(total);
341+
const bar = progressBar(percentage);
341342

342-
return `${color} ${percentage}% (${usedK}/${totalK})`;
343+
return `${color} ${bar} ${percentage}% (${usedK}/${totalK})`;
343344
}
344345

345346
function formatTokenCount(n: number): string {
@@ -348,6 +349,14 @@ function formatTokenCount(n: number): string {
348349
return `${n}`;
349350
}
350351

352+
/**
353+
* Generate a 10-char progress bar: ████░░░░░░
354+
*/
355+
function progressBar(pct: number): string {
356+
const filled = Math.min(10, Math.max(0, Math.round(pct / 10)));
357+
return "█".repeat(filled) + "░".repeat(10 - filled);
358+
}
359+
351360
function formatTools(metrics: SessionMetrics): string | null {
352361
if (!metrics.tools || Object.keys(metrics.tools).length === 0) return null;
353362

@@ -409,30 +418,34 @@ function formatRateLimits(rateLimits?: RateLimits): string | null {
409418
const z = rateLimits.zai;
410419
const parts: string[] = [];
411420

412-
// Token quota (5h equivalent)
413-
parts.push(`Tokens: ${z.tokens_pct}%`);
421+
// Token quota (5h equivalent) with bar
422+
const tBar = progressBar(z.tokens_pct);
423+
parts.push(`Tokens: ${tBar} ${z.tokens_pct}%`);
414424
if (z.token_reset) {
415425
parts.push(`reset: ${z.token_reset}`);
416426
}
417427

418-
// Monthly tool quota
428+
// Monthly tool quota with bar
419429
if (z.monthly_remaining > 0 || z.monthly_pct > 0) {
420430
const toolParts: string[] = [];
421431
if (z.search > 0) toolParts.push(`Search:${z.search}`);
422432
if (z.web > 0) toolParts.push(`Web:${z.web}`);
423433
if (z.zread > 0) toolParts.push(`ZRead:${z.zread}`);
424434

435+
const mBar = progressBar(z.monthly_pct);
425436
const toolStr = toolParts.length > 0 ? ` [${toolParts.join(" ")}]` : "";
426-
parts.push(`Tools: ${z.monthly_pct}% (${z.monthly_remaining} left)${toolStr}`);
437+
parts.push(`Tools: ${mBar} ${z.monthly_pct}% (${z.monthly_remaining} left)${toolStr}`);
427438
}
428439

429440
return `z.ai ${parts.join(" | ")}`;
430441
}
431442

432-
// Anthropic format (5h/7d)
443+
// Anthropic format (5h/7d) with bars
433444
const u5h = Math.round(rateLimits.five_hour);
434445
const u7d = Math.round(rateLimits.seven_day);
435-
return `5h: ${u5h}% | 7d: ${u7d}%`;
446+
const bar5 = progressBar(u5h);
447+
const bar7 = progressBar(u7d);
448+
return `5h: ${bar5} ${u5h}% | 7d: ${bar7} ${u7d}%`;
436449
}
437450

438451
export function formatStatus(metrics: SessionMetrics): FormattedStatus {

0 commit comments

Comments
 (0)