Skip to content

Conversation

@seefood
Copy link
Contributor

@seefood seefood commented Oct 4, 2025

Summary

Enhances the bash-it doctor command to provide comprehensive diagnostic information and interactive update prompts, addressing the feature request in #1745.

Changes

1. Comprehensive Diagnostic Summary

The default bash-it doctor (no arguments) now displays:

  • Environment Information

    • OS and kernel version
    • Bash version
    • Bash-it installation location
    • Config file(s) being used
  • Version Information

    • Current commit hash
    • Position relative to latest tag (e.g., "v3.1.2 +3" for 3 commits ahead)
    • Update status (commits behind master)
  • Configuration Loading Details

    • Searches ALL common config files (.bashrc, .bash_profile, .profile)
    • Shows bash-it loading context with line numbers (grep -n -B2 -A2)
    • Previously only checked single config file
  • Enabled Components

    • One-line summary per type: aliases, plugins, completions
    • Shows count and names

2. Interactive Update Prompt

When behind remote master, offers to update with safety checks:

  • Only prompts when safe (no uncommitted changes)
  • Uses git merge --ff-only for safety
  • Falls back to bash-it update for complex cases
  • Clear feedback on success/failure

3. Colorful Terminal Output

  • Color-coded sections (cyan headers, green labels, yellow tips)
  • Visual indicators (✓ for up-to-date status)
  • Improved readability while maintaining copy-paste-friendly output

4. Documentation & Templates

  • Bug Report Template: Streamlined to request single bash-it doctor output instead of 5+ separate fields
  • README: Added Diagnostics section explaining the feature
  • Contributing: Emphasizes using doctor for bug reports

Use Cases

For Users:

bash-it doctor  # Get complete diagnostic info + update prompt if needed

For Bug Reports:
Single command provides all diagnostic info maintainers need, reducing back-and-forth

For System Health Checks:
Quickly see version status, enabled components, and update availability

Testing

  • ✅ Shellcheck passes
  • ✅ Pre-commit hooks pass
  • ✅ Tested on clean install
  • ✅ Tested when behind master (update prompt appears)
  • ✅ Tested when up-to-date (no prompt)
  • ✅ Tested with uncommitted changes (safe fallback)

Closes

Closes #1745

Screenshots

image image

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

seefood and others added 2 commits October 4, 2025 19:44
Implements enhancement requested in issue Bash-it#1745 to provide a concise
summary of enabled components via `bash-it doctor` command.

The new default behavior shows:
- Environment info (OS, Bash version, config file location)
- Bash-it version (commit, tag, update status)
- How bash-it is loaded (with context from .bashrc/.bash_profile)
- Summary of enabled aliases, plugins, and completions

This makes it easier for users to:
- Share diagnostic info when reporting bugs
- Quickly see their current bash-it configuration
- Check if their installation is up to date

Usage: `bash-it doctor` or `bash-it doctor summary`

The existing doctor error/warning modes still work:
- `bash-it doctor errors`
- `bash-it doctor warnings`
- `bash-it doctor all`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Enhancements to the bash-it doctor command:

**Interactive Update Prompt:**
- Offers to update bash-it when behind remote master
- Only prompts when safe (no uncommitted changes, can fast-forward)
- Performs git merge with --ff-only for safety
- Provides clear feedback on update status

**Colorful Output:**
- Color-coded sections (cyan headers, green labels, yellow warnings)
- Visual indicators (✓ for up-to-date status)
- Improved readability for terminal output

**Better Configuration Detection:**
- Now greps ALL common config files (.bashrc, .bash_profile, .profile)
- Shows bash-it loading context from each file found
- Previously only checked single config file

**Improved Version Display:**
- Shows commits ahead of latest tag (e.g., "v3.1.2 +3")
- Clearer version information for users not on tagged releases

**Documentation Updates:**
- Updated bug_report.yml to streamline diagnostic info collection
- Added Diagnostics section to README
- Emphasizes using `bash-it doctor` for bug reports

Related to issue Bash-it#1745

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@seefood seefood merged commit da4a8ed into Bash-it:master Oct 4, 2025
6 checks passed
@seefood seefood deleted the feature/doctor-summary-diagnostics branch October 4, 2025 17:18
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.

Include a short summary of enabled components as part of bash-it doctor

1 participant