Skip to content

feat(plugins/gh): add GitHub CLI plugin with aliases and functions#739

Open
JoseMRT2004 wants to merge 2 commits intoohmybash:masterfrom
JoseMRT2004:gh-plugin
Open

feat(plugins/gh): add GitHub CLI plugin with aliases and functions#739
JoseMRT2004 wants to merge 2 commits intoohmybash:masterfrom
JoseMRT2004:gh-plugin

Conversation

@JoseMRT2004
Copy link
Copy Markdown
Contributor

Summary

  • Add new plugin for GitHub CLI (gh) with useful aliases and functions
  • Includes aliases for common gh commands (pr, issue, repo, run, etc.)
  • Provides functions for quick PR creation and viewing

Changes

  • Added plugins/gh/README.md with documentation
  • Added plugins/gh/gh.plugin.sh with aliases and functions
  • Updated plugins/README.md to include gh plugin

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Add GitHub CLI plugin with aliases and utility functions

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add GitHub CLI plugin with 30+ aliases for common gh commands
• Implement 5 utility functions for PR, issue, and repo operations
• Include comprehensive documentation with usage examples
• Update main plugins README to list new gh plugin
Diagram
flowchart LR
  A["GitHub CLI Plugin"] --> B["gh.plugin.sh"]
  A --> C["README.md"]
  B --> D["30+ Aliases"]
  B --> E["5 Functions"]
  D --> F["PR/Issue/Repo Commands"]
  E --> G["gh-info, gh-pr-create, gh-issue-list, gh-repo-clone, gh-pr-list"]
  C --> H["Alias Documentation"]
  C --> I["Function Documentation"]
Loading

Grey Divider

File Changes

1. plugins/gh/gh.plugin.sh ✨ Enhancement +105/-0

GitHub CLI plugin with functions and aliases

• New plugin file providing GitHub CLI integration for Oh My Bash
• Implements 5 utility functions: gh-info, gh-pr-create, gh-issue-list, gh-repo-clone,
 gh-pr-list
• Defines 30+ aliases organized by category (repos, releases, PRs, issues, gists, workflows, API)
• Includes installation check for GitHub CLI with helpful error message

plugins/gh/gh.plugin.sh


2. plugins/gh/README.md 📝 Documentation +60/-0

GitHub CLI plugin documentation and usage guide

• New documentation file for GitHub CLI plugin
• Comprehensive alias reference table with 33 aliases and their descriptions
• Function documentation table with usage examples
• Prerequisites section with installation and authentication instructions

plugins/gh/README.md


3. plugins/README.md 📝 Documentation +3/-2

Update plugins list with gh plugin entry

• Add gh plugin entry to main plugins table
• Fix table formatting alignment (pipe characters)
• Update zellij-autoattach entry formatting

plugins/README.md


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented Mar 3, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Non-zero return breaks init🐞 Bug ⛯ Reliability
Description
The plugin returns 1 at top-level when gh is missing, which makes _omb_module_require_plugin
return non-zero and can abort Oh My Bash initialization (notably for users with set -e). It also
prints the warning to stdout, which is inconsistent with other plugins and can pollute startup
output.
Code

plugins/gh/gh.plugin.sh[R12-15]

+if ! _omb_util_command_exists gh; then
+  _omb_util_print "GitHub CLI (gh) is not installed. Please install it from https://cli.github.com/"
+  return 1
+fi
Evidence
gh.plugin.sh uses return 1 when gh is absent, so source returns non-zero. The module loader
collects that non-zero status and returns it from _omb_module_require, and oh-my-bash.sh invokes
_omb_module_require_plugin without guarding against failure; thus a non-zero return can propagate
to the caller and (with set -e) terminate initialization. Also, _omb_util_print prints to
stdout, and this plugin doesn't redirect to stderr, unlike other plugins’ dependency-missing
warnings.

plugins/gh/gh.plugin.sh[11-15]
oh-my-bash.sh[90-103]
oh-my-bash.sh[130-137]
lib/omb-util.sh[7-10]
plugins/tmux/tmux.plugin.bash[17-20]
plugins/zoxide/zoxide.plugin.sh[3-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`plugins/gh/gh.plugin.sh` returns `1` when `gh` is not installed. Oh My Bash loads plugins via `source` inside `_omb_module_require`, captures the non-zero status, and `_omb_module_require_plugin` is invoked unguarded during init. This can cause initialization to return non-zero and potentially abort startup for shells using `set -e`. The warning is also printed to stdout.
### Issue Context
Other plugins (e.g., `tmux`, `zoxide`) print missing-dependency warnings to stderr and do **not** fail initialization.
### Fix Focus Areas
- plugins/gh/gh.plugin.sh[11-15]
- lib/omb-util.sh[7-10]
- oh-my-bash.sh[90-103]
- oh-my-bash.sh[130-137]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Redundant self-alias gh🐞 Bug ⛯ Reliability
Description
The plugin defines alias gh='gh', which is a no-op but unnecessarily overrides any existing user
alias/function named gh and adds confusion when inspecting gh via type/alias. Removing it
reduces unexpected override surface without changing behavior.
Code

plugins/gh/gh.plugin.sh[R62-63]

+# Core
+alias gh='gh'
Evidence
The alias is unconditional and self-referential; it provides no functional value beyond overriding
any prior gh definition.

plugins/gh/gh.plugin.sh[62-64]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`alias gh='gh'` is redundant and can override a user's existing `gh` alias/function without providing benefit.
### Issue Context
The binary `gh` is already invoked directly throughout the plugin; no wrapper is needed.
### Fix Focus Areas
- plugins/gh/gh.plugin.sh[62-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

3. Docs typos in gh entry🐞 Bug ✓ Correctness
Description
Documentation includes typos (e.g., “funtions”, “Lsts”), which reduces clarity and professionalism
for a user-facing plugin README and plugin index.
Code

plugins/README.md[62]

+| gh                | Aliases and funtions for Github CLI                                                                                         |
Evidence
The plugin index and README contain visible spelling mistakes in user-facing text.

plugins/README.md[62-62]
plugins/gh/README.md[56-60]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
User-facing documentation contains spelling errors.
### Issue Context
These strings appear in the plugin index and the new plugin README.
### Fix Focus Areas
- plugins/README.md[62-62]
- plugins/gh/README.md[56-60]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread plugins/gh/gh.plugin.sh
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