Skip to content

feat: add /doctor command to diagnose local environment and dependencies - #1154

Open
MukeshVermaLegit wants to merge 1 commit into
CodebuffAI:mainfrom
MukeshVermaLegit:main
Open

feat: add /doctor command to diagnose local environment and dependencies#1154
MukeshVermaLegit wants to merge 1 commit into
CodebuffAI:mainfrom
MukeshVermaLegit:main

Conversation

@MukeshVermaLegit

@MukeshVermaLegit MukeshVermaLegit commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Adds a new /doctor slash command that helps users diagnose common issues with their local environment.

Closes #1119

Changes

  • New file: cli/src/commands/doctor.ts - Core diagnostic logic
  • New file: cli/src/commands/__tests__/doctor.test.ts - Unit tests
  • Modified: cli/src/commands/command-registry.ts - Register the command
  • Modified: cli/src/data/slash-commands.ts - Add command to slash menu

What it checks

The /doctor command (also invokable as /check or /health) checks:

  1. Platform and runtime - Shows OS, architecture, and Node.js/Bun version
  2. ripgrep (rg) - Required for code search functionality
  3. Git - Availability and repository status
  4. API connectivity - Tests connection to the backend
  5. tmux - Optional but recommended for multiplexing

Example output

Success case:

### Codebuff doctor

✅ All checks passed!

✅ **platform**: linux x64
✅ **runtime**: Bun 1.4.0
✅ **ripgrep (rg)**: Available
✅ **git**: Available
✅ **git repository**: Current directory is a git repository
✅ **tmux**: Available
✅ **API connectivity**: Connected to https://codebuff.com

With issues:

### Codebuff doctor

❌ 1 error(s), 1 warning(s) found

✅ **platform**: linux x64
✅ **runtime**: Bun 1.4.0
❌ **ripgrep (rg)**: ripgrep not found in PATH
   Install it:
     - macOS: brew install ripgrep
     - Ubuntu/Debian: sudo apt install ripgrep
✅ **git**: Available
⚠️ **tmux**: tmux not found
   tmux is optional but recommended for multiplexing...
✅ **API connectivity**: Connected to https://codebuff.com

### Recommendations

Fix the errors above to ensure full functionality.

Testing

All 7 tests pass (6 new tests for doctor command + 1 existing diagnostics test).

Add a new /doctor slash command that helps users diagnose common issues
with their local environment. The command checks:

- Platform and runtime information
- ripgrep availability (required for code search)
- Git availability and repository status
- API connectivity
- tmux availability (optional but recommended)

This addresses issue CodebuffAI#1119 where users had difficulty diagnosing why
tools like code search were failing due to missing dependencies.

The command can be invoked as /doctor, /check, or /health.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

Add /doctor command to diagnose local environment and dependencies

1 participant