Skip to content

feat: add Oh My Zsh setup option and fix bash/zsh shell compatibility#418

Merged
marcusquinn merged 2 commits intomainfrom
feature/shell-compat-omz-setup
Feb 7, 2026
Merged

feat: add Oh My Zsh setup option and fix bash/zsh shell compatibility#418
marcusquinn merged 2 commits intomainfrom
feature/shell-compat-omz-setup

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 7, 2026

Summary

  • Add optional Oh My Zsh installation early in setup flow (opt-in with y/N default, not capital Y)
  • Fix shell compatibility so all PATH changes, aliases, and tool configs work in both bash and zsh on fresh Mac installs

Problem

On a fresh Mac, the default terminal runs bash but the system default shell is zsh (since macOS Catalina). When running bash <(curl ...) to install aidevops, PATH changes and aliases were only written to the running shell's rc file, leaving the other shell unconfigured. This meant tools installed during setup wouldn't be available when the user opened a new terminal with their default shell.

Changes

New: Oh My Zsh setup (opt-in)

  • setup_oh_my_zsh() offered early in setup flow, before tools that benefit from zsh plugins
  • Uses [y/N] prompt (lowercase y, not capital Y) since some users prefer plain zsh
  • Installs with --unattended flag to avoid changing shell or starting zsh during setup
  • Optionally offers to change default shell to zsh

Shell compatibility helpers

  • detect_running_shell() - detects bash vs zsh for the current process
  • detect_default_shell() - detects the user's login shell ($SHELL)
  • get_shell_rc() - maps shell name to rc file path
  • get_all_shell_rcs() - returns ALL rc files that should be updated (both bash + zsh on macOS)

Functions updated for cross-shell support

  • check_requirements() - auto-fixes Homebrew PATH in all rc files, adds Intel Mac detection
  • add_local_bin_to_path() - writes to all existing shell rc files
  • setup_aliases() - writes to all existing shell rc files
  • setup_worktrunk() - checks all rc files for shell integration
  • setup_terminal_title() - checks all rc files for existing config
  • setup_browser_tools() - ensures Bun PATH is in all rc files after install
  • migrate_mcp_env_to_credentials() - adds sed -i fallback for Linux

Quality

  • Zero new ShellCheck warnings (3 pre-existing SC2155 warnings unchanged)
  • bash -n syntax check passes
  • README updated with new setup capabilities

Summary by CodeRabbit

Release Notes

  • New Features

    • Added optional Oh My Zsh installation during setup
    • Enhanced cross-shell compatibility for bash and zsh environments
    • PATH configuration now updates across all relevant shell configurations
  • Documentation

    • Added informational notes for shell setup compatibility

On a fresh Mac install, the default terminal uses bash but the system
default shell is zsh. This caused issues where PATH changes, aliases,
and tool configurations were only written to one shell's rc file.

Changes:
- Add setup_oh_my_zsh() early in setup flow (opt-in with y/N default)
- Add shell detection helpers (detect_running_shell, detect_default_shell,
  get_shell_rc, get_all_shell_rcs) for consistent cross-shell support
- Rewrite add_local_bin_to_path() to update all existing shell rc files
- Rewrite setup_aliases() to write to both .zshrc and .bash_profile
- Fix setup_worktrunk shell integration check to scan all rc files
- Fix setup_terminal_title to check all rc files for existing config
- Auto-fix Homebrew PATH in all shell rc files (not just current session)
- Ensure Bun PATH is written to all rc files after installation
- Add sed -i fallback for Linux in migrate_mcp_env_to_credentials
- Add Intel Mac Homebrew path detection (/usr/local/bin)
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the aidevops setup script to provide a more seamless and robust installation experience, particularly for users on macOS. The primary goal is to ensure that environmental configurations, such as PATH variables and shell aliases, are correctly and persistently applied across different shell environments (Bash and Zsh). This enhancement prevents common issues where tools or configurations might not be available in the user's default terminal session after installation. Additionally, it introduces an optional integration for Oh My Zsh, offering an improved shell experience for those who choose to enable it.

Highlights

  • Oh My Zsh Integration: An optional, opt-in installation of Oh My Zsh has been added early in the setup flow to enhance the zsh experience, especially on macOS where zsh is the default system shell.
  • Cross-Shell Compatibility: Significant improvements have been made to ensure PATH changes, aliases, and tool configurations are correctly applied and persist across both Bash and Zsh environments, addressing issues on fresh macOS installations.
  • New Shell Helper Functions: Several new utility functions (detect_running_shell, detect_default_shell, get_shell_rc, get_all_shell_rcs) were introduced to robustly detect and manage shell configuration files, enabling more reliable cross-shell updates.
  • Updated Setup Functions: Core setup functions, including those for Homebrew, local binaries, aliases, Worktrunk integration, terminal title, and Bun installation, have been refactored to leverage the new cross-shell compatibility logic.
