# guh CLI — Command Reference ## `guh` Root command. Prints a welcome message when run without a subcommand. ``` guh > Welcome to guh! Use --help to see available commands. ``` --- ## `browse` Open the repository's remote origin in the default browser. ``` guh browse ``` Equivalent to opening the repo URL (without `.git` suffix) in a browser. ### `issues` Open the issues page. ``` guh browse issues ``` ### `pr` Open the pull requests page. ``` guh browse pr ``` Optionally, add `print` to print the URL instead of opening it. ``` guh browse issues print guh browse pr print guh browse print ``` --- ## `commit` Add files and commit changes. Shows `git status --short` before committing. Optionally pushes after commit. ``` guh commit # show edited files only guh commit "." "message" # git add . && commit guh commit '["file1", "file2"]' "message" # add specific files && commit guh commit '["file1"]' "message" "description" # commit with message + description guh commit '["file1"]' "message" push # commit + push to origin guh commit '["file1"]' "message" "description" push # commit + push to origin guh commit '["file1"]' "message" push "upstream" # commit + push to named remote guh commit '["file1"]' "message" "description" push "all" # commit + push to all remotes ``` **Arguments** | # | Name | Required | Description | |---|------|----------|-------------| | 1 | files | yes* | JSON array of files, or `"."` to add everything | | 2 | message | yes* | Commit message | | 3 | description | no | Optional commit description (uses `-m` twice) | | 4 | push | no | Literal `"push"` to trigger a push after commit | | 5 | remote | no | Remote name (default `"origin"`; use `"all"` to push to all remotes) | \*When no arguments are given, shows `git status --short` instead. --- ## `create` ### `branch` Create and switch to a new branch. ``` guh create branch ``` Equivalent to `git switch -c `. ### `account` Save a GitHub account with username, email, classic token, and platform. ``` guh create account ``` Credentials are stored in the user config directory under `dev.pages.codedave.guh/accounts.json`. All four values are required and must be non-empty. `platform` is the Git provider domain (e.g. `github.com`). --- ## `diff` Show working tree changes. ``` guh diff # show all working tree changes guh diff # show changes for a specific file ``` Equivalent to `git diff [file]`. --- ## `init` Initialize a new Git repository in the current directory. ``` guh init ``` Equivalent to `git init`. --- ## `link` Show remote URLs or add/remove remotes. ``` guh link # show all remotes (git remote -v) guh link add # add (or replace) a remote guh link remove # remove a remote ``` ### `add` Set a remote URL. Removes any existing remote with the same name first, then adds it. ``` guh link add ``` ### `remove` Remove a remote by name. ``` guh link remove ``` --- ## `pull` Fetch and pull upstream changes. ``` guh pull ``` Runs `git fetch` followed by `git pull`. --- ## `push` Push local commits to a remote. ``` guh push # push to default remote guh push # push to a named remote guh push all # push to all remotes ``` When `all` is given, pushes to every remote returned by `git remote`. --- ## `rename` ### `branch` Rename the current branch. ``` guh rename branch ``` Equivalent to `git branch -m `. --- ## `stash` Stash current working directory changes. ``` guh stash ``` Equivalent to `git stash`. --- ## `switch` ### `branch` Switch to an existing branch. ``` guh switch branch guh switch branch list ``` Equivalent to `git switch `. Listing all branches is equivalent to `git branch`. ### `account` Switch to a saved GitHub account (updates global git config and credentials). ``` guh switch account ``` Sets `credential.helper` to `store`, updates `user.name` and `user.email` in global git config, and overwrites `~/.git-credentials` with the stored token. The account must have been created with `guh create account` first. --- ## `undo` Undo local commits using `git reset`. ``` guh undo [flavour] ``` **Arguments** | # | Name | Required | Description | |---|------|----------|-------------| | 1 | commits | yes | Number of commits to go back (e.g. `1`) | | 2 | flavour | no | Reset mode: `hard`, `mixed` (default: `soft`) | Examples: ``` guh undo 1 # git reset --soft HEAD~1 guh undo 2 hard # git reset --hard HEAD~2 guh undo 1 mixed # git reset --mixed HEAD~1 ``` ## `logs` Show commit logs. ``` guh logs [commits] ``` **Arguments** | # | Name | Required | Description | |---|------|----------|-------------| | 1 | commits | no | Number of commits to show (default: all) | Examples: ``` guh logs 5 ``` Equivalent to `git log`.