diff --git a/docs/AI-INTEGRATION-OPTIONS.md b/docs/AI-INTEGRATION-OPTIONS.md index 262345b..0efa38e 100644 --- a/docs/AI-INTEGRATION-OPTIONS.md +++ b/docs/AI-INTEGRATION-OPTIONS.md @@ -1,8 +1,8 @@ -# Local AI Model Integration Options for Bash Buddy +# Local AI Model Integration Options for Super Man ## Overview -This document outlines options for integrating local AI models into Bash Buddy for advanced natural language to bash command translation. +This document outlines options for integrating local AI models into Super Man for advanced natural language to bash command translation. ## Why Local AI Models? @@ -12,7 +12,7 @@ This document outlines options for integrating local AI models into Bash Buddy f - **Free**: No API costs - **Customizable**: Can fine-tune for specific use cases -## Recommended: Ollama (Best for Bash Buddy) +## Recommended: Ollama (Best for Super Man) ### Why Ollama? @@ -69,7 +69,7 @@ Bash command:" } # Usage -bash-helper ai "find all python files modified in last week" +super-man ai "find all python files modified in last week" ``` ### Performance @@ -208,7 +208,7 @@ npm install -g @builder.io/ai-shell **Note**: Requires OpenAI API key (not fully local), but excellent prompt engineering. Could adapt prompts for local models. -## Recommendation for Bash Buddy +## Recommendation for Super Man **Use Ollama with CodeLlama 7B** @@ -223,8 +223,8 @@ npm install -g @builder.io/ai-shell ### Implementation Plan (Phase 3) ```bash -# New mode in bash-helper.sh -bash-helper ai "find all log files modified today and compress them" +# New mode in super-man.sh +super-man ai "find all log files modified today and compress them" # Workflow: # 1. Check if Ollama is running @@ -257,7 +257,7 @@ Bash command: ```bash # Cache location -~/.cache/bash-helper/ai-responses/ +~/.cache/super-man/ai-responses/ # Cache key: MD5 of query # Cache value: JSON with command, explanation, timestamp diff --git a/docs/ENHANCEMENT-PROPOSAL.md b/docs/ENHANCEMENT-PROPOSAL.md index bdaa6cc..a03b2d9 100644 --- a/docs/ENHANCEMENT-PROPOSAL.md +++ b/docs/ENHANCEMENT-PROPOSAL.md @@ -1,7 +1,7 @@ -# Bash Buddy Enhancement Proposal +# Super Man Enhancement Proposal ## π― Goal -Transform bash-helper into an intelligent CLI assistant that can: +Transform super-man into an intelligent CLI assistant that can: - Accept natural language questions - Return relevant bash commands with examples - Explain flags in context @@ -14,13 +14,13 @@ Transform bash-helper into an intelligent CLI assistant that can: **Use Case:** Simple, common tasks ```bash -bash-helper "list files by size" +super-man "list files by size" # Returns: ls -lhS -bash-helper "find large files" +super-man "find large files" # Returns: find . -type f -size +100M -exec ls -lh {} \; -bash-helper "search in files" +super-man "search in files" # Returns: grep -r "pattern" . ``` @@ -33,11 +33,11 @@ bash-helper "search in files" **Use Case:** More complex tasks with variations ```bash -bash-helper "compress all logs older than 30 days" +super-man "compress all logs older than 30 days" # Returns: find /var/log -name "*.log" -mtime +30 -exec gzip {} \; # Explanation: Finds logs older than 30 days and compresses them -bash-helper "monitor cpu usage every 2 seconds" +super-man "monitor cpu usage every 2 seconds" # Returns: watch -n 2 'top -b -n 1 | head -20' ``` @@ -50,7 +50,7 @@ bash-helper "monitor cpu usage every 2 seconds" **Use Case:** Complex, unique queries ```bash -bash-helper --ai "extract all email addresses from files and save to csv" +super-man --ai "extract all email addresses from files and save to csv" # Uses local Ollama/llama.cpp for understanding # Generates: grep -roh '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b' . | sort -u > emails.csv ``` @@ -66,29 +66,29 @@ bash-helper --ai "extract all email addresses from files and save to csv" ```bash # Ask a question -bash-helper ask "how do I find files modified today" +super-man ask "how do I find files modified today" # Get command + explanation -bash-helper explain "what does find . -name '*.log' do" +super-man explain "what does find . -name '*.log' do" # Get examples for a task -bash-helper examples "working with archives" +super-man examples "working with archives" ``` ### 2. Task-Based Categories ```bash # Browse by category -bash-helper category files # File operations -bash-helper category network # Network commands -bash-helper category system # System monitoring -bash-helper category text # Text processing +super-man category files # File operations +super-man category network # Network commands +super-man category system # System monitoring +super-man category text # Text processing ``` ### 3. Interactive Examples ```bash -bash-helper demo "find and replace in files" +super-man demo "find and replace in files" # Shows: # 1. Basic: sed -i 's/old/new/g' file.txt # 2. Recursive: find . -type f -exec sed -i 's/old/new/g' {} + @@ -98,7 +98,7 @@ bash-helper demo "find and replace in files" ### 4. Command Builder ```bash -bash-helper build +super-man build # Interactive wizard: # What do you want to do? # > Find files @@ -186,8 +186,8 @@ bash-helper build **Files to create:** - `commands-db.json` - Task database -- `bash-helper-search.sh` - Search functionality -- `bash-helper-ask.sh` - Natural language queries +- `super-man-search.sh` - Search functionality +- `super-man-ask.sh` - Natural language queries ### Phase 2: Pattern Matching (Week 2) - Template-based command generation @@ -205,26 +205,26 @@ bash-helper build - Graceful fallback **Integration points:** -- `bash-helper --ai "complex query"` +- `super-man --ai "complex query"` - Local llama3 or codellama -- Response caching in ~/.cache/bash-helper/ +- Response caching in ~/.cache/super-man/ ## π¨ Enhanced CLI Interface ```bash # Current -bash-helper ls size # Show ls flags with 'size' +super-man ls size # Show ls flags with 'size' # Enhanced -bash-helper ask "show largest files" -bash-helper task "compress old logs" -bash-helper explain "tar -czf archive.tar.gz folder/" -bash-helper category files -bash-helper search "find duplicate" -bash-helper build # Interactive builder -bash-helper recent # Recently used commands -bash-helper bookmark "useful-find-command" -bash-helper --ai "complex natural language query" +super-man ask "show largest files" +super-man task "compress old logs" +super-man explain "tar -czf archive.tar.gz folder/" +super-man category files +super-man search "find duplicate" +super-man build # Interactive builder +super-man recent # Recently used commands +super-man bookmark "useful-find-command" +super-man --ai "complex natural language query" ``` ## π¦ Database Content Areas @@ -262,7 +262,7 @@ bash-helper --ai "complex natural language query" ## π§ Technical Architecture ``` -bash-helper (main script) +super-man (main script) β ββ> Mode Detection β ββ> --help, --list (existing) @@ -290,7 +290,7 @@ bash-helper (main script) ### Fast Lookup Strategy ```bash # Pre-indexed keywordβcommand mapping -KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx +KEYWORD_INDEX=~/.local/share/super-man/keywords.idx # On first run: build index # Subsequent runs: instant lookup @@ -303,7 +303,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx ### Caching ```bash -~/.cache/bash-helper/ +~/.cache/super-man/ βββ ai-responses/ # Cached LLM responses βββ recent-commands # History βββ bookmarks.json # User bookmarks @@ -313,7 +313,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx ### Scenario 1: New User Learning ```bash -$ bash-helper ask "how to find text in files" +$ super-man ask "how to find text in files" π Task: Search for text in files @@ -343,7 +343,7 @@ Related tasks: ### Scenario 2: Quick Lookup ```bash -$ bash-helper task "compress folder" +$ super-man task "compress folder" π‘ Quick answer: @@ -355,13 +355,13 @@ Flags explained: -f : File name follows Try also: - bash-helper explain "tar -czf archive.tar.gz folder/" - bash-helper category files + super-man explain "tar -czf archive.tar.gz folder/" + super-man category files ``` ### Scenario 3: Complex Query (with AI) ```bash -$ bash-helper --ai "find all python files modified in last week, exclude virtual environments, and count lines of code" +$ super-man --ai "find all python files modified in last week, exclude virtual environments, and count lines of code" π€ AI Assistant (using local LLM) @@ -389,21 +389,21 @@ curl -fsSL https://ollama.com/install.sh | sh # Pull a code-focused model ollama pull codellama:7b -# Configure bash-helper -bash-helper config set llm.enable true -bash-helper config set llm.model codellama:7b +# Configure super-man +super-man config set llm.enable true +super-man config set llm.model codellama:7b ``` ### Usage ```bash # First time (generates command) -bash-helper --ai "complex query" # ~3s +super-man --ai "complex query" # ~3s # Second time (cached) -bash-helper --ai "complex query" # <10ms +super-man --ai "complex query" # <10ms # Clear cache -bash-helper cache clear +super-man cache clear ``` ## π Success Metrics diff --git a/docs/FINAL-FIXES-COMPLETE.md b/docs/FINAL-FIXES-COMPLETE.md index 4d62a1a..d21caf9 100644 --- a/docs/FINAL-FIXES-COMPLETE.md +++ b/docs/FINAL-FIXES-COMPLETE.md @@ -1,4 +1,4 @@ -# Bash Buddy - Final UI Fixes Complete! β +# Super Man - Final UI Fixes Complete! β ## Date: 2025-10-28 (Session 2) @@ -171,7 +171,7 @@ formatted_line="...${COLORIZED_SYNTAX}" # Colorized ### Test 1: Explain Mode ```bash -./bash-helper.sh explain tail +./super-man.sh explain tail ``` **Result**: β PASS - tail in cyan + bold @@ -190,7 +190,7 @@ formatted_line="...${COLORIZED_SYNTAX}" # Colorized ### Test 3: Literal Escape Code Check ```bash -./bash-helper.sh explain tar | grep '\\033' +./super-man.sh explain tar | grep '\\033' ``` **Result**: β PASS (No matches) - No literal `\033` found @@ -246,7 +246,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]... **Commit**: `3af2b2a` **Message**: fix(ui): Fix color rendering and flush-right alignment **Branch**: testing-suite -**Files**: bash-helper.sh (+41, -31 lines) +**Files**: super-man.sh (+41, -31 lines) **Status**: β Pushed to remote --- @@ -289,7 +289,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]... ### Ready to Create PR! -**PR URL**: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +**PR URL**: http://localhost:3030/trill-technician/super-man/compare/main...testing-suite **What's Included**: - Complete testing suite (45+ tests) @@ -300,7 +300,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]... ### To Create PR: 1. Open the URL above -2. Title: `feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements` +2. Title: `feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements` 3. Copy description from `PR-DESCRIPTION.md` 4. Create and merge! diff --git a/docs/PHASE-1-COMPLETE.md b/docs/PHASE-1-COMPLETE.md index a866a61..c05dc86 100644 --- a/docs/PHASE-1-COMPLETE.md +++ b/docs/PHASE-1-COMPLETE.md @@ -2,7 +2,7 @@ ## Overview -Successfully implemented Phase 1 of the Bash Buddy enhancement proposal, adding intelligent natural language query capabilities while maintaining fast, local operation. +Successfully implemented Phase 1 of the Super Man enhancement proposal, adding intelligent natural language query capabilities while maintaining fast, local operation. ## What Was Added @@ -27,9 +27,9 @@ Each task includes: #### **ask** mode - Natural language queries ```bash -bash-helper ask "find large files" -bash-helper ask "compress folder" -bash-helper ask "search text in files" +super-man ask "find large files" +super-man ask "compress folder" +super-man ask "search text in files" ``` Features: @@ -40,26 +40,26 @@ Features: #### **task** mode - Task descriptions ```bash -bash-helper task "show disk usage" -bash-helper task "download file from url" +super-man task "show disk usage" +super-man task "download file from url" ``` (Same as `ask` mode - both use keyword search) #### **category** mode - Browse by category ```bash -bash-helper category files -bash-helper category network -bash-helper category system -bash-helper category text +super-man category files +super-man category network +super-man category system +super-man category text ``` Shows all tasks in a category with compact format. #### **explain** mode - Explain commands ```bash -bash-helper explain "tar -czf archive.tar.gz folder/" -bash-helper explain "find . -name '*.txt'" +super-man explain "tar -czf archive.tar.gz folder/" +super-man explain "find . -name '*.txt'" ``` Features: @@ -87,16 +87,16 @@ Results sorted by relevance score, filters out words <3 characters. All original modes still work: ```bash -bash-helper # Interactive fzf mode -bash-helper ls size # Direct flag lookup -bash-helper --list # List commands -bash-helper --help # Show help +super-man # Interactive fzf mode +super-man ls size # Direct flag lookup +super-man --list # List commands +super-man --help # Show help ``` ## Technical Implementation ### Files Modified -- **bash-helper.sh** (+370 lines) +- **super-man.sh** (+370 lines) - Added database reading and search functions - Implemented keyword matching algorithm with scoring - Added 4 new display modes @@ -152,7 +152,7 @@ All modes tested and working: ```bash # Find large files -$ bash-helper ask "find large files" +$ super-man ask "find large files" Found 5 matches: 1. Find files larger than 100MB @@ -163,7 +163,7 @@ Found 5 matches: ... # Specific query (single result with details) -$ bash-helper ask "symlink" +$ super-man ask "symlink" Task: Create symbolic link to file or directory Category: files @@ -185,7 +185,7 @@ Examples: ### Browse by Category ```bash -$ bash-helper category files +$ super-man category files Category: File Operations @@ -203,7 +203,7 @@ Category: File Operations ### Explain Commands ```bash -$ bash-helper explain "tar -czf archive.tar.gz folder/" +$ super-man explain "tar -czf archive.tar.gz folder/" Command: tar -czf archive.tar.gz folder/ @@ -217,7 +217,7 @@ Flag explanations: ## Educational Value -The enhancements make Bash Buddy a learning platform: +The enhancements make Super Man a learning platform: 1. **Discovery**: Browse categories to learn what's possible 2. **Examples**: See real-world usage patterns for each task @@ -281,4 +281,4 @@ Local LLM integration with Ollama for complex queries: - Related task suggestions - Comprehensive examples -Bash Buddy is now an intelligent CLI assistant while remaining fast, local, and easy to use! +Super Man is now an intelligent CLI assistant while remaining fast, local, and easy to use! diff --git a/docs/PHASE-1-DEMO.md b/docs/PHASE-1-DEMO.md index aac1e7f..0e5cbb2 100644 --- a/docs/PHASE-1-DEMO.md +++ b/docs/PHASE-1-DEMO.md @@ -14,7 +14,7 @@ ### 1. ASCII Banner & Updated Help ```bash -$ bash-helper --help +$ super-man --help ``` **Output:** @@ -28,9 +28,9 @@ $ bash-helper --help Your Intelligent CLI Assistant for Bash QUICK START - bash-helper ask "find large files" # Ask a question - bash-helper category files # Browse by category - bash-helper explain "tar -czf" # Explain a command + super-man ask "find large files" # Ask a question + super-man category files # Browse by category + super-man explain "tar -czf" # Explain a command MODES Natural Language Queries: @@ -53,7 +53,7 @@ MODES #### Query: "find large files" ```bash -$ bash-helper ask "find large files" +$ super-man ask "find large files" ``` **Output:** @@ -83,7 +83,7 @@ Tip: Use more specific keywords to narrow results #### Query: "symlink" (Single Result - Full Details) ```bash -$ bash-helper ask "symlink" +$ super-man ask "symlink" ``` **Output:** @@ -122,7 +122,7 @@ Related tasks: ### 3. Category Browsing ```bash -$ bash-helper category files +$ super-man category files ``` **Output:** @@ -162,7 +162,7 @@ Category: File Operations #### List All Categories ```bash -$ bash-helper category +$ super-man category ``` **Output:** @@ -174,13 +174,13 @@ Available categories: network : Network Operations system : System Monitoring -Usage: bash-helper category NAME +Usage: super-man category NAME ``` ### 4. Command Explanation ```bash -$ bash-helper explain "tar -czf archive.tar.gz folder/" +$ super-man explain "tar -czf archive.tar.gz folder/" ``` **Output:** @@ -206,7 +206,7 @@ Flag explanations: #### Direct Flag Lookup ```bash -$ bash-helper ls size +$ super-man ls size ``` **Output:** @@ -293,7 +293,7 @@ All queries tested on the system: ## File Changes ### Modified -- **bash-helper.sh**: +370 lines (now 700+ total) +- **super-man.sh**: +370 lines (now 700+ total) - Added intelligent search functions - Implemented 4 new query modes - Enhanced UI with ASCII banner @@ -315,7 +315,7 @@ All queries tested on the system: **Net Change**: +2,048 lines **Pushed to Gitea**: β -**URL**: http://localhost:3030/trill-technician/bash-buddy +**URL**: http://localhost:3030/trill-technician/super-man ## What Users Can Do Now @@ -339,7 +339,7 @@ All queries tested on the system: ## Educational Value -Bash Buddy is now a **learning platform**: +Super Man is now a **learning platform**: 1. **Discovery**: Browse categories to see what's possible 2. **Examples**: Real-world usage patterns for each task @@ -373,6 +373,6 @@ The system is designed for continuous improvement. Users can: --- -**Bash Buddy v2.0.0 - Phase 1 Complete** π +**Super Man v2.0.0 - Phase 1 Complete** π From simple flag lookup to intelligent CLI assistant in one upgrade! diff --git a/docs/PR-DESCRIPTION.md b/docs/PR-DESCRIPTION.md index b8ce2df..c225d36 100644 --- a/docs/PR-DESCRIPTION.md +++ b/docs/PR-DESCRIPTION.md @@ -1,8 +1,8 @@ -# Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements +# Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements ## Overview -This PR introduces a complete testing suite and comprehensive UI improvements for Bash Buddy, elevating the user experience across all operating modes while ensuring code quality and performance. +This PR introduces a complete testing suite and comprehensive UI improvements for Super Man, elevating the user experience across all operating modes while ensuring code quality and performance. ## What's New @@ -41,7 +41,7 @@ This PR introduces a complete testing suite and comprehensive UI improvements fo ## Technical Details ### Files Changed -- `bash-helper.sh` - Core improvements (+200 lines) +- `super-man.sh` - Core improvements (+200 lines) - `test-suite.sh` - New comprehensive testing framework - Multiple documentation files @@ -114,25 +114,25 @@ After Selection: ### Run Test Suite ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man ./test-suite.sh ``` ### Test Interactive Mode ```bash -./bash-helper.sh +./super-man.sh # Try: fuzzy search β select command β browse flags β press Enter β repeat ``` ### Test Explain Mode with Examples ```bash -./bash-helper.sh explain find +./super-man.sh explain find # Look for SYNTAX and EXAMPLE sections ``` ### Test Fuzzy Flag Search ```bash -./bash-helper.sh ls +./super-man.sh ls # Fuzzy flag browser opens automatically after command info # Type keywords like "color" or "time" to search ``` diff --git a/docs/PR-INSTRUCTIONS.md b/docs/PR-INSTRUCTIONS.md index 20c4ad5..36ee637 100644 --- a/docs/PR-INSTRUCTIONS.md +++ b/docs/PR-INSTRUCTIONS.md @@ -12,7 +12,7 @@ **PR Creation URL:** ``` -http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +http://localhost:3030/trill-technician/super-man/compare/main...testing-suite ``` **Steps:** @@ -24,7 +24,7 @@ http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite ### Option 2: Via CLI (if authenticated) ```bash -cd ~/coding/bash/bash-buddy +cd ~/coding/bash/super-man tea pr create --base main --head testing-suite ``` @@ -40,7 +40,7 @@ feat(testing): Add comprehensive testing suite with performance analysis ```markdown ## Overview -This PR adds a complete testing infrastructure for Bash Buddy v2.1.0 with: +This PR adds a complete testing infrastructure for Super Man v2.1.0 with: - Automated testing for all operating modes - Performance benchmarking and analysis - Detailed reporting (JSON, Markdown, HTML) @@ -144,7 +144,7 @@ Once the PR is created: git diff main testing-suite # Or via web interface -http://localhost:3030/trill-technician/bash-buddy/pulls +http://localhost:3030/trill-technician/super-man/pulls ``` ### Test the Changes (Optional) @@ -170,7 +170,7 @@ cat reports/performance-report.md ### Merge via CLI ```bash -cd ~/coding/bash/bash-buddy +cd ~/coding/bash/super-man git checkout main git merge testing-suite git push origin main @@ -236,7 +236,7 @@ Features: | Action | Command/URL | |--------|-------------| -| **Create PR** | http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite | +| **Create PR** | http://localhost:3030/trill-technician/super-man/compare/main...testing-suite | | **View Branch** | `git log testing-suite` | | **Run Tests** | `cd tests/ && ./run-all-tests.sh` | | **View Reports** | `cat tests/reports/performance-report.md` | diff --git a/docs/README.md b/docs/README.md index f6dd43d..c19b942 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# Bash Buddy +# Super Man π CLI assistant for impromptu bash scripting help @@ -28,24 +28,24 @@ sudo pacman -S fzf # Arch ```bash # Clone the repository -git clone http://localhost:3030/trill-technician/bash-buddy.git -cd bash-buddy +git clone http://localhost:3030/trill-technician/super-man.git +cd super-man # Make executable -chmod +x bash-helper.sh +chmod +x super-man.sh # Optional: Install system-wide -sudo cp bash-helper.sh /usr/local/bin/bash-helper +sudo cp super-man.sh /usr/local/bin/super-man # Or add to your PATH -echo 'export PATH="$HOME/bash-buddy:$PATH"' >> ~/.bashrc +echo 'export PATH="$HOME/super-man:$PATH"' >> ~/.bashrc source ~/.bashrc ``` ## Usage ```bash -./bash-helper.sh +./super-man.sh ``` ### Workflow @@ -59,7 +59,7 @@ source ~/.bashrc ### Example Session ``` -$ ./bash-helper.sh +$ ./super-man.sh > ls:List directory contents cd:Change the current directory @@ -102,7 +102,7 @@ The script includes help for these common bash commands: ### Adding More Commands -Edit the `COMMANDS` array in `bash-helper.sh`: +Edit the `COMMANDS` array in `super-man.sh`: ```bash COMMANDS=( @@ -143,7 +143,7 @@ NC='\033[0m' # No Color ```bash # Add to ~/.bashrc -alias bh='bash-helper.sh' +alias bh='super-man.sh' ``` ## Contributing diff --git a/docs/READY-TO-MERGE.md b/docs/READY-TO-MERGE.md index 22912b6..1167ae3 100644 --- a/docs/READY-TO-MERGE.md +++ b/docs/READY-TO-MERGE.md @@ -1,4 +1,4 @@ -# Bash Buddy v2.1.0 - Ready to Merge! π +# Super Man v2.1.0 - Ready to Merge! π ## PR Status: READY β @@ -56,14 +56,14 @@ bdf3026 docs(pr): Add PR creation instructions and merge guide ### Step 1: Open PR Creation Page ``` -URL: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +URL: http://localhost:3030/trill-technician/super-man/compare/main...testing-suite ``` ### Step 2: Fill in PR Details **Title:** ``` -feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements +feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements ``` **Description:** @@ -80,11 +80,11 @@ Copy the entire contents of `PR-DESCRIPTION.md` into the description field. ## Create PR - Option 2: GitHub CLI (if installed) ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man # Using gh CLI gh pr create \ - --title "feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements" \ + --title "feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements" \ --body-file PR-DESCRIPTION.md \ --base main \ --head testing-suite @@ -93,10 +93,10 @@ gh pr create \ ## Create PR - Option 3: Tea CLI (if working) ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man tea pr create \ - --title "feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements" \ + --title "feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements" \ --description "$(cat PR-DESCRIPTION.md)" \ --base main \ --head testing-suite @@ -106,7 +106,7 @@ tea pr create \ ### Check Branch Status ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man git status git log main..testing-suite --oneline ``` @@ -117,20 +117,20 @@ git log main..testing-suite --oneline ./test-suite.sh # Interactive mode -./bash-helper.sh +./super-man.sh # Explain mode with examples -./bash-helper.sh explain find +./super-man.sh explain find # Direct mode -./bash-helper.sh grep -i +./super-man.sh grep -i ``` ## After Merge ### Update Local Repository ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man # Switch to main git checkout main @@ -148,25 +148,25 @@ git push origin --delete testing-suite ### Verify Merge ```bash # Check version -./bash-helper.sh --version +./super-man.sh --version # Run tests on main ./test-suite.sh # Test interactive mode -./bash-helper.sh +./super-man.sh ``` ### Tag Release (Optional) ```bash -git tag -a v2.1.0 -m "Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements" +git tag -a v2.1.0 -m "Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements" git push origin v2.1.0 ``` ## Files to Review 1. **PR-DESCRIPTION.md** - Complete PR description (ready to paste) -2. **bash-helper.sh** - Main script with all improvements +2. **super-man.sh** - Main script with all improvements 3. **tests/** - Complete testing framework 4. **TESTING-SUITE.md** - Testing documentation 5. **PR-INSTRUCTIONS.md** - PR creation guide @@ -185,7 +185,7 @@ git push origin v2.1.0 ## PR URL (Direct Link) ``` -http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +http://localhost:3030/trill-technician/super-man/compare/main...testing-suite ``` **Copy this URL into your browser to create the PR immediately!** @@ -227,7 +227,7 @@ If you encounter any issues: ## Final Notes -This PR represents a significant upgrade to Bash Buddy: +This PR represents a significant upgrade to Super Man: - **3,253 net new lines** of functionality - **50+ practical examples** added - **45+ automated tests** for quality assurance diff --git a/docs/SESSION-COMPLETE.md b/docs/SESSION-COMPLETE.md index 5dba530..ed1fd68 100644 --- a/docs/SESSION-COMPLETE.md +++ b/docs/SESSION-COMPLETE.md @@ -1,4 +1,4 @@ -# Bash Buddy v2.1.0 - Session Complete! π +# Super Man v2.1.0 - Session Complete! π ## All User Requests Fulfilled @@ -37,7 +37,7 @@ ## What Was Changed ### Files Modified -- `bash-helper.sh` (+111 lines, -86 lines) +- `super-man.sh` (+111 lines, -86 lines) ### New Functions 1. `colorize_syntax()` - Parse and colorize syntax by element type @@ -122,11 +122,11 @@ Run this to test menu formatting: ## Next: Create PR -**PR URL**: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +**PR URL**: http://localhost:3030/trill-technician/super-man/compare/main...testing-suite ### Steps: 1. Open the URL above -2. Title: `feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements` +2. Title: `feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements` 3. Description: Copy from `PR-DESCRIPTION.md` 4. Create Pull Request 5. Review changes diff --git a/docs/TEST-ANALYSIS-REPORT.md b/docs/TEST-ANALYSIS-REPORT.md index 6c57198..5967fbf 100644 --- a/docs/TEST-ANALYSIS-REPORT.md +++ b/docs/TEST-ANALYSIS-REPORT.md @@ -1,4 +1,4 @@ -# Bash Buddy v2.1.0 - Test & Performance Analysis Report +# Super Man v2.1.0 - Test & Performance Analysis Report **Date**: 2025-10-28 **Test Suite Version**: 1.0 @@ -61,11 +61,11 @@ These tests expect static output with flag descriptions, but the new fuzzy flag **Example**: ```bash # OLD: Displayed flags statically -./bash-helper.sh ls size +./super-man.sh ls size # Output: -s, --size print sizes # NEW: Opens fzf browser -./bash-helper.sh ls size +./super-man.sh ls size # Opens interactive fuzzy search (requires user interaction) ``` @@ -73,7 +73,7 @@ These tests expect static output with flag descriptions, but the new fuzzy flag #### 2. Help Display Test (#1) **Test**: `--help` flag -**Expected**: Output contains "Bash Buddy" +**Expected**: Output contains "Super Man" **Actual**: Help displays correctly but uses different text **Impact**: **NONE** - Help displays perfectly @@ -145,7 +145,7 @@ These tests expect static output with flag descriptions, but the new fuzzy flag **Test Method**: Manual verification with explain mode **Result**: PASS ```bash -./bash-helper.sh explain tail +./super-man.sh explain tail # Colors render properly: # - tail in cyan + bold # - [OPTION], [FILE] in yellow @@ -407,9 +407,9 @@ All **user-facing functionality works perfectly**. ## Files Generated -**Test Logs**: `/home/dell/coding/bash/bash-buddy/tests/logs/` -**Performance Data**: `/home/dell/coding/bash/bash-buddy/tests/performance/` -**Reports**: `/home/dell/coding/bash/bash-buddy/tests/reports/` +**Test Logs**: `/home/dell/coding/bash/super-man/tests/logs/` +**Performance Data**: `/home/dell/coding/bash/super-man/tests/performance/` +**Reports**: `/home/dell/coding/bash/super-man/tests/reports/` **Key Reports**: - `test-report.json` - Machine-readable results @@ -419,7 +419,7 @@ All **user-facing functionality works perfectly**. **View HTML Report**: ``` -file:///home/dell/coding/bash/bash-buddy/tests/reports/performance-report.html +file:///home/dell/coding/bash/super-man/tests/reports/performance-report.html ``` --- @@ -445,6 +445,6 @@ file:///home/dell/coding/bash/bash-buddy/tests/reports/performance-report.html --- **Report Generated**: 2025-10-28 -**Analyst**: Claude (Bash Buddy Test Suite) +**Analyst**: Claude (Super Man Test Suite) **Version**: 2.1.0 **Branch**: testing-suite diff --git a/docs/TESTING-SUITE.md b/docs/TESTING-SUITE.md index 3a8e955..8d7922d 100644 --- a/docs/TESTING-SUITE.md +++ b/docs/TESTING-SUITE.md @@ -2,7 +2,7 @@ ## Overview -This PR adds a comprehensive testing framework for Bash Buddy v2.1.0 with automated testing for all operating modes, performance benchmarking, and detailed reporting capabilities. +This PR adds a comprehensive testing framework for Super Man v2.1.0 with automated testing for all operating modes, performance benchmarking, and detailed reporting capabilities. ## What's Added @@ -139,7 +139,7 @@ Plain text format for CI logs. ### Required - bash 4.0+ -- bash-helper.sh (the script being tested) +- super-man.sh (the script being tested) ### Optional - **jq** - JSON parsing (recommended) @@ -191,7 +191,7 @@ exit $EXIT_CODE ### GitHub Actions ```yaml -name: Test Bash Buddy +name: Test Super Man on: [push, pull_request] jobs: test: @@ -226,7 +226,7 @@ jobs: ``` βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ - Bash Buddy Test Suite + Super Man Test Suite 2025-10-28 00:30:15 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ @@ -234,7 +234,7 @@ jobs: ββββββββββββββββββββββββββββββββββββββββββββββββββββββ Test #1: Help display (--help) -β PASSED (45ms) - Output contains: "Bash Buddy" +β PASSED (45ms) - Output contains: "Super Man" Test #2: List all commands (--list) β PASSED (32ms) - Output contains: "Available commands" @@ -392,7 +392,7 @@ cd tests/ ## Conclusion -This comprehensive testing suite ensures Bash Buddy maintains high quality and performance standards across all operating modes. With 45+ test cases, performance benchmarking, and automated reporting, we can confidently develop and deploy new features while maintaining backward compatibility. +This comprehensive testing suite ensures Super Man maintains high quality and performance standards across all operating modes. With 45+ test cases, performance benchmarking, and automated reporting, we can confidently develop and deploy new features while maintaining backward compatibility. **Ready to merge!** π diff --git a/docs/UI-IMPROVEMENTS-FINAL.md b/docs/UI-IMPROVEMENTS-FINAL.md index 6e6c54c..75f8369 100644 --- a/docs/UI-IMPROVEMENTS-FINAL.md +++ b/docs/UI-IMPROVEMENTS-FINAL.md @@ -1,4 +1,4 @@ -# Bash Buddy - Final UI Improvements Complete! β +# Super Man - Final UI Improvements Complete! β ## Session Date: 2025-10-28 @@ -248,7 +248,7 @@ show_flags "$CMD" "$SYNTAX" "$DESC" ### Test 1: Colorized Syntax in Explain Mode ```bash -./bash-helper.sh explain tar +./super-man.sh explain tar ``` **Result**: β - Command "tar" in cyan + bold @@ -345,7 +345,7 @@ SYNTAX: ## Files Changed -### `bash-helper.sh` +### `super-man.sh` **Changes**: +111 lines, -86 lines (net +25) **Sections Modified**: @@ -372,7 +372,7 @@ SYNTAX: **Push Status**: β Pushed to remote -**PR URL**: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +**PR URL**: http://localhost:3030/trill-technician/super-man/compare/main...testing-suite --- @@ -415,7 +415,7 @@ Ready to merge: YES β ### Option 1: Create PR via Web Interface ``` -URL: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite +URL: http://localhost:3030/trill-technician/super-man/compare/main...testing-suite ``` 1. Open URL 2. Copy PR description from `PR-DESCRIPTION.md` @@ -423,13 +423,13 @@ URL: http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-su ### Option 2: Test Locally First ```bash -cd /home/dell/coding/bash/bash-buddy +cd /home/dell/coding/bash/super-man # Test explain mode with colorized syntax -./bash-helper.sh explain find +./super-man.sh explain find # Test interactive menu (if fzf available) -./bash-helper.sh +./super-man.sh # Run full test suite ./test-suite.sh @@ -441,7 +441,7 @@ git checkout main git pull origin main git branch -d testing-suite git push origin --delete testing-suite -git tag -a v2.1.0 -m "Bash Buddy v2.1.0" +git tag -a v2.1.0 -m "Super Man v2.1.0" git push origin v2.1.0 ``` @@ -469,6 +469,6 @@ The result is a professional, polished UI with: **Created**: 2025-10-28 **Session**: UI Improvements - Color Coordination & UX Fixes **Branch**: testing-suite (9 commits) -**Files**: bash-helper.sh (+111, -86) +**Files**: super-man.sh (+111, -86) **Tests**: All passing β **User Approval**: Pending diff --git a/docs/USING-BHELPER-ALIAS.md b/docs/USING-SUPER-MAN-ALIAS.md similarity index 63% rename from docs/USING-BHELPER-ALIAS.md rename to docs/USING-SUPER-MAN-ALIAS.md index 34e497f..84294b0 100644 --- a/docs/USING-BHELPER-ALIAS.md +++ b/docs/USING-SUPER-MAN-ALIAS.md @@ -1,11 +1,11 @@ -# Using the `bhelper` Alias +# Using the `super-man` Alias ## Alias Configuration -Your bash alias has been updated to use the new Bash Buddy script: +Your bash alias has been updated to use the new Super Man script: ```bash -alias bhelper='/home/dell/coding/gitea-projects/bash-buddy/bash-helper.sh' +alias super-man='/home/dell/coding/gitea-projects/super-man/super-man.sh' ``` **Location:** `~/.bashrc` @@ -22,39 +22,39 @@ Or simply open a new terminal - the alias will be available automatically. ## Quick Start -Now you can use `bhelper` as a shortcut for all Bash Buddy features: +Now you can use `super-man` as a shortcut for all Super Man features: ### Natural Language Queries ```bash -bhelper ask "find large files" -bhelper task "compress a folder" -bhelper ask "search text in files" +super-man ask "find large files" +super-man task "compress a folder" +super-man ask "search text in files" ``` ### Browse by Category ```bash -bhelper category files -bhelper category network -bhelper category system -bhelper category text +super-man category files +super-man category network +super-man category system +super-man category text ``` ### Explain Commands ```bash -bhelper explain "tar -czf archive.tar.gz folder/" -bhelper explain "find . -name '*.txt'" +super-man explain "tar -czf archive.tar.gz folder/" +super-man explain "find . -name '*.txt'" ``` ### Original Modes (Still Work) ```bash -bhelper ls size # Direct flag lookup -bhelper # Interactive fzf mode -bhelper --help # Show help with ASCII banner -bhelper --list # List all commands +super-man ls size # Direct flag lookup +super-man # Interactive fzf mode +super-man --help # Show help with ASCII banner +super-man --list # List all commands ``` ## Examples @@ -62,7 +62,7 @@ bhelper --list # List all commands ### 1. Quick Command Lookup ```bash -$ bhelper ask "disk usage" +$ super-man ask "disk usage" Searching for: "disk usage" @@ -79,7 +79,7 @@ Found 5 matches: ### 2. Learn New Commands ```bash -$ bhelper category files +$ super-man category files Category: File Operations @@ -94,7 +94,7 @@ Category: File Operations ### 3. Understand Command Flags ```bash -$ bhelper explain "tar -czf archive.tar.gz folder/" +$ super-man explain "tar -czf archive.tar.gz folder/" Command: tar -czf archive.tar.gz folder/ @@ -119,7 +119,7 @@ Flag explanations: View complete help anytime: ```bash -bhelper --help +super-man --help ``` Shows: @@ -133,28 +133,28 @@ Shows: 1. **Use quotes for multi-word queries:** ```bash - bhelper ask "find large files" # β Correct - bhelper ask find large files # β Will only search "find" + super-man ask "find large files" # β Correct + super-man ask find large files # β Will only search "find" ``` 2. **Browse categories to discover commands:** ```bash - bhelper category files # See all file operations + super-man category files # See all file operations ``` 3. **Explain any command you're curious about:** ```bash - bhelper explain "any bash command here" + super-man explain "any bash command here" ``` 4. **Original direct lookup still works:** ```bash - bhelper ls size # Quick flag reference + super-man ls size # Quick flag reference ``` ## Version -**Bash Buddy v2.0.0** - Phase 1 Complete +**Super Man v2.0.0** - Phase 1 Complete With natural language queries, 20-task database, and intelligent search! @@ -162,7 +162,7 @@ With natural language queries, 20-task database, and intelligent search! All code is version-controlled and pushed to Gitea: -**URL:** http://localhost:3030/trill-technician/bash-buddy +**URL:** http://localhost:3030/trill-technician/super-man **Latest commits:** - `13cb602` - docs: Add Phase 1 live demo with examples and benchmarks @@ -171,12 +171,12 @@ All code is version-controlled and pushed to Gitea: ## Enjoy! -You now have a powerful, intelligent CLI assistant at your fingertips with just one command: **`bhelper`** +You now have a powerful, intelligent CLI assistant at your fingertips with just one command: **`super-man`** Try it now: ```bash source ~/.bashrc -bhelper ask "compress folder" +super-man ask "compress folder" ``` π Happy scripting! diff --git a/docs/VERSION-2.1-RELEASE.md b/docs/VERSION-2.1-RELEASE.md index d05e228..5860cee 100644 --- a/docs/VERSION-2.1-RELEASE.md +++ b/docs/VERSION-2.1-RELEASE.md @@ -1,4 +1,4 @@ -# Bash Buddy v2.1.0 - AI-Powered Release π€ +# Super Man v2.1.0 - AI-Powered Release π€ ## What's New @@ -7,11 +7,11 @@ Integrated **NL2SH model** for advanced natural language understanding: ```bash -bhelper ai "find all python files modified in last week" +super-man ai "find all python files modified in last week" # Generated: find /path/to/directory -type f -name "*.py" -mtime -7 -bhelper ai "count lines in all javascript files" -bhelper ai "compress all log files older than 30 days" +super-man ai "count lines in all javascript files" +super-man ai "compress all log files older than 30 days" ``` **Features:** @@ -75,37 +75,37 @@ Filter: -v ### 1. AI Mode (NEW!) π€ ```bash -bhelper ai "find large files in home directory" -bhelper ai "get network interface information" +super-man ai "find large files in home directory" +super-man ai "get network interface information" ``` ### 2. Natural Language Queries ```bash -bhelper ask "compress folder" # Database search -bhelper task "disk usage" # Task search +super-man ask "compress folder" # Database search +super-man task "disk usage" # Task search ``` ### 3. Category Browsing ```bash -bhelper category files -bhelper category network +super-man category files +super-man category network ``` ### 4. Command Explanation ```bash -bhelper explain "tar -czf archive.tar.gz folder/" +super-man explain "tar -czf archive.tar.gz folder/" ``` ### 5. Interactive Mode (Enhanced!) ```bash -bhelper # Browse 90+ commands with fzf +super-man # Browse 90+ commands with fzf # Select command β Enter filter β See flags ``` ### 6. Direct Flag Lookup ```bash -bhelper grep -v # Show grep flags with 'v' -bhelper ls size # Show ls flags about size +super-man grep -v # Show grep flags with 'v' +super-man ls size # Show ls flags about size ``` ## Performance @@ -146,20 +146,20 @@ bhelper ls size # Show ls flags about size ### Try AI Mode ```bash source ~/.bashrc # Reload alias if needed -bhelper ai "find files larger than 100MB" +super-man ai "find files larger than 100MB" ``` ### Try Enhanced Interactive ```bash -bhelper # Opens fzf with 90+ commands +super-man # Opens fzf with 90+ commands # Type to filter (e.g., "net" for network commands) # Select β Enter filter term β See relevant flags ``` ### All Commands Available ```bash -bhelper --help # See all modes -bhelper --list # List all 90+ commands +super-man --help # See all modes +super-man --list # List all 90+ commands ``` ## Installation @@ -178,26 +178,26 @@ Or open a new terminal. **Find Python files:** ```bash -$ bhelper ai "find python files modified this week" +$ super-man ai "find python files modified this week" Generated: find /path/to/directory -type f -name "*.py" -mtime -7 ``` **Count lines:** ```bash -$ bhelper ai "count lines in all javascript files" +$ super-man ai "count lines in all javascript files" Generated: find . -name "*.js" -exec wc -l {} + | awk '{sum+=$1} END {print sum}' ``` **Network info:** ```bash -$ bhelper ai "show my IP address" +$ super-man ai "show my IP address" Generated: ip addr show | grep 'inet ' | grep -v 127.0.0.1 ``` ### Interactive Mode Example ```bash -$ bhelper +$ super-man # Type "tar" β Select "tar:Archive files" # Enter filter: "extract" @@ -220,7 +220,7 @@ Your Ollama models: **Default:** NL2SH (specialized for shell commands) -To switch models, edit `mode_ai()` function in bash-helper.sh +To switch models, edit `mode_ai()` function in super-man.sh ## Troubleshooting @@ -242,7 +242,7 @@ This is now fixed in v2.1.0! The flag extraction has been completely rewritten. ### Want More Commands in Interactive Mode? -Edit the `COMMANDS` array in bash-helper.sh and add: +Edit the `COMMANDS` array in super-man.sh and add: ```bash "yourcommand:Description of what it does" ``` @@ -268,9 +268,9 @@ Edit the `COMMANDS` array in bash-helper.sh and add: ## Repository -**Location:** `~/coding/bash/bash-buddy/` +**Location:** `~/coding/bash/super-man/` -**Gitea:** http://localhost:3030/trill-technician/bash-buddy +**Gitea:** http://localhost:3030/trill-technician/super-man **Latest commit:** 3e5e431 @@ -286,9 +286,9 @@ Edit the `COMMANDS` array in bash-helper.sh and add: --- -**Bash Buddy v2.1.0** - Now with AI! ππ€ +**Super Man v2.1.0** - Now with AI! ππ€ Try it now: ```bash -bhelper ai "your complex query here" +super-man ai "your complex query here" ``` diff --git a/bash-helper.sh b/super-man.sh similarity index 88% rename from bash-helper.sh rename to super-man.sh index 4f0297e..2f08324 100755 --- a/bash-helper.sh +++ b/super-man.sh @@ -17,22 +17,25 @@ NC='\033[0m' # No Color # ASCII Banner show_banner() { - echo -e "${CYAN} ____ __ ____ __ __" - echo -e " / __ )____ ______/ /_ / __ )__ ______/ /___/ /_ __" - echo -e " / __ / __ \`/ ___/ __ \\ / __ / / / / __ / __ / / / /" - echo -e " / /_/ / /_/ (__ ) / / / / /_/ / /_/ / /_/ / /_/ / /_/ /" - echo -e "/_____/\\__,_/____/_/ /_/ /_____/\\__,_/\\__,_/\\__,_/\\__, /" - echo -e " /____/${NC}" - echo -e "${YELLOW} Your Intelligent CLI Assistant for Bash${NC}" + echo -en "${CYAN}" + cat <<'BANNER' + ____ __ __ +/ ___| _ _ _ __ ___ _ __ | \/ | __ _ _ __ +\___ \| | | | '_ \ / _ \ '__| | |\/| |/ _` | '_ \ + ___) | |_| | |_) | __/ | | | | | (_| | | | | +|____/ \__,_| .__/ \___|_| |_| |_|\__,_|_| |_| + |_| +BANNER + echo -e "${NC}${YELLOW} Your Intelligent CLI Assistant for Bash${NC}" echo "" } show_help() { show_banner echo -e "${BOLD}${YELLOW}QUICK START${NC}" - echo -e " ${GREEN}bash-helper ask \"find large files\"${NC} # Ask a question" - echo -e " ${GREEN}bash-helper category files${NC} # Browse by category" - echo -e " ${GREEN}bash-helper explain \"tar -czf\"${NC} # Explain a command" + echo -e " ${GREEN}super-man ask \"find large files\"${NC} # Ask a question" + echo -e " ${GREEN}super-man category files${NC} # Browse by category" + echo -e " ${GREEN}super-man explain \"tar -czf\"${NC} # Explain a command" echo "" echo -e "${BOLD}${YELLOW}MODES${NC}" echo -e " ${CYAN}Natural Language Queries:${NC}" @@ -57,17 +60,17 @@ show_help() { echo "" echo -e "${BOLD}${YELLOW}EXAMPLES${NC}" echo -e " ${DIM}# Natural language${NC}" - echo " bash-helper ask \"compress folder\"" - echo " bash-helper ask \"search text in files\"" - echo " bash-helper task \"monitor cpu usage\"" + echo " super-man ask \"compress folder\"" + echo " super-man ask \"search text in files\"" + echo " super-man task \"monitor cpu usage\"" echo "" echo -e " ${DIM}# Browse and learn${NC}" - echo " bash-helper category network" - echo " bash-helper explain \"find . -name '*.txt'\"" + echo " super-man category network" + echo " super-man explain \"find . -name '*.txt'\"" echo "" echo -e " ${DIM}# Original modes (still work)${NC}" - echo " bash-helper ls size # Direct flag lookup" - echo " bash-helper # Interactive fzf mode" + echo " super-man ls size # Direct flag lookup" + echo " super-man # Interactive fzf mode" echo "" echo -e "${BOLD}${YELLOW}REQUIREMENTS${NC}" echo -e " ${GREEN}β${NC} jq (for natural language queries)" @@ -75,8 +78,8 @@ show_help() { echo "" echo -e "${BOLD}${YELLOW}AI MODE${NC} π€" echo -e " ${GREEN}β NL2SH model detected!${NC} Use AI for complex queries:" - echo -e " ${GREEN}bash-helper ai \"find python files modified last week\"${NC}" - echo -e " ${GREEN}bash-helper ai \"count lines in all js files\"${NC}" + echo -e " ${GREEN}super-man ai \"find python files modified last week\"${NC}" + echo -e " ${GREEN}super-man ai \"count lines in all js files\"${NC}" echo "" echo " Other models available: llama3.2, qwen2.5" echo " To switch models, edit mode_ai() function" @@ -94,8 +97,8 @@ check_jq() { echo "Install it with: sudo apt install jq" echo "" echo "You can still use the original modes:" - echo " bash-helper COMMAND [FILTER]" - echo " bash-helper --interactive" + echo " super-man COMMAND [FILTER]" + echo " super-man --interactive" return 1 fi return 0 @@ -215,7 +218,7 @@ mode_ask() { if [ -z "$query" ]; then echo -e "${RED}Error: No query provided${NC}" - echo "Usage: bash-helper ask \"your question\"" + echo "Usage: super-man ask \"your question\"" return 1 fi @@ -230,8 +233,8 @@ mode_ask() { echo "" echo "Try:" echo " β’ Using different keywords" - echo " β’ Browse by category: bash-helper category files" - echo " β’ List all commands: bash-helper --list" + echo " β’ Browse by category: super-man category files" + echo " β’ List all commands: super-man --list" return 1 fi @@ -270,7 +273,7 @@ mode_category() { echo "" jq -r '.categories | to_entries[] | " \(.key) : \(.value.name)"' "$DB_FILE" echo "" - echo "Usage: bash-helper category NAME" + echo "Usage: super-man category NAME" return 1 fi @@ -310,10 +313,10 @@ mode_ai() { if [ -z "$user_query" ]; then echo -e "${RED}Error: No query provided${NC}" - echo "Usage: bash-helper ai \"your complex query\"" + echo "Usage: super-man ai \"your complex query\"" echo "" echo "Example:" - echo " bash-helper ai \"find all python files modified in last week\"" + echo " super-man ai \"find all python files modified in last week\"" return 1 fi @@ -324,7 +327,7 @@ mode_ai() { echo "Install Ollama:" echo " curl -fsSL https://ollama.com/install.sh | sh" echo "" - echo "For now, try: bash-helper ask \"$user_query\"" + echo "For now, try: super-man ask \"$user_query\"" return 1 fi @@ -353,7 +356,7 @@ mode_ai() { if [ -z "$response" ]; then echo -e "${RED}Error: No response from AI model${NC}" echo "" - echo "Try a simpler query or use: bash-helper ask \"$user_query\"" + echo "Try a simpler query or use: super-man ask \"$user_query\"" return 1 fi @@ -387,10 +390,10 @@ mode_explain() { if [ -z "$cmd_line" ]; then echo -e "${RED}Error: No command provided${NC}" - echo "Usage: bash-helper explain \"command with flags\"" + echo "Usage: super-man explain \"command with flags\"" echo "" echo "Example:" - echo " bash-helper explain \"tar -czf archive.tar.gz folder/\"" + echo " super-man explain \"tar -czf archive.tar.gz folder/\"" return 1 fi @@ -635,105 +638,116 @@ extract_all_flags() { local flags_output="" if type "$cmd_name" 2>/dev/null | grep -q "shell builtin"; then - # Shell builtin - use help command (basic format) - flags_output=$(help "$cmd_name" 2>/dev/null | grep -E '^\s*-') + # Shell builtin - parse the "Options:" block from `help`, formatting each + # entry as "flag β description" to match the man-page output below. + flags_output=$(help "$cmd_name" 2>/dev/null | awk ' + /^[[:space:]]+-/ { + line=$0; sub(/^[[:space:]]+/, "", line); + if (match(line, /[ ][ ]+|\t/)) { + flag=substr(line,1,RSTART-1); + desc=substr(line,RSTART+RLENGTH); gsub(/^[[:space:]]+|[[:space:]]+$/,"",desc); + printf "\033[1;33m%s\033[0m \033[2mβ\033[0m %s\n", flag, desc; + } else { + printf "\033[1;33m%s\033[0m\n", line; + } + }') elif command -v "$cmd_name" &> /dev/null; then - # External command - extract from man page OPTIONS or DESCRIPTION section with descriptions - local man_content=$(man "$cmd_name" 2>/dev/null | col -b) - - # Try OPTIONS section first, then DESCRIPTION (GNU coreutils use DESCRIPTION) - # Exclude the section headers themselves to prevent early AWK exit - local options_section=$(echo "$man_content" | sed -n '/^OPTIONS/,/^[A-Z][A-Z]/{/^OPTIONS/d; /^[A-Z][A-Z]/d; p;}' | head -300) - - if [ -z "$options_section" ]; then - # Try DESCRIPTION section instead - options_section=$(echo "$man_content" | sed -n '/^DESCRIPTION/,/^[A-Z][A-Z]/{/^DESCRIPTION/d; /^[A-Z][A-Z]/d; p;}' | head -300) - fi - - if [ -n "$options_section" ]; then - # Parse flags with their descriptions using portable AWK - # Man pages have two formats: - # 1. " --help Output..." (description on same line) - # 2. " -a, --all\n description..." (description on next line, deeply indented) - flags_output=$(echo "$options_section" | awk ' - BEGIN { flag=""; desc=""; } - - /^[[:space:]]*-/ { - # Print previous flag if exists - if (flag != "") { - gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc) - if (desc != "") { - printf "\033[1;33m%s\033[0m \033[2mβ\033[0m %s\n", flag, desc - } else { - printf "\033[1;33m%s\033[0m\n", flag - } - } - - # New flag line - extract flag and check for inline description - line = $0 - gsub(/^[[:space:]]+/, "", line) # Remove leading whitespace - - # Check if there is content after the flag (separated by multiple spaces/tabs) - # Flag pattern: starts with -, may have comma and long form - # Look for 2+ spaces/tabs separating flag from description - if (match(line, /^[^[:space:]]+([[:space:]]+[^[:space:]]+)?[[:space:]][[:space:]]+/)) { - # Description on same line - flag_end = RSTART + RLENGTH - 1 - flag = substr(line, 1, flag_end) - gsub(/[[:space:]]+$/, "", flag) # Trim trailing spaces - desc = substr(line, flag_end + 1) - gsub(/^[[:space:]]+/, "", desc) # Trim leading spaces from description - } else { - # No inline description, will be on next line(s) - flag = line - desc = "" - } - next - } - - /^[[:space:]]+[^-]/ { - # Description continuation line (indented, no leading dash) - if (flag != "") { - line = $0 - gsub(/^[[:space:]]+|[[:space:]]+$/, "", line) - if (desc == "") { - desc = line - } else { - desc = desc " " line - } - } - } - - /^[A-Z][A-Z]/ { - # Major section header - end of options - if (flag != "") { - gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc) - if (desc != "") { - printf "\033[1;33m%s\033[0m \033[2mβ\033[0m %s\n", flag, desc - } else { - printf "\033[1;33m%s\033[0m\n", flag - } - } - exit - } + # External command - parse the FULL man page. Instead of reading a single + # section (the old behaviour, which truncated curl/find/ps/git/tar/... to a + # handful of flags), classify every section as option-bearing or not, then + # extract every flag with its description across all option sections. + # `col -bx` normalises tabs to spaces so indentation can be compared. + local man_content=$(man "$cmd_name" 2>/dev/null | col -bx) + if [ -n "$man_content" ]; then + flags_output=$(printf '%s\n' "$man_content" | awk ' + { lines[++N]=$0; } END { - # Print last flag - if (flag != "") { - gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc) - if (desc != "") { - printf "\033[1;33m%s\033[0m \033[2mβ\033[0m %s\n", flag, desc - } else { - printf "\033[1;33m%s\033[0m\n", flag - } + # --- pre-pass: mark which sections actually contain option tags --- + secid=0; + for (i=1; i<=N; i++) { + raw=lines[i]; + if (raw ~ /^[A-Z]/) { secid++; sname[secid]=fw(raw); } + lsec[i]=secid; + if (taglike(i)) tcount[secid]++; } + for (s=1; s<=secid; s++) + secscan[s] = (sname[s] ~ /^OPTION/ || tcount[s] >= 3) ? 1 : 0; + + # --- main pass: emit "flag β description" for every option --- + flag=""; desc=""; curind=-1; + for (i=1; i<=N; i++) { + raw=lines[i]; + if (raw ~ /^[[:space:]]*$/) continue; # blank line + if (raw ~ /^[A-Z]/) { flush(); curind=-1; continue; } # section header + if (!secscan[lsec[i]]) continue; # skip prose sections + ind = match(raw, /[^ ]/) - 1; + t = raw; sub(/^[ ]+/, "", t); + + if (t ~ /^-/) { + if (ncommaopt(t) >= 3) { # comma-list prose, not a tag + if (flag != "" && ind > curind) adddesc(t); + continue; + } + if (flag != "" && ind > curind) { adddesc(t); continue; } # wrapped desc line + if (flag != "" && desc == "" && ind == curind) { # stacked alias + if (match(t, / +/)) { flag=flag", "substr(t,1,RSTART-1); desc=trim(substr(t,RSTART+RLENGTH)); } + else { flag=flag", "t; } + continue; + } + if (match(t, / +/)) { # description on same line + start_flag(substr(t,1,RSTART-1), trim(substr(t,RSTART+RLENGTH)), ind); continue; + } + j=i+1; while (j<=N && lines[j] ~ /^[[:space:]]*$/) j++; # look ahead + deeper = (j<=N && (match(lines[j],/[^ ]/)-1) > ind && trim(lines[j]) !~ /^-/); + if (deeper) { start_flag(t, "", ind); continue; } # description on next line(s) + split_tag(t, ind); continue; # single-space inline desc + } + if (flag != "") adddesc(t); # description continuation + } + flush(); } - ' | head -150) + function fw(s, w){ w=s; sub(/[[:space:]].*$/, "", w); return w; } + function ncommaopt(s, c,tmp){ tmp=s; c=gsub(/, +--?[A-Za-z]/, "", tmp); return c; } + function trim(s){ gsub(/^[[:space:]]+|[[:space:]]+$/, "", s); return s; } + function adddesc(s){ desc = (desc=="") ? trim(s) : desc" "trim(s); } + function start_flag(sig, d, k){ flush(); flag=sig; desc=d; curind=k; } + function taglike(i, raw,t,ind,j,nind){ + raw=lines[i]; + if (raw !~ /^[ ]+-/) return 0; + if (raw ~ /^[ ]+-{1,2}[A-Za-z0-9?][A-Za-z0-9?+._=-]* /) return 1; + ind = match(raw,/[^ ]/)-1; + j=i+1; while (j<=N && lines[j] ~ /^[[:space:]]*$/) j++; + if (j<=N) { nind=match(lines[j],/[^ ]/)-1; if (nind>ind && trim(lines[j]) !~ /^-/) return 1; } + return 0; + } + function split_tag(s, k, n,toks,p,tk,optend,sig,d){ + n=split(s,toks,/[ ]+/); optend=0; + for (p=1;p<=n;p++){ tk=toks[p]; + if (tk ~ /^-/) { optend=p; continue; } + if (tk ~ /^[A-Z0-9][A-Z0-9_<>|.=-]*[,]?$/) { optend=p; continue; } + if (tk ~ /^[<\[]/) { optend=p; continue; } + break; + } + if (optend==0) optend=1; + sig=""; for(p=1;p<=optend;p++) sig=(sig=="")?toks[p]:sig" "toks[p]; + d=""; for(p=optend+1;p<=n;p++) d=(d=="")?toks[p]:d" "toks[p]; + start_flag(sig, d, k); + } + function flush(){ + if (flag != "") { + desc=trim(desc); + if (desc != "") printf "\033[1;33m%s\033[0m \033[2mβ\033[0m %s\n", flag, desc; + else printf "\033[1;33m%s\033[0m\n", flag; + } + flag=""; desc=""; + } + ') fi - # Fallback: if no OPTIONS section, just get flag lines + # Fallback: nothing parsed (e.g. no man page) - grab raw flag lines if [ -z "$flags_output" ]; then - flags_output=$(echo "$man_content" | grep -E '^[[:space:]]*-' | head -100) + flags_output=$(printf '%s\n' "$man_content" | grep -E '^[[:space:]]*-' | head -100) fi fi @@ -1355,7 +1369,7 @@ if [ "$INTERACTIVE" = true ]; then echo "Error: fzf is not installed" echo "Install it with: sudo apt install fzf" echo "" - echo "Or use direct mode: bash-helper COMMAND [FILTER]" + echo "Or use direct mode: super-man COMMAND [FILTER]" exit 1 fi @@ -1386,7 +1400,7 @@ if [ "$INTERACTIVE" = true ]; then if [ -z "$SELECTED" ]; then # User pressed Esc or cancelled echo "" - echo -e "${YELLOW}Exiting Bash Buddy. Happy coding! π${NC}" + echo -e "${YELLOW}Exiting Super Man. Happy coding! π${NC}" exit 0 fi @@ -1415,14 +1429,7 @@ if [ "$INTERACTIVE" = true ]; then clear show_flags "$CMD" "$SYNTAX" "$DESC" - # After viewing flags, ask if user wants to search another command - echo "" - echo -e "${YELLOW}βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${NC}" - echo -e "${CYAN}Press Enter to search another command, or Ctrl+C to exit${NC}" - echo -e "${YELLOW}βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${NC}" - read -r - - # Clear screen for better UX + # Esc in the flag browser returns straight to the home menu (no intermediary step) clear done # Direct mode diff --git a/tests/README.md b/tests/README.md index d50d52d..da9d07d 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,6 @@ -# Bash Buddy Test Suite +# Super Man Test Suite -Comprehensive testing framework for Bash Buddy with performance analysis and automated reporting. +Comprehensive testing framework for Super Man with performance analysis and automated reporting. ## Overview @@ -177,7 +177,7 @@ Interactive HTML dashboard with: ### Required - **bash** 4.0+ - Shell interpreter -- **bash-helper.sh** - Script being tested +- **super-man.sh** - Script being tested ### Optional - **jq** - JSON parsing (for detailed analysis) @@ -210,7 +210,7 @@ brew install jq fzf expect bc **Output:** ``` βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ - Bash Buddy Test Suite + Super Man Test Suite 2025-01-XX XX:XX:XX βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ @@ -218,7 +218,7 @@ brew install jq fzf expect bc ββββββββββββββββββββββββββββββββββββββββββββββββββββββ Test #1: Help display (--help) -β PASSED (45ms) - Output contains: "Bash Buddy" +β PASSED (45ms) - Output contains: "Super Man" Test #2: List all commands (--list) β PASSED (32ms) - Output contains: "Available commands" @@ -257,7 +257,7 @@ Pass Rate: 95% **Output:** ``` βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ - Bash Buddy Performance Analysis + Super Man Performance Analysis 2025-01-XX XX:XX:XX βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ @@ -290,7 +290,7 @@ exit $EXIT_CODE ### GitHub Actions Example ```yaml -name: Test Bash Buddy +name: Test Super Man on: [push, pull_request] @@ -444,7 +444,7 @@ print_section "Custom Tests" run_test_with_output_check \ "My custom test" \ - "../bash-helper.sh ask 'my query'" \ + "../super-man.sh ask 'my query'" \ "expected output" print_summary @@ -498,15 +498,15 @@ Run test and verify output contains expected string. ```bash run_test_with_output_check \ "Help test" \ - "./bash-helper.sh --help" \ - "Bash Buddy" + "./super-man.sh --help" \ + "Super Man" ``` #### `run_benchmark(name, command, iterations)` Run performance benchmark with statistics. ```bash -run_benchmark "Ask mode" "./bash-helper.sh ask 'test'" 10 +run_benchmark "Ask mode" "./super-man.sh ask 'test'" 10 ``` #### `skip_test(name, reason)` @@ -612,7 +612,7 @@ A: Yes, but be careful with shared resources (log files, etc.) A: No, unless installing dependencies **Q: Will tests modify my system?** -A: No, tests only read/execute bash-helper.sh +A: No, tests only read/execute super-man.sh **Q: Can I run tests on macOS?** A: Yes, with dependencies installed via Homebrew @@ -632,7 +632,7 @@ A: Check `tests/logs/test_N_*.log` for detailed output ## License -Same as Bash Buddy - see main repository +Same as Super Man - see main repository ## Support @@ -642,6 +642,6 @@ Same as Bash Buddy - see main repository --- -**Bash Buddy Test Suite v1.0.0** +**Super Man Test Suite v1.0.0** Ensuring quality and performance at every commit! π diff --git a/tests/analyze-performance.sh b/tests/analyze-performance.sh index c0da0ad..2cd0191 100755 --- a/tests/analyze-performance.sh +++ b/tests/analyze-performance.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Performance Analysis Tool for Bash Buddy +# Performance Analysis Tool for Super Man # Analyzes test logs and benchmark data to generate insights # Color definitions @@ -27,7 +27,7 @@ mkdir -p "$REPORT_DIR" print_header() { echo -e "${BOLD}${CYAN}" echo "βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" - echo " Bash Buddy Performance Analysis" + echo " Super Man Performance Analysis" echo " $(date '+%Y-%m-%d %H:%M:%S')" echo "βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" echo -e "${NC}" @@ -59,7 +59,7 @@ generate_performance_report() { local bench_file="$PERF_LOG_DIR/benchmarks.csv" local report_file="$REPORT_DIR/performance-report.md" - echo "# Bash Buddy Performance Report" > "$report_file" + echo "# Super Man Performance Report" > "$report_file" echo "" >> "$report_file" echo "**Generated:** $(date '+%Y-%m-%d %H:%M:%S')" >> "$report_file" echo "" >> "$report_file" @@ -188,7 +188,7 @@ generate_html_report() {
-