Changelog
  • README.md
    • Updated to reflect the new optional Oh My Zsh installation feature.
    • Added a point highlighting improved cross-shell compatibility for PATH and alias changes.
  • setup.sh
    • Added sed -i fallback for Linux in migrate_mcp_env_to_credentials to improve compatibility.
    • Enhanced check_requirements to automatically fix Homebrew PATH issues in all relevant shell RC files and included detection for Intel Mac Homebrew locations.
    • Introduced detect_running_shell, detect_default_shell, get_shell_rc, and get_all_shell_rcs functions for improved shell detection and RC file management.
    • Implemented setup_oh_my_zsh to offer optional, unattended Oh My Zsh installation and prompt to change the default shell to zsh.
    • Modified setup_worktrunk to check for shell integration across all detected RC files.
    • Refactored add_local_bin_to_path to write PATH entries to all existing shell RC files for comprehensive cross-shell compatibility.
    • Updated setup_aliases to apply aliases to all relevant shell RC files (Bash/Zsh) or the Fish config, ensuring broad compatibility.
    • Adjusted setup_terminal_title to verify existing configuration across all shell RC files.
    • Added logic within setup_browser_tools to ensure Bun's PATH is correctly configured in all shell RC files after installation.
    • Integrated the setup_oh_my_zsh function into the main setup execution flow, positioning it early for optimal user benefit.
Activity
  • The author has introduced new features and significant refactoring to improve the setup script's robustness and user experience.
  • The changes address a known problem on macOS regarding shell compatibility and configuration persistence.
  • New helper functions have been developed to abstract shell-specific logic, making the script more maintainable and extensible.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Setup process enhanced with multi-shell awareness. New helper functions detect running/default shells and manage rc file updates across bash, zsh, and other shells. Interactive Oh My Zsh installation added to onboarding. Documentation updated with cross-shell PATH compatibility notes.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added two informational notes: optional Oh My Zsh installation and cross-shell PATH/alias configuration guidance for bash and zsh.
Shell Configuration Management
setup.sh
Introduced multi-shell detection and configuration functions (detect_running_shell(), detect_default_shell(), get_shell_rc(), get_all_shell_rcs(), setup_oh_my_zsh()). Refactored add_local_bin_to_path() to update PATH across all relevant rc files. Integrated Homebrew and Bun PATH fixes into check_requirements(). Enhanced main() flow with optional Oh My Zsh setup prompt.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐚 Shell scripts unite, from bash to zsh they flow,
Oh My Zsh beckons with a shimmer and glow,
Paths now propagate where'er shells may dwell,
Cross-shell harmony—a beautiful spell! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: adding Oh My Zsh setup and fixing bash/zsh shell compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/shell-compat-omz-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 25 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 03:57:55 UTC 2026: Code review monitoring started
Sat Feb 7 03:57:56 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 03:57:56 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 03:57:58 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 03:58:01 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an option to set up Oh My Zsh and significantly improves shell compatibility for both bash and zsh, especially on macOS. The introduction of helper functions like get_all_shell_rcs has cleaned up the code by centralizing shell configuration logic, making functions like add_local_bin_to_path and setup_aliases more robust and readable. The changes are well-structured and enhance the setup experience. I've identified a couple of areas for improvement related to consistency in handling Homebrew paths and rc file creation. Overall, this is a great enhancement to the project.

…andling

- Auto-fix Intel Mac Homebrew PATH in all shell rc files (consistent
  with Apple Silicon handling)
