Commit Graph

11 Commits

Author SHA1 Message Date
Trilltechnician f152c9647c fix(ui): Fix ASCII banner colors and add syntax display to explain mode
## Fixes

### 1. ASCII Banner Colors Fixed
- Changed from heredoc to echo -e statements
- ANSI escape codes now render properly
- Cyan and yellow colors display correctly
- No more literal escape codes showing

Before:
[0;36m
    ____             __       ____
(escape codes displayed as text)

After:
Properly colored cyan ASCII art with yellow tagline

### 2. Enhanced Explain Mode with Syntax
- Added SYNOPSIS/SYNTAX section before description
- Extracts syntax from man pages automatically
- Shows command usage patterns clearly
- Works for regular commands and shell builtins
- Multiple fallbacks for robustness:
  1. Man page SYNOPSIS section
  2. Command --help usage line
  3. Generic fallback pattern

Example output:
SYNTAX:
  grep [OPTION...] PATTERNS [FILE...]
  grep [OPTION...] -e PATTERNS ... [FILE...]

Description: Search for text pattern in files recursively

## Testing
-  Banner colors display correctly
-  Syntax shows for tar, grep, find
-  Works with shell builtins (cd, echo)
-  Fallback patterns work when man page incomplete
-  No breaking changes to existing functionality

Closes: UI color display issue
Closes: Syntax display request
2025-10-28 00:39:02 -07:00
Trilltechnician bdf3026069 docs(pr): Add PR creation instructions and merge guide 2025-10-28 00:33:49 -07:00
Trilltechnician 3a07f01b97 feat(testing): Add comprehensive testing suite with performance analysis
## Overview
Add complete testing infrastructure for all Bash Buddy operating modes
with automated testing, performance benchmarking, and detailed reporting.

## Features Added

### Test Framework
- Modular testing utilities (test-framework.sh)
- Performance timing and benchmarking
- JSON/Markdown/HTML report generation
- Color-coded output and statistics

### Test Suites
1. Non-Interactive Modes (test-all-modes.sh)
   - 45+ test cases covering all modes
   - Help, ask, task, category, explain, direct lookup, AI
   - Error handling and edge cases
   - Performance benchmarks (10 iterations)

2. Interactive Mode (test-interactive-mode.sh)
   - Automated testing with expect
   - Command selection and filtering
   - Startup performance analysis

3. Performance Analysis (analyze-performance.sh)
   - Historical comparison
   - Benchmark aggregation
   - Report generation (MD, HTML, JSON)

### Master Runner
- run-all-tests.sh: One-command test execution
- Pre-flight checks
- CI/CD integration
- Comprehensive reporting

## Test Coverage
-  All 10 operating modes
-  45+ test cases
-  Performance benchmarks
-  Error conditions
-  Interactive automation

## Performance Results
All targets met or exceeded:
- Database search: ~50ms (target <100ms)
- Category browse: ~30ms (target <100ms)
- Direct lookup: ~100ms (target <200ms)
- Interactive: ~50ms (target <100ms)

## Documentation
- Comprehensive README.md in tests/
- TESTING-SUITE.md with full PR details
- CI/CD integration examples
- Troubleshooting guide

## Usage
```bash
cd tests/
./run-all-tests.sh
```

## Impact
- No breaking changes
- Pure addition in tests/ directory
- Opt-in testing infrastructure
- CI/CD ready

Closes: Testing infrastructure requirement
Related: v2.1.0 release
2025-10-28 00:32:22 -07:00
Trilltechnician 3e5e431596 feat: Add AI mode with NL2SH model and expand to 90+ commands
Major improvements:
- Implemented AI mode using westenfelder/NL2SH model for complex queries
- Expanded interactive commands from 11 to 90+ (file ops, text, network, system, etc.)
- Fixed flag extraction logic in interactive mode
- Improved OPTIONS section parsing from man pages
- Added proper filtering support

AI Mode Features:
- Uses local NL2SH model for advanced natural language understanding
- Generates bash commands from complex natural language queries
- Shows command info and safety warnings
- Example: bash-helper ai "find python files modified last week"

Interactive Mode Improvements:
- 90+ commands organized by category
- Better flag extraction from man pages
- Improved filtering with proper OPTIONS section parsing
- Now properly shows flags when filtered (e.g., grep -v)

New Commands Added:
- File: touch, cat, less, head, tail, chmod, chown, ln, file, stat
- Text: sed, awk, cut, sort, uniq, tr, wc, diff
- Search: locate, which, whereis
- Compression: gzip, gunzip, zip, unzip
- Network: curl, ssh, scp, netstat, ip, ifconfig
- System: htop, df, du, free, uname, uptime
- Process: pkill, killall, bg, fg, jobs
- Admin: sudo, systemctl, service, reboot, shutdown
- Package: apt, apt-get, dpkg, snap
- User: useradd, userdel, passwd, su, w, who
- Utils: date, cal, history, alias, export, env, watch

Version: 2.1.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 21:43:58 -07:00
Trilltechnician 596d69a8fa fix: Correct ANSI color rendering in help display
Changed show_help() from heredoc to echo -e statements to properly
render color escape codes. Help menu now displays with proper colors
instead of literal escape sequences.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 21:19:25 -07:00
Trilltechnician bc3197ad8f docs: Add bhelper alias usage guide
Added USING-BHELPER-ALIAS.md with:
- Alias configuration details
- Quick start examples
- Tips for effective usage
- All feature demonstrations

Alias updated in ~/.bashrc to point to new location.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 21:06:01 -07:00
Trilltechnician 13cb6029c7 docs: Add Phase 1 live demo with examples and benchmarks
Added PHASE-1-DEMO.md showing:
- Live examples of all new features
- Performance benchmarks (all targets exceeded)
- Complete database coverage
- Before/after comparisons
- Educational value demonstration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 21:05:21 -07:00
Trilltechnician 7f00dfe3d9 feat: Phase 1 - Add intelligent natural language query system with ASCII banner
This is a major enhancement that transforms Bash Buddy from a simple flag
lookup tool into an intelligent CLI assistant with natural language understanding.

## New Features

### 1. Natural Language Query Modes
- **ask**: Query in natural language ("find large files")
- **task**: Describe what you want to do ("compress a folder")
- **category**: Browse tasks by category (files/text/network/system)
- **explain**: Get detailed explanation of any command

### 2. Commands Database (commands-db.json)
- 20 common bash tasks with detailed documentation
- 4 categories: files, text, network, system
- Each task includes:
  * Multiple keyword variations for matching
  * Command template with examples
  * Flag explanations
  * Related task suggestions
  * Real-world usage examples

### 3. Intelligent Keyword Matching
- Scores results based on keyword relevance
- Weights: keywords (2x), description (1x), command (1x)
- Returns top 5 matches or full details for single match
- Performance: ~50ms average query time

### 4. Enhanced UI/UX
- ASCII banner with "Bash Buddy" branding
- Color-coded output for better readability
- Compact view for multiple results
- Detailed view for single results with examples
- Reorganized help menu (concise yet thorough)
- Added QUICK START section

### 5. Documentation
- ENHANCEMENT-PROPOSAL.md: Complete architectural design
- PHASE-1-COMPLETE.md: Implementation summary and metrics
- AI-INTEGRATION-OPTIONS.md: Future AI model integration guide

## Performance

All Phase 1 targets achieved:
- Keyword search: <100ms (actual: ~50ms)
- Category browse: <100ms (actual: ~30ms)
- Database operations: <50ms (actual: ~20ms)
- Fully offline capable

## Backward Compatibility

All original modes still work:
- Interactive fzf mode
- Direct flag lookup (bash-helper ls size)
- --list and --help flags

## Technical Changes

bash-helper.sh:
- Added 370+ lines of new functionality
- New functions: search_by_keywords, show_task, mode_ask, mode_category, mode_explain
- Enhanced help with ASCII banner and better organization
- Added graceful degradation (works without jq for original modes)

New files:
- commands-db.json (20 tasks, 450+ lines)
- ENHANCEMENT-PROPOSAL.md (architectural design)
- PHASE-1-COMPLETE.md (implementation summary)
- AI-INTEGRATION-OPTIONS.md (AI integration guide for Phase 3)

## Dependencies

- jq: Required for natural language query modes (graceful fallback)
- fzf: Required for interactive mode only (unchanged)

## Example Usage

bash-helper ask "find large files"
bash-helper category files
bash-helper explain "tar -czf archive.tar.gz folder/"
bash-helper task "compress folder"

## Version

2.0.0 - Phase 1 Complete

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 21:02:56 -07:00
Trilltechnician effbd8ebe5 feat: Add CLI parameter support for direct command lookup
- Add --help flag with comprehensive usage documentation
- Add --list flag to show all available commands
- Add direct mode: bash-helper COMMAND [FILTER]
- Keep interactive fzf mode as default (when no args)
- Improve error handling and user feedback
- Add better formatting with colored output
- Support both interactive and non-interactive usage

Examples:
  bash-helper              # Interactive mode (original behavior)
  bash-helper ls           # Direct: show all ls flags
  bash-helper ls size      # Direct: show ls flags with 'size'
  bash-helper --help       # Show usage
  bash-helper --list       # List all commands

This makes the tool more versatile for both interactive exploration
and quick CLI lookups without requiring fzf for direct usage.
2025-10-27 20:48:33 -07:00
Trilltechnician a7aa456cd2 Initial commit: Add bash-helper.sh with comprehensive documentation 2025-10-27 20:19:45 -07:00
trill-technician 4484aaece2 Initial commit 2025-10-27 20:19:45 -07:00