Git Tools
The Git tools wrap common Git, GitHub, and GitLab operations as local slash commands. They all require a Git repository in the workspace and, unless noted, run plain Git under the hood. A few commands integrate with the gh (GitHub) or glab (GitLab) CLI when installed.
Several commands surface a combined hint when the current branch is behind its base or carries more than one commit: branch is N commits behind base; run /rebase and/or N commits ahead of base; run /squash. The base branch is detected in the order origin/main, origin/master, main, then master.
Every command below also accepts the natural-language aliases listed in its Examples.
/status#
Shows the working-tree status with color highlighting. Runs git status --branch --short. Added and untracked entries are shown in green, deleted in red, modified in the default color; the branch line is muted.
Examples
/status
Natural-language forms:
status
show status
git status
/log#
Shows the commit log. Uses git lg if a lg alias is found in ~/.gitconfig, otherwise falls back to git log --graph --oneline --decorate. An optional number limits output to the most recent N commits. Below the log it appends a working-tree summary: ● Working tree clean or ● N change(s).
Examples
/log
/log 5
Natural-language forms:
log
show log
git log
git lg
/diff#
Shows a color unified diff. Without a branch it shows unstaged changes; with a branch it runs git diff <branch>...HEAD. Applies any configured non-interactive Git pager such as delta. Tab completion offers local and remote branch names.
Examples
/diff
/diff main
Natural-language forms:
diff
show diff
git diff
diff against main
show diff against main
/grep#
Searches all tracked files for a pattern with git grep. Output is piped through the configured pager when one is set. Exit code 1 (no matches) is handled gracefully.
Examples
/grep TODO
/grep "fn main"
Natural-language forms:
grep TODO
find TODO
git grep TODO
/add_file#
Stages a file or directory with git add. Tab completion offers untracked directories first, then untracked files; already-tracked content is excluded.
Examples
/add_file README.md
/add_file src/
Natural-language forms:
add README.md
add file src/
git add README.md
/remove_file#
Removes a file or directory from Git tracking with git rm (using -r for directories). Tab completion offers tracked content; untracked content is excluded.
Examples
/remove_file old.rs
/remove_file legacy/
Natural-language forms:
remove old.rs
remove file legacy/
git rm old.rs
/move_file#
Renames or moves a tracked file with git mv. Tab completion for the first argument offers tracked files and directories; the second argument completes from all workspace paths.
Examples
/move_file old.rs new.rs
Natural-language forms:
move old.rs new.rs
move file old.rs new.rs
git mv old.rs new.rs
/restore#
Discards working-tree changes with git restore <file>, or unstages with --staged.
Examples
/restore src/main.rs
/restore --staged src/main.rs
Natural-language form:
restore src/main.rs
/commit#
Commits all tracked changes with git commit -a -m <message>. Quote the message when it contains spaces or issue-prefix characters such as [#42].
Examples
/commit Fix the parser
/commit "[#42] Add the new feature"
Natural-language forms:
commit Fix the bug
commit "[#42] My feature"
git commit -m "Fix the bug"
/amend#
Rewrites the last commit message with git commit --amend -m <message>.
Examples
/amend Fix the parser
/amend "[#42] Add the new feature"
Natural-language forms:
amend Fix the bug
amend "[#42] My feature"
amend message "[#42] My feature"
/squash#
Squashes all commits on the current branch into a single commit, reusing the oldest commit's message. The branch is compared against origin/main, origin/master, main, or master. At least two commits are required, and squashing on main or master is blocked.
Examples
/squash
Natural-language forms:
squash
squash branch
squash commits
git squash
/stash#
Saves and restores uncommitted changes on the stash stack.
/stash: runsgit stash push, saves all staged and unstaged changes/stash pop: runsgit stash pop, restores and removes the most recent entry/stash list: shows all stash entries with index and description/stash drop: runsgit stash drop, discards the most recent entry
Examples
/stash
/stash pop
/stash list
/stash drop
Natural-language forms:
stash
pop stash
list stashes
drop stash
/bisect#
Runs a binary-search session to find the commit that introduced a bug.
/bisector/bisect status— shows the current bisect state; reports "No bisect session in progress" when none is active./bisect start [<commit>]— begins a new bisect session, optionally marking<commit>as the first known-bad revision./bisect good [<commit>]— marks the current (or specified) commit as good./bisect bad [<commit>]— marks the current (or specified) commit as bad./bisect skip [<commit>]— tells Git to skip the current (or specified) commit when it cannot be tested./bisect reset— ends the bisect session and returnsHEADto its original position./bisect log— prints the log of all good/bad markings made so far.
All subcommands run plain git bisect <sub>; there is no gh equivalent.
Examples
/bisect start
/bisect bad
/bisect good abc1234
/bisect skip
/bisect log
/bisect reset
Natural-language forms:
bisect start
start bisect
bisect good
mark good
bisect bad
mark bad
bisect skip
skip commit
bisect reset
reset bisect
bisect log
bisect
/branch#
Lists, switches, creates, renames, or deletes branches.
/branch [<name> | -b <name> | -m <name> | -d <name> | -a]
- No arguments: lists local branches
-a: lists all branches including remote<name>: switches to an existing branch-b <name>: creates and switches to a new branch-m <new-name>: renames the current branch-d <name>: deletes the branch; blocked onmainandmaster
Examples
/branch
/branch -a
/branch feature/login
/branch -b feature/login
/branch -m feature/auth
/branch -d feature/old
Natural-language forms:
branch
list branches
list all branches
checkout main
switch to main
create branch feature/x
rename to new-name
delete branch feature/old
/merge#
Merges a branch into the current branch. Uses gh pr merge --merge if gh is installed, otherwise uses git merge.
Examples
/merge feature/login
Natural-language forms:
merge feature/login
git merge feature/login
/rebase#
Rebases the current branch against the repository default branch. Uses gh to detect the default branch when available, otherwise probes origin/main then origin/master.
Examples
/rebase
Natural-language forms:
rebase
git rebase
/cherry_pick#
Cherry-picks a commit onto the current branch with git cherry-pick. Tab completion offers abbreviated commit hashes from the default branch.
Examples
/cherry_pick abc1234
Natural-language forms:
cherry pick abc1234
cherry-pick abc1234
git cherry-pick abc1234
/init_repo#
Initializes a Git repository in the workspace with git init. Reinitializing an existing repo is safe.
Examples
/init_repo
Natural-language forms:
init
init repo
git init
/push#
Pushes the current branch to origin with git push origin <branch>. --force (or -f) runs git push -f but is blocked on main and master. After a successful push it reports if the branch needs a /rebase or /squash.
Examples
/push
/push --force
Natural-language forms:
push
git push origin
force push
push --force
/pull#
Checks out a GitHub pull request on a dedicated branch. Uses gh pr checkout if gh is installed, otherwise fetches directly from origin. After checkout it reports if the branch needs a /rebase or /squash.
Examples
/pull 58
Natural-language forms:
pull 58
pull pr 58
pull request 58
pull #58
/pull_request#
Creates a pull request for the current branch. Requires the gh CLI. Runs pre-flight checks: blocks on main/master, requires at least one commit ahead of the base, and blocks when the branch is behind or has more than one commit ahead (reporting the /rebase//squash hint). When checks pass it pushes with --set-upstream origin and calls gh pr create with the title and body from the single commit message.
Setting auto_rebase = on or auto_squash = on in [orangu] triggers the corresponding fix automatically before continuing.
Examples
/pull_request
Natural-language forms:
pull request
create pull request
open pull request
new pull request
create pr
open pr
new pr
/comment#
Adds a comment to a GitHub or GitLab issue. Requires the gh or glab CLI.
/comment <number> "<comment>"
/comment <number> <file>
/comment <number> with review
/comment <number> with auto review
When the third argument is a quoted string it is used as the body directly. When it is a bare word it is treated as a filename relative to ~/.orangu/comments/; Tab completion lists the files in that directory.
with review posts the last /review summary of the session as the comment body, and with auto review posts the last /auto_review report — the same Markdown that is copied to the clipboard on exit. Each keyword is offered by completion only once the matching review has actually been run; when none has, the command points you at /review or /auto_review.
Examples
/comment 51 "Thanks, merged."
/comment 51 merged.md
/comment 48 with review
/comment 48 with auto review
Natural-language forms:
add comment on 51 "My comment"
comment on 51 "My comment"
comment on 48 with review
comment on 48 with auto review
/close#
Closes a GitHub/GitLab issue or pull request. Requires gh or glab.
/close -i <number> # close an issue
/close -p <number> # close a pull request / merge request
Examples
/close -i 51
/close -p 58
Natural-language forms:
close issue 51
close pr 58
/get_comments#
Lists the comments on a GitHub/GitLab issue or pull request. Requires gh or glab.
/get_comments -i <number> # comments on an issue
/get_comments -p <number> # comments on a pull request / merge request
For a GitHub pull request both the conversation comments and the inline review comments are fetched and merged chronologically. Each comment is shown as a block: a grey ● <date> <author> header line, then the body indented two spaces. GitLab system notes (label changes, assignments, and so on) are skipped.
Examples
/get_comments -i 51
/get_comments -p 58
Natural-language forms:
get comments for issue 51
get comments for pull request 58