- Create missing rc files before writing Bun PATH (consistent with
  other setup functions)
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 25 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 04:02:24 UTC 2026: Code review monitoring started
Sat Feb 7 04:02:25 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 04:02:25 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 04:02:27 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 04:02:30 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@setup.sh`:
- Around line 2028-2116: The current setup_aliases flow only checks
get_all_shell_rcs() for existing alias markers and misses the fish config file,
so running on macOS with fish can append duplicate blocks to
~/.config/fish/config.fish; update setup_aliases to also check the fish rc
(variable fish_rc or path "$HOME/.config/fish/config.fish") for the marker "# AI
Assistant Server Access" (or grep the alias_block_fish) and set
any_configured=true if found, or alternatively before echoing alias_block_fish
in the fish branch run a grep -q check and skip appending when the marker
exists; use the existing symbols detect_default_shell, get_all_shell_rcs,
alias_block_fish and fish_rc to implement this guard.
- Around line 1935-1976: The add_local_bin_to_path function may fail when rc
files live in non-existent directories (e.g., fish's ~/.config/fish); before
touching or appending to each $rc_file returned by get_all_shell_rcs, ensure its
parent directory exists by running mkdir -p "$(dirname "$rc_file")" (skip or
handle files that are in the home root where dirname is "."); then proceed to
create or append to the file as before so touch/echo >> cannot fail due to
missing parent dirs.
- Around line 1167-1231: The prompt/logic mismatch: setup_oh_my_zsh currently
accepts uppercase Y because the read checks use regex ^[Yy]$, but the comments
promise lowercase y only; update the acceptance logic to only allow lowercase
'y' for both install_omz and change_shell prompts (replace the regex checks for
install_omz and change_shell) so uppercase 'Y' is ignored (or alternatively,
change the comment to state both cases are accepted) — edit the checks in
setup_oh_my_zsh where install_omz and change_shell are evaluated.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 1d3128b into main Feb 7, 2026
15 checks passed
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t147.7)

Addressed 5 valid issues:
- Remove trailing blank lines in content.md
- Remove duplicate list item in aidevops-plugin.md
- Remove dead setup_oh_my_opencode stub (no callers)
- Add mkdir -p before touch in add_local_bin_to_path (fish dir)
- Add fish config to alias duplicate detection in setup_aliases

Already fixed (6 threads): augment return 0, context7 old refs,
pointer file count, parse_args return, mutual exclusion guard,
non-interactive check_requirements

Dismissed (6 threads): Intel Homebrew path (code removed), Bun rc
(code removed), lowercase-only y (intentional UX), dir check -e vs
-f (unrealistic edge case), shorten warning (intentional verbosity),
pr-loop dedup (maintainer dismissed)
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t147.7)

Addressed 5 valid issues:
- Remove trailing blank lines in content.md
- Remove duplicate list item in aidevops-plugin.md
- Remove dead setup_oh_my_opencode stub (no callers)
- Add mkdir -p before touch in add_local_bin_to_path (fish dir)
- Add fish config to alias duplicate detection in setup_aliases

Already fixed (6 threads): augment return 0, context7 old refs,
pointer file count, parse_args return, mutual exclusion guard,
non-interactive check_requirements

Dismissed (6 threads): Intel Homebrew path (code removed), Bun rc
(code removed), lowercase-only y (intentional UX), dir check -e vs
-f (unrealistic edge case), shorten warning (intentional verbosity),
pr-loop dedup (maintainer dismissed)
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t147.7) (#475)

Addressed 5 valid issues:
- Remove trailing blank lines in content.md
- Remove duplicate list item in aidevops-plugin.md
- Remove dead setup_oh_my_opencode stub (no callers)
- Add mkdir -p before touch in add_local_bin_to_path (fish dir)
- Add fish config to alias duplicate detection in setup_aliases

Already fixed (6 threads): augment return 0, context7 old refs,
pointer file count, parse_args return, mutual exclusion guard,
non-interactive check_requirements

Dismissed (6 threads): Intel Homebrew path (code removed), Bun rc
(code removed), lowercase-only y (intentional UX), dir check -e vs
-f (unrealistic edge case), shorten warning (intentional verbosity),
pr-loop dedup (maintainer dismissed)
marcusquinn added a commit that referenced this pull request Feb 7, 2026
* fix: triage 17 PR review threads across PRs #418,#413,#412,#399,#394 (t147.7)

Addressed 5 valid issues:
- Remove trailing blank lines in content.md
- Remove duplicate list item in aidevops-plugin.md
- Remove dead setup_oh_my_opencode stub (no callers)
- Add mkdir -p before touch in add_local_bin_to_path (fish dir)
- Add fish config to alias duplicate detection in setup_aliases

Already fixed (6 threads): augment return 0, context7 old refs,
pointer file count, parse_args return, mutual exclusion guard,
non-interactive check_requirements

Dismissed (6 threads): Intel Homebrew path (code removed), Bun rc
(code removed), lowercase-only y (intentional UX), dir check -e vs
-f (unrealistic edge case), shorten warning (intentional verbosity),
pr-loop dedup (maintainer dismissed)

* chore: mark t147 complete - all 50 review threads resolved across 11 PRs (GH#438)
@marcusquinn marcusquinn deleted the feature/shell-compat-omz-setup branch February 21, 2026 01:59
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