Skip to content

fix: update cli help text for checkout command#5

Merged
MusicMaster4 merged 1 commit into
mainfrom
testing
Jul 10, 2026
Merged

fix: update cli help text for checkout command#5
MusicMaster4 merged 1 commit into
mainfrom
testing

Conversation

@MusicMaster4

Copy link
Copy Markdown
Owner

Summary

  • Updated CLI help text for checkout command to reflect the ck alias
  • Renamed switch command to checkout in help text and documentation
  • No changes to functionality, just updated documentation

Test plan

  • Verify help text for checkout command now shows ck alias
  • Confirm switch command still works as before
  • Check documentation for checkout command to ensure ck alias is mentioned

@MusicMaster4 MusicMaster4 merged commit 29a8ed4 into main Jul 10, 2026
2 checks passed
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR renames the switch/sw command to checkout/ck in the CLI's help text, header comment, and error messages, and registers ck and checkout as new SHORT_CMDS aliases pointing to the existing switch handler. No logic changes are made; the sw and switch spellings continue to work at runtime.

  • ck and checkout are added to SHORT_CMDS, both mapping to \"switch\", so the underlying handler is reused with no duplication.
  • The help table, inline file-header comment, and the missing-argument error message are all updated to reference ck/checkout instead of sw/switch.
  • The sw alias is silently removed from the help display but still resolves correctly at runtime, which could surprise existing users who look up the alias in help.

Confidence Score: 4/5

Safe to merge — no functional logic is changed and the new aliases route correctly to the existing handler.

The change is limited to alias mappings, display strings, and comment text. The new ck/checkout aliases correctly resolve to the switch case handler, and backward-compatible aliases (sw, switch) remain functional. The only notable gap is that sw is no longer mentioned in the help output even though it still works, which may silently confuse users who relied on it.

scripts/cli.ts — specifically the help table row for checkout and whether the sw alias should be noted for discoverability.

Important Files Changed

Filename Overview
scripts/cli.ts Help text, header comment, SHORT_CMDS mapping, and error/banner strings updated to surface checkout/ck as the primary command/alias, while the old sw alias is silently dropped from displayed help (though it still works at runtime).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User types command] --> B{rawCmd}
    B -->|ck| C[SHORT_CMDS lookup → switch]
    B -->|checkout| C
    B -->|sw| C
    B -->|switch| D[Not in SHORT_CMDS → cmd = switch]
    C --> E[case switch handler]
    D --> E
    E --> F{arg1 provided?}
    F -->|No| G[die: branch name required]
    F -->|Yes| H[banner: checkout target]
    H --> I[git checkout target]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User types command] --> B{rawCmd}
    B -->|ck| C[SHORT_CMDS lookup → switch]
    B -->|checkout| C
    B -->|sw| C
    B -->|switch| D[Not in SHORT_CMDS → cmd = switch]
    C --> E[case switch handler]
    D --> E
    E --> F{arg1 provided?}
    F -->|No| G[die: branch name required]
    F -->|Yes| H[banner: checkout target]
    H --> I[git checkout target]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
scripts/cli.ts:1043
The `sw` alias is silently dropped from the displayed help table. It still resolves at runtime (via `SHORT_CMDS`), so existing users or scripts that call `gg sw <branch>` keep working — but there's no indication in the help output that `sw` is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.

```suggestion
    ["checkout <branch>", "ck <branch>", "git checkout <branch>  (sw alias still works)"],
```

Reviews (1): Last reviewed commit: "fix: update cli help text for checkout c..." | Re-trigger Greptile

Comment thread scripts/cli.ts
["merge <src> [dst] [-m]", "m <src> [dst]", "commit → checkout dst|main → merge → push"],
["save [-m]", "s [-m]", "commit current work, then checkout main"],
["switch <branch>", "sw <branch>", "checkout <branch>"],
["checkout <branch>", "ck <branch>", "git checkout <branch>"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The sw alias is silently dropped from the displayed help table. It still resolves at runtime (via SHORT_CMDS), so existing users or scripts that call gg sw <branch> keep working — but there's no indication in the help output that sw is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.

Suggested change
["checkout <branch>", "ck <branch>", "git checkout <branch>"],
["checkout <branch>", "ck <branch>", "git checkout <branch> (sw alias still works)"],
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/cli.ts
Line: 1043

Comment:
The `sw` alias is silently dropped from the displayed help table. It still resolves at runtime (via `SHORT_CMDS`), so existing users or scripts that call `gg sw <branch>` keep working — but there's no indication in the help output that `sw` is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.

```suggestion
    ["checkout <branch>", "ck <branch>", "git checkout <branch>  (sw alias still works)"],
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant