refactor: rebrand bash-helper to super-man + ESC returns straight to menu
Rename bash-helper.sh -> super-man.sh and update all docs/tests to the super-man name and alias. In interactive mode, pressing Esc in the flag browser now returns directly to the home menu, removing the intermediary "Press Enter to search another command" prompt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# Local AI Model Integration Options for Bash Buddy
|
# Local AI Model Integration Options for Super Man
|
||||||
|
|
||||||
## Overview
|
## 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?
|
## 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
|
- **Free**: No API costs
|
||||||
- **Customizable**: Can fine-tune for specific use cases
|
- **Customizable**: Can fine-tune for specific use cases
|
||||||
|
|
||||||
## Recommended: Ollama (Best for Bash Buddy)
|
## Recommended: Ollama (Best for Super Man)
|
||||||
|
|
||||||
### Why Ollama?
|
### Why Ollama?
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ Bash command:"
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
bash-helper ai "find all python files modified in last week"
|
super-man ai "find all python files modified in last week"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Performance
|
### 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.
|
**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**
|
**Use Ollama with CodeLlama 7B**
|
||||||
|
|
||||||
@@ -223,8 +223,8 @@ npm install -g @builder.io/ai-shell
|
|||||||
### Implementation Plan (Phase 3)
|
### Implementation Plan (Phase 3)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# New mode in bash-helper.sh
|
# New mode in super-man.sh
|
||||||
bash-helper ai "find all log files modified today and compress them"
|
super-man ai "find all log files modified today and compress them"
|
||||||
|
|
||||||
# Workflow:
|
# Workflow:
|
||||||
# 1. Check if Ollama is running
|
# 1. Check if Ollama is running
|
||||||
@@ -257,7 +257,7 @@ Bash command:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Cache location
|
# Cache location
|
||||||
~/.cache/bash-helper/ai-responses/
|
~/.cache/super-man/ai-responses/
|
||||||
|
|
||||||
# Cache key: MD5 of query
|
# Cache key: MD5 of query
|
||||||
# Cache value: JSON with command, explanation, timestamp
|
# Cache value: JSON with command, explanation, timestamp
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Bash Buddy Enhancement Proposal
|
# Super Man Enhancement Proposal
|
||||||
|
|
||||||
## 🎯 Goal
|
## 🎯 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
|
- Accept natural language questions
|
||||||
- Return relevant bash commands with examples
|
- Return relevant bash commands with examples
|
||||||
- Explain flags in context
|
- Explain flags in context
|
||||||
@@ -14,13 +14,13 @@ Transform bash-helper into an intelligent CLI assistant that can:
|
|||||||
**Use Case:** Simple, common tasks
|
**Use Case:** Simple, common tasks
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash-helper "list files by size"
|
super-man "list files by size"
|
||||||
# Returns: ls -lhS
|
# Returns: ls -lhS
|
||||||
|
|
||||||
bash-helper "find large files"
|
super-man "find large files"
|
||||||
# Returns: find . -type f -size +100M -exec ls -lh {} \;
|
# Returns: find . -type f -size +100M -exec ls -lh {} \;
|
||||||
|
|
||||||
bash-helper "search in files"
|
super-man "search in files"
|
||||||
# Returns: grep -r "pattern" .
|
# Returns: grep -r "pattern" .
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -33,11 +33,11 @@ bash-helper "search in files"
|
|||||||
**Use Case:** More complex tasks with variations
|
**Use Case:** More complex tasks with variations
|
||||||
|
|
||||||
```bash
|
```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 {} \;
|
# Returns: find /var/log -name "*.log" -mtime +30 -exec gzip {} \;
|
||||||
# Explanation: Finds logs older than 30 days and compresses them
|
# 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'
|
# 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
|
**Use Case:** Complex, unique queries
|
||||||
|
|
||||||
```bash
|
```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
|
# 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
|
# 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
|
```bash
|
||||||
# Ask a question
|
# 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
|
# 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
|
# Get examples for a task
|
||||||
bash-helper examples "working with archives"
|
super-man examples "working with archives"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Task-Based Categories
|
### 2. Task-Based Categories
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Browse by category
|
# Browse by category
|
||||||
bash-helper category files # File operations
|
super-man category files # File operations
|
||||||
bash-helper category network # Network commands
|
super-man category network # Network commands
|
||||||
bash-helper category system # System monitoring
|
super-man category system # System monitoring
|
||||||
bash-helper category text # Text processing
|
super-man category text # Text processing
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Interactive Examples
|
### 3. Interactive Examples
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash-helper demo "find and replace in files"
|
super-man demo "find and replace in files"
|
||||||
# Shows:
|
# Shows:
|
||||||
# 1. Basic: sed -i 's/old/new/g' file.txt
|
# 1. Basic: sed -i 's/old/new/g' file.txt
|
||||||
# 2. Recursive: find . -type f -exec sed -i 's/old/new/g' {} +
|
# 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
|
### 4. Command Builder
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash-helper build
|
super-man build
|
||||||
# Interactive wizard:
|
# Interactive wizard:
|
||||||
# What do you want to do?
|
# What do you want to do?
|
||||||
# > Find files
|
# > Find files
|
||||||
@@ -186,8 +186,8 @@ bash-helper build
|
|||||||
|
|
||||||
**Files to create:**
|
**Files to create:**
|
||||||
- `commands-db.json` - Task database
|
- `commands-db.json` - Task database
|
||||||
- `bash-helper-search.sh` - Search functionality
|
- `super-man-search.sh` - Search functionality
|
||||||
- `bash-helper-ask.sh` - Natural language queries
|
- `super-man-ask.sh` - Natural language queries
|
||||||
|
|
||||||
### Phase 2: Pattern Matching (Week 2)
|
### Phase 2: Pattern Matching (Week 2)
|
||||||
- Template-based command generation
|
- Template-based command generation
|
||||||
@@ -205,26 +205,26 @@ bash-helper build
|
|||||||
- Graceful fallback
|
- Graceful fallback
|
||||||
|
|
||||||
**Integration points:**
|
**Integration points:**
|
||||||
- `bash-helper --ai "complex query"`
|
- `super-man --ai "complex query"`
|
||||||
- Local llama3 or codellama
|
- Local llama3 or codellama
|
||||||
- Response caching in ~/.cache/bash-helper/
|
- Response caching in ~/.cache/super-man/
|
||||||
|
|
||||||
## 🎨 Enhanced CLI Interface
|
## 🎨 Enhanced CLI Interface
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Current
|
# Current
|
||||||
bash-helper ls size # Show ls flags with 'size'
|
super-man ls size # Show ls flags with 'size'
|
||||||
|
|
||||||
# Enhanced
|
# Enhanced
|
||||||
bash-helper ask "show largest files"
|
super-man ask "show largest files"
|
||||||
bash-helper task "compress old logs"
|
super-man task "compress old logs"
|
||||||
bash-helper explain "tar -czf archive.tar.gz folder/"
|
super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
bash-helper category files
|
super-man category files
|
||||||
bash-helper search "find duplicate"
|
super-man search "find duplicate"
|
||||||
bash-helper build # Interactive builder
|
super-man build # Interactive builder
|
||||||
bash-helper recent # Recently used commands
|
super-man recent # Recently used commands
|
||||||
bash-helper bookmark "useful-find-command"
|
super-man bookmark "useful-find-command"
|
||||||
bash-helper --ai "complex natural language query"
|
super-man --ai "complex natural language query"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📦 Database Content Areas
|
## 📦 Database Content Areas
|
||||||
@@ -262,7 +262,7 @@ bash-helper --ai "complex natural language query"
|
|||||||
## 🔧 Technical Architecture
|
## 🔧 Technical Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
bash-helper (main script)
|
super-man (main script)
|
||||||
│
|
│
|
||||||
├─> Mode Detection
|
├─> Mode Detection
|
||||||
│ ├─> --help, --list (existing)
|
│ ├─> --help, --list (existing)
|
||||||
@@ -290,7 +290,7 @@ bash-helper (main script)
|
|||||||
### Fast Lookup Strategy
|
### Fast Lookup Strategy
|
||||||
```bash
|
```bash
|
||||||
# Pre-indexed keyword→command mapping
|
# 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
|
# On first run: build index
|
||||||
# Subsequent runs: instant lookup
|
# Subsequent runs: instant lookup
|
||||||
@@ -303,7 +303,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx
|
|||||||
|
|
||||||
### Caching
|
### Caching
|
||||||
```bash
|
```bash
|
||||||
~/.cache/bash-helper/
|
~/.cache/super-man/
|
||||||
├── ai-responses/ # Cached LLM responses
|
├── ai-responses/ # Cached LLM responses
|
||||||
├── recent-commands # History
|
├── recent-commands # History
|
||||||
└── bookmarks.json # User bookmarks
|
└── bookmarks.json # User bookmarks
|
||||||
@@ -313,7 +313,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx
|
|||||||
|
|
||||||
### Scenario 1: New User Learning
|
### Scenario 1: New User Learning
|
||||||
```bash
|
```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
|
📖 Task: Search for text in files
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ Related tasks:
|
|||||||
|
|
||||||
### Scenario 2: Quick Lookup
|
### Scenario 2: Quick Lookup
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper task "compress folder"
|
$ super-man task "compress folder"
|
||||||
|
|
||||||
💡 Quick answer:
|
💡 Quick answer:
|
||||||
|
|
||||||
@@ -355,13 +355,13 @@ Flags explained:
|
|||||||
-f : File name follows
|
-f : File name follows
|
||||||
|
|
||||||
Try also:
|
Try also:
|
||||||
bash-helper explain "tar -czf archive.tar.gz folder/"
|
super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
bash-helper category files
|
super-man category files
|
||||||
```
|
```
|
||||||
|
|
||||||
### Scenario 3: Complex Query (with AI)
|
### Scenario 3: Complex Query (with AI)
|
||||||
```bash
|
```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)
|
🤖 AI Assistant (using local LLM)
|
||||||
|
|
||||||
@@ -389,21 +389,21 @@ curl -fsSL https://ollama.com/install.sh | sh
|
|||||||
# Pull a code-focused model
|
# Pull a code-focused model
|
||||||
ollama pull codellama:7b
|
ollama pull codellama:7b
|
||||||
|
|
||||||
# Configure bash-helper
|
# Configure super-man
|
||||||
bash-helper config set llm.enable true
|
super-man config set llm.enable true
|
||||||
bash-helper config set llm.model codellama:7b
|
super-man config set llm.model codellama:7b
|
||||||
```
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
```bash
|
```bash
|
||||||
# First time (generates command)
|
# First time (generates command)
|
||||||
bash-helper --ai "complex query" # ~3s
|
super-man --ai "complex query" # ~3s
|
||||||
|
|
||||||
# Second time (cached)
|
# Second time (cached)
|
||||||
bash-helper --ai "complex query" # <10ms
|
super-man --ai "complex query" # <10ms
|
||||||
|
|
||||||
# Clear cache
|
# Clear cache
|
||||||
bash-helper cache clear
|
super-man cache clear
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📈 Success Metrics
|
## 📈 Success Metrics
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy - Final UI Fixes Complete! ✅
|
# Super Man - Final UI Fixes Complete! ✅
|
||||||
|
|
||||||
## Date: 2025-10-28 (Session 2)
|
## Date: 2025-10-28 (Session 2)
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ formatted_line="...${COLORIZED_SYNTAX}" # Colorized
|
|||||||
|
|
||||||
### Test 1: Explain Mode
|
### Test 1: Explain Mode
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh explain tail
|
./super-man.sh explain tail
|
||||||
```
|
```
|
||||||
**Result**: ✅ PASS
|
**Result**: ✅ PASS
|
||||||
- tail in cyan + bold
|
- tail in cyan + bold
|
||||||
@@ -190,7 +190,7 @@ formatted_line="...${COLORIZED_SYNTAX}" # Colorized
|
|||||||
|
|
||||||
### Test 3: Literal Escape Code Check
|
### Test 3: Literal Escape Code Check
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh explain tar | grep '\\033'
|
./super-man.sh explain tar | grep '\\033'
|
||||||
```
|
```
|
||||||
**Result**: ✅ PASS (No matches)
|
**Result**: ✅ PASS (No matches)
|
||||||
- No literal `\033` found
|
- No literal `\033` found
|
||||||
@@ -246,7 +246,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]...
|
|||||||
**Commit**: `3af2b2a`
|
**Commit**: `3af2b2a`
|
||||||
**Message**: fix(ui): Fix color rendering and flush-right alignment
|
**Message**: fix(ui): Fix color rendering and flush-right alignment
|
||||||
**Branch**: testing-suite
|
**Branch**: testing-suite
|
||||||
**Files**: bash-helper.sh (+41, -31 lines)
|
**Files**: super-man.sh (+41, -31 lines)
|
||||||
**Status**: ✅ Pushed to remote
|
**Status**: ✅ Pushed to remote
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -289,7 +289,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]...
|
|||||||
|
|
||||||
### Ready to Create PR!
|
### 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**:
|
**What's Included**:
|
||||||
- Complete testing suite (45+ tests)
|
- Complete testing suite (45+ tests)
|
||||||
@@ -300,7 +300,7 @@ ls: List directory contents [2-char gap] ls [OPTION]... [FILE]...
|
|||||||
|
|
||||||
### To Create PR:
|
### To Create PR:
|
||||||
1. Open the URL above
|
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`
|
3. Copy description from `PR-DESCRIPTION.md`
|
||||||
4. Create and merge!
|
4. Create and merge!
|
||||||
|
|
||||||
|
|||||||
+23
-23
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Overview
|
## 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
|
## What Was Added
|
||||||
|
|
||||||
@@ -27,9 +27,9 @@ Each task includes:
|
|||||||
|
|
||||||
#### **ask** mode - Natural language queries
|
#### **ask** mode - Natural language queries
|
||||||
```bash
|
```bash
|
||||||
bash-helper ask "find large files"
|
super-man ask "find large files"
|
||||||
bash-helper ask "compress folder"
|
super-man ask "compress folder"
|
||||||
bash-helper ask "search text in files"
|
super-man ask "search text in files"
|
||||||
```
|
```
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
@@ -40,26 +40,26 @@ Features:
|
|||||||
|
|
||||||
#### **task** mode - Task descriptions
|
#### **task** mode - Task descriptions
|
||||||
```bash
|
```bash
|
||||||
bash-helper task "show disk usage"
|
super-man task "show disk usage"
|
||||||
bash-helper task "download file from url"
|
super-man task "download file from url"
|
||||||
```
|
```
|
||||||
|
|
||||||
(Same as `ask` mode - both use keyword search)
|
(Same as `ask` mode - both use keyword search)
|
||||||
|
|
||||||
#### **category** mode - Browse by category
|
#### **category** mode - Browse by category
|
||||||
```bash
|
```bash
|
||||||
bash-helper category files
|
super-man category files
|
||||||
bash-helper category network
|
super-man category network
|
||||||
bash-helper category system
|
super-man category system
|
||||||
bash-helper category text
|
super-man category text
|
||||||
```
|
```
|
||||||
|
|
||||||
Shows all tasks in a category with compact format.
|
Shows all tasks in a category with compact format.
|
||||||
|
|
||||||
#### **explain** mode - Explain commands
|
#### **explain** mode - Explain commands
|
||||||
```bash
|
```bash
|
||||||
bash-helper explain "tar -czf archive.tar.gz folder/"
|
super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
bash-helper explain "find . -name '*.txt'"
|
super-man explain "find . -name '*.txt'"
|
||||||
```
|
```
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
@@ -87,16 +87,16 @@ Results sorted by relevance score, filters out words <3 characters.
|
|||||||
|
|
||||||
All original modes still work:
|
All original modes still work:
|
||||||
```bash
|
```bash
|
||||||
bash-helper # Interactive fzf mode
|
super-man # Interactive fzf mode
|
||||||
bash-helper ls size # Direct flag lookup
|
super-man ls size # Direct flag lookup
|
||||||
bash-helper --list # List commands
|
super-man --list # List commands
|
||||||
bash-helper --help # Show help
|
super-man --help # Show help
|
||||||
```
|
```
|
||||||
|
|
||||||
## Technical Implementation
|
## Technical Implementation
|
||||||
|
|
||||||
### Files Modified
|
### Files Modified
|
||||||
- **bash-helper.sh** (+370 lines)
|
- **super-man.sh** (+370 lines)
|
||||||
- Added database reading and search functions
|
- Added database reading and search functions
|
||||||
- Implemented keyword matching algorithm with scoring
|
- Implemented keyword matching algorithm with scoring
|
||||||
- Added 4 new display modes
|
- Added 4 new display modes
|
||||||
@@ -152,7 +152,7 @@ All modes tested and working:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Find large files
|
# Find large files
|
||||||
$ bash-helper ask "find large files"
|
$ super-man ask "find large files"
|
||||||
|
|
||||||
Found 5 matches:
|
Found 5 matches:
|
||||||
1. Find files larger than 100MB
|
1. Find files larger than 100MB
|
||||||
@@ -163,7 +163,7 @@ Found 5 matches:
|
|||||||
...
|
...
|
||||||
|
|
||||||
# Specific query (single result with details)
|
# Specific query (single result with details)
|
||||||
$ bash-helper ask "symlink"
|
$ super-man ask "symlink"
|
||||||
|
|
||||||
Task: Create symbolic link to file or directory
|
Task: Create symbolic link to file or directory
|
||||||
Category: files
|
Category: files
|
||||||
@@ -185,7 +185,7 @@ Examples:
|
|||||||
### Browse by Category
|
### Browse by Category
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper category files
|
$ super-man category files
|
||||||
|
|
||||||
Category: File Operations
|
Category: File Operations
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ Category: File Operations
|
|||||||
### Explain Commands
|
### Explain Commands
|
||||||
|
|
||||||
```bash
|
```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/
|
Command: tar -czf archive.tar.gz folder/
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ Flag explanations:
|
|||||||
|
|
||||||
## Educational Value
|
## 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
|
1. **Discovery**: Browse categories to learn what's possible
|
||||||
2. **Examples**: See real-world usage patterns for each task
|
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
|
- Related task suggestions
|
||||||
- Comprehensive examples
|
- 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!
|
||||||
|
|||||||
+15
-15
@@ -14,7 +14,7 @@
|
|||||||
### 1. ASCII Banner & Updated Help
|
### 1. ASCII Banner & Updated Help
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper --help
|
$ super-man --help
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -28,9 +28,9 @@ $ bash-helper --help
|
|||||||
Your Intelligent CLI Assistant for Bash
|
Your Intelligent CLI Assistant for Bash
|
||||||
|
|
||||||
QUICK START
|
QUICK START
|
||||||
bash-helper ask "find large files" # Ask a question
|
super-man ask "find large files" # Ask a question
|
||||||
bash-helper category files # Browse by category
|
super-man category files # Browse by category
|
||||||
bash-helper explain "tar -czf" # Explain a command
|
super-man explain "tar -czf" # Explain a command
|
||||||
|
|
||||||
MODES
|
MODES
|
||||||
Natural Language Queries:
|
Natural Language Queries:
|
||||||
@@ -53,7 +53,7 @@ MODES
|
|||||||
#### Query: "find large files"
|
#### Query: "find large files"
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper ask "find large files"
|
$ super-man ask "find large files"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -83,7 +83,7 @@ Tip: Use more specific keywords to narrow results
|
|||||||
#### Query: "symlink" (Single Result - Full Details)
|
#### Query: "symlink" (Single Result - Full Details)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper ask "symlink"
|
$ super-man ask "symlink"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -122,7 +122,7 @@ Related tasks:
|
|||||||
### 3. Category Browsing
|
### 3. Category Browsing
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper category files
|
$ super-man category files
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -162,7 +162,7 @@ Category: File Operations
|
|||||||
#### List All Categories
|
#### List All Categories
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper category
|
$ super-man category
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -174,13 +174,13 @@ Available categories:
|
|||||||
network : Network Operations
|
network : Network Operations
|
||||||
system : System Monitoring
|
system : System Monitoring
|
||||||
|
|
||||||
Usage: bash-helper category NAME
|
Usage: super-man category NAME
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Command Explanation
|
### 4. Command Explanation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper explain "tar -czf archive.tar.gz folder/"
|
$ super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -206,7 +206,7 @@ Flag explanations:
|
|||||||
#### Direct Flag Lookup
|
#### Direct Flag Lookup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bash-helper ls size
|
$ super-man ls size
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
@@ -293,7 +293,7 @@ All queries tested on the system:
|
|||||||
## File Changes
|
## File Changes
|
||||||
|
|
||||||
### Modified
|
### Modified
|
||||||
- **bash-helper.sh**: +370 lines (now 700+ total)
|
- **super-man.sh**: +370 lines (now 700+ total)
|
||||||
- Added intelligent search functions
|
- Added intelligent search functions
|
||||||
- Implemented 4 new query modes
|
- Implemented 4 new query modes
|
||||||
- Enhanced UI with ASCII banner
|
- Enhanced UI with ASCII banner
|
||||||
@@ -315,7 +315,7 @@ All queries tested on the system:
|
|||||||
**Net Change**: +2,048 lines
|
**Net Change**: +2,048 lines
|
||||||
|
|
||||||
**Pushed to Gitea**: ✅
|
**Pushed to Gitea**: ✅
|
||||||
**URL**: http://localhost:3030/trill-technician/bash-buddy
|
**URL**: http://localhost:3030/trill-technician/super-man
|
||||||
|
|
||||||
## What Users Can Do Now
|
## What Users Can Do Now
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ All queries tested on the system:
|
|||||||
|
|
||||||
## Educational Value
|
## 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
|
1. **Discovery**: Browse categories to see what's possible
|
||||||
2. **Examples**: Real-world usage patterns for each task
|
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!
|
From simple flag lookup to intelligent CLI assistant in one upgrade!
|
||||||
|
|||||||
@@ -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
|
## 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
|
## What's New
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ This PR introduces a complete testing suite and comprehensive UI improvements fo
|
|||||||
## Technical Details
|
## Technical Details
|
||||||
|
|
||||||
### Files Changed
|
### Files Changed
|
||||||
- `bash-helper.sh` - Core improvements (+200 lines)
|
- `super-man.sh` - Core improvements (+200 lines)
|
||||||
- `test-suite.sh` - New comprehensive testing framework
|
- `test-suite.sh` - New comprehensive testing framework
|
||||||
- Multiple documentation files
|
- Multiple documentation files
|
||||||
|
|
||||||
@@ -114,25 +114,25 @@ After Selection:
|
|||||||
|
|
||||||
### Run Test Suite
|
### Run Test Suite
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
./test-suite.sh
|
./test-suite.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test Interactive Mode
|
### Test Interactive Mode
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh
|
./super-man.sh
|
||||||
# Try: fuzzy search → select command → browse flags → press Enter → repeat
|
# Try: fuzzy search → select command → browse flags → press Enter → repeat
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test Explain Mode with Examples
|
### Test Explain Mode with Examples
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh explain find
|
./super-man.sh explain find
|
||||||
# Look for SYNTAX and EXAMPLE sections
|
# Look for SYNTAX and EXAMPLE sections
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test Fuzzy Flag Search
|
### Test Fuzzy Flag Search
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh ls
|
./super-man.sh ls
|
||||||
# Fuzzy flag browser opens automatically after command info
|
# Fuzzy flag browser opens automatically after command info
|
||||||
# Type keywords like "color" or "time" to search
|
# Type keywords like "color" or "time" to search
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
**PR Creation URL:**
|
**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:**
|
**Steps:**
|
||||||
@@ -24,7 +24,7 @@ http://localhost:3030/trill-technician/bash-buddy/compare/main...testing-suite
|
|||||||
### Option 2: Via CLI (if authenticated)
|
### Option 2: Via CLI (if authenticated)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/coding/bash/bash-buddy
|
cd ~/coding/bash/super-man
|
||||||
tea pr create --base main --head testing-suite
|
tea pr create --base main --head testing-suite
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ feat(testing): Add comprehensive testing suite with performance analysis
|
|||||||
```markdown
|
```markdown
|
||||||
## Overview
|
## 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
|
- Automated testing for all operating modes
|
||||||
- Performance benchmarking and analysis
|
- Performance benchmarking and analysis
|
||||||
- Detailed reporting (JSON, Markdown, HTML)
|
- Detailed reporting (JSON, Markdown, HTML)
|
||||||
@@ -144,7 +144,7 @@ Once the PR is created:
|
|||||||
git diff main testing-suite
|
git diff main testing-suite
|
||||||
|
|
||||||
# Or via web interface
|
# Or via web interface
|
||||||
http://localhost:3030/trill-technician/bash-buddy/pulls
|
http://localhost:3030/trill-technician/super-man/pulls
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test the Changes (Optional)
|
### Test the Changes (Optional)
|
||||||
@@ -170,7 +170,7 @@ cat reports/performance-report.md
|
|||||||
|
|
||||||
### Merge via CLI
|
### Merge via CLI
|
||||||
```bash
|
```bash
|
||||||
cd ~/coding/bash/bash-buddy
|
cd ~/coding/bash/super-man
|
||||||
git checkout main
|
git checkout main
|
||||||
git merge testing-suite
|
git merge testing-suite
|
||||||
git push origin main
|
git push origin main
|
||||||
@@ -236,7 +236,7 @@ Features:
|
|||||||
|
|
||||||
| Action | Command/URL |
|
| 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` |
|
| **View Branch** | `git log testing-suite` |
|
||||||
| **Run Tests** | `cd tests/ && ./run-all-tests.sh` |
|
| **Run Tests** | `cd tests/ && ./run-all-tests.sh` |
|
||||||
| **View Reports** | `cat tests/reports/performance-report.md` |
|
| **View Reports** | `cat tests/reports/performance-report.md` |
|
||||||
|
|||||||
+10
-10
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy
|
# Super Man
|
||||||
|
|
||||||
🚀 CLI assistant for impromptu bash scripting help
|
🚀 CLI assistant for impromptu bash scripting help
|
||||||
|
|
||||||
@@ -28,24 +28,24 @@ sudo pacman -S fzf # Arch
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repository
|
# Clone the repository
|
||||||
git clone http://localhost:3030/trill-technician/bash-buddy.git
|
git clone http://localhost:3030/trill-technician/super-man.git
|
||||||
cd bash-buddy
|
cd super-man
|
||||||
|
|
||||||
# Make executable
|
# Make executable
|
||||||
chmod +x bash-helper.sh
|
chmod +x super-man.sh
|
||||||
|
|
||||||
# Optional: Install system-wide
|
# 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
|
# Or add to your PATH
|
||||||
echo 'export PATH="$HOME/bash-buddy:$PATH"' >> ~/.bashrc
|
echo 'export PATH="$HOME/super-man:$PATH"' >> ~/.bashrc
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh
|
./super-man.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Workflow
|
### Workflow
|
||||||
@@ -59,7 +59,7 @@ source ~/.bashrc
|
|||||||
### Example Session
|
### Example Session
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./bash-helper.sh
|
$ ./super-man.sh
|
||||||
|
|
||||||
> ls:List directory contents
|
> ls:List directory contents
|
||||||
cd:Change the current directory
|
cd:Change the current directory
|
||||||
@@ -102,7 +102,7 @@ The script includes help for these common bash commands:
|
|||||||
|
|
||||||
### Adding More Commands
|
### Adding More Commands
|
||||||
|
|
||||||
Edit the `COMMANDS` array in `bash-helper.sh`:
|
Edit the `COMMANDS` array in `super-man.sh`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
COMMANDS=(
|
COMMANDS=(
|
||||||
@@ -143,7 +143,7 @@ NC='\033[0m' # No Color
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Add to ~/.bashrc
|
# Add to ~/.bashrc
|
||||||
alias bh='bash-helper.sh'
|
alias bh='super-man.sh'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|||||||
+18
-18
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy v2.1.0 - Ready to Merge! 🚀
|
# Super Man v2.1.0 - Ready to Merge! 🚀
|
||||||
|
|
||||||
## PR Status: READY ✅
|
## PR Status: READY ✅
|
||||||
|
|
||||||
@@ -56,14 +56,14 @@ bdf3026 docs(pr): Add PR creation instructions and merge guide
|
|||||||
|
|
||||||
### Step 1: Open PR Creation Page
|
### 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
|
### Step 2: Fill in PR Details
|
||||||
|
|
||||||
**Title:**
|
**Title:**
|
||||||
```
|
```
|
||||||
feat: Bash Buddy v2.1.0 - Testing Suite & Comprehensive UI Improvements
|
feat: Super Man v2.1.0 - Testing Suite & Comprehensive UI Improvements
|
||||||
```
|
```
|
||||||
|
|
||||||
**Description:**
|
**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)
|
## Create PR - Option 2: GitHub CLI (if installed)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
|
|
||||||
# Using gh CLI
|
# Using gh CLI
|
||||||
gh pr create \
|
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 \
|
--body-file PR-DESCRIPTION.md \
|
||||||
--base main \
|
--base main \
|
||||||
--head testing-suite
|
--head testing-suite
|
||||||
@@ -93,10 +93,10 @@ gh pr create \
|
|||||||
## Create PR - Option 3: Tea CLI (if working)
|
## Create PR - Option 3: Tea CLI (if working)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
|
|
||||||
tea pr create \
|
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)" \
|
--description "$(cat PR-DESCRIPTION.md)" \
|
||||||
--base main \
|
--base main \
|
||||||
--head testing-suite
|
--head testing-suite
|
||||||
@@ -106,7 +106,7 @@ tea pr create \
|
|||||||
|
|
||||||
### Check Branch Status
|
### Check Branch Status
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
git status
|
git status
|
||||||
git log main..testing-suite --oneline
|
git log main..testing-suite --oneline
|
||||||
```
|
```
|
||||||
@@ -117,20 +117,20 @@ git log main..testing-suite --oneline
|
|||||||
./test-suite.sh
|
./test-suite.sh
|
||||||
|
|
||||||
# Interactive mode
|
# Interactive mode
|
||||||
./bash-helper.sh
|
./super-man.sh
|
||||||
|
|
||||||
# Explain mode with examples
|
# Explain mode with examples
|
||||||
./bash-helper.sh explain find
|
./super-man.sh explain find
|
||||||
|
|
||||||
# Direct mode
|
# Direct mode
|
||||||
./bash-helper.sh grep -i
|
./super-man.sh grep -i
|
||||||
```
|
```
|
||||||
|
|
||||||
## After Merge
|
## After Merge
|
||||||
|
|
||||||
### Update Local Repository
|
### Update Local Repository
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
|
|
||||||
# Switch to main
|
# Switch to main
|
||||||
git checkout main
|
git checkout main
|
||||||
@@ -148,25 +148,25 @@ git push origin --delete testing-suite
|
|||||||
### Verify Merge
|
### Verify Merge
|
||||||
```bash
|
```bash
|
||||||
# Check version
|
# Check version
|
||||||
./bash-helper.sh --version
|
./super-man.sh --version
|
||||||
|
|
||||||
# Run tests on main
|
# Run tests on main
|
||||||
./test-suite.sh
|
./test-suite.sh
|
||||||
|
|
||||||
# Test interactive mode
|
# Test interactive mode
|
||||||
./bash-helper.sh
|
./super-man.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tag Release (Optional)
|
### Tag Release (Optional)
|
||||||
```bash
|
```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
|
git push origin v2.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Files to Review
|
## Files to Review
|
||||||
|
|
||||||
1. **PR-DESCRIPTION.md** - Complete PR description (ready to paste)
|
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
|
3. **tests/** - Complete testing framework
|
||||||
4. **TESTING-SUITE.md** - Testing documentation
|
4. **TESTING-SUITE.md** - Testing documentation
|
||||||
5. **PR-INSTRUCTIONS.md** - PR creation guide
|
5. **PR-INSTRUCTIONS.md** - PR creation guide
|
||||||
@@ -185,7 +185,7 @@ git push origin v2.1.0
|
|||||||
## PR URL (Direct Link)
|
## 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!**
|
**Copy this URL into your browser to create the PR immediately!**
|
||||||
@@ -227,7 +227,7 @@ If you encounter any issues:
|
|||||||
|
|
||||||
## Final Notes
|
## 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
|
- **3,253 net new lines** of functionality
|
||||||
- **50+ practical examples** added
|
- **50+ practical examples** added
|
||||||
- **45+ automated tests** for quality assurance
|
- **45+ automated tests** for quality assurance
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy v2.1.0 - Session Complete! 🎉
|
# Super Man v2.1.0 - Session Complete! 🎉
|
||||||
|
|
||||||
## All User Requests Fulfilled
|
## All User Requests Fulfilled
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
## What Was Changed
|
## What Was Changed
|
||||||
|
|
||||||
### Files Modified
|
### Files Modified
|
||||||
- `bash-helper.sh` (+111 lines, -86 lines)
|
- `super-man.sh` (+111 lines, -86 lines)
|
||||||
|
|
||||||
### New Functions
|
### New Functions
|
||||||
1. `colorize_syntax()` - Parse and colorize syntax by element type
|
1. `colorize_syntax()` - Parse and colorize syntax by element type
|
||||||
@@ -122,11 +122,11 @@ Run this to test menu formatting:
|
|||||||
|
|
||||||
## Next: Create PR
|
## 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:
|
### Steps:
|
||||||
1. Open the URL above
|
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`
|
3. Description: Copy from `PR-DESCRIPTION.md`
|
||||||
4. Create Pull Request
|
4. Create Pull Request
|
||||||
5. Review changes
|
5. Review changes
|
||||||
|
|||||||
@@ -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
|
**Date**: 2025-10-28
|
||||||
**Test Suite Version**: 1.0
|
**Test Suite Version**: 1.0
|
||||||
@@ -61,11 +61,11 @@ These tests expect static output with flag descriptions, but the new fuzzy flag
|
|||||||
**Example**:
|
**Example**:
|
||||||
```bash
|
```bash
|
||||||
# OLD: Displayed flags statically
|
# OLD: Displayed flags statically
|
||||||
./bash-helper.sh ls size
|
./super-man.sh ls size
|
||||||
# Output: -s, --size print sizes
|
# Output: -s, --size print sizes
|
||||||
|
|
||||||
# NEW: Opens fzf browser
|
# NEW: Opens fzf browser
|
||||||
./bash-helper.sh ls size
|
./super-man.sh ls size
|
||||||
# Opens interactive fuzzy search (requires user interaction)
|
# 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)
|
#### 2. Help Display Test (#1)
|
||||||
**Test**: `--help` flag
|
**Test**: `--help` flag
|
||||||
**Expected**: Output contains "Bash Buddy"
|
**Expected**: Output contains "Super Man"
|
||||||
**Actual**: Help displays correctly but uses different text
|
**Actual**: Help displays correctly but uses different text
|
||||||
|
|
||||||
**Impact**: **NONE** - Help displays perfectly
|
**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
|
**Test Method**: Manual verification with explain mode
|
||||||
**Result**: PASS
|
**Result**: PASS
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh explain tail
|
./super-man.sh explain tail
|
||||||
# Colors render properly:
|
# Colors render properly:
|
||||||
# - tail in cyan + bold
|
# - tail in cyan + bold
|
||||||
# - [OPTION], [FILE] in yellow
|
# - [OPTION], [FILE] in yellow
|
||||||
@@ -407,9 +407,9 @@ All **user-facing functionality works perfectly**.
|
|||||||
|
|
||||||
## Files Generated
|
## Files Generated
|
||||||
|
|
||||||
**Test Logs**: `/home/dell/coding/bash/bash-buddy/tests/logs/`
|
**Test Logs**: `/home/dell/coding/bash/super-man/tests/logs/`
|
||||||
**Performance Data**: `/home/dell/coding/bash/bash-buddy/tests/performance/`
|
**Performance Data**: `/home/dell/coding/bash/super-man/tests/performance/`
|
||||||
**Reports**: `/home/dell/coding/bash/bash-buddy/tests/reports/`
|
**Reports**: `/home/dell/coding/bash/super-man/tests/reports/`
|
||||||
|
|
||||||
**Key Reports**:
|
**Key Reports**:
|
||||||
- `test-report.json` - Machine-readable results
|
- `test-report.json` - Machine-readable results
|
||||||
@@ -419,7 +419,7 @@ All **user-facing functionality works perfectly**.
|
|||||||
|
|
||||||
**View HTML Report**:
|
**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
|
**Report Generated**: 2025-10-28
|
||||||
**Analyst**: Claude (Bash Buddy Test Suite)
|
**Analyst**: Claude (Super Man Test Suite)
|
||||||
**Version**: 2.1.0
|
**Version**: 2.1.0
|
||||||
**Branch**: testing-suite
|
**Branch**: testing-suite
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Overview
|
## 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
|
## What's Added
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ Plain text format for CI logs.
|
|||||||
|
|
||||||
### Required
|
### Required
|
||||||
- bash 4.0+
|
- bash 4.0+
|
||||||
- bash-helper.sh (the script being tested)
|
- super-man.sh (the script being tested)
|
||||||
|
|
||||||
### Optional
|
### Optional
|
||||||
- **jq** - JSON parsing (recommended)
|
- **jq** - JSON parsing (recommended)
|
||||||
@@ -191,7 +191,7 @@ exit $EXIT_CODE
|
|||||||
|
|
||||||
### GitHub Actions
|
### GitHub Actions
|
||||||
```yaml
|
```yaml
|
||||||
name: Test Bash Buddy
|
name: Test Super Man
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@@ -226,7 +226,7 @@ jobs:
|
|||||||
|
|
||||||
```
|
```
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
Bash Buddy Test Suite
|
Super Man Test Suite
|
||||||
2025-10-28 00:30:15
|
2025-10-28 00:30:15
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ jobs:
|
|||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
|
||||||
Test #1: Help display (--help)
|
Test #1: Help display (--help)
|
||||||
✓ PASSED (45ms) - Output contains: "Bash Buddy"
|
✓ PASSED (45ms) - Output contains: "Super Man"
|
||||||
|
|
||||||
Test #2: List all commands (--list)
|
Test #2: List all commands (--list)
|
||||||
✓ PASSED (32ms) - Output contains: "Available commands"
|
✓ PASSED (32ms) - Output contains: "Available commands"
|
||||||
@@ -392,7 +392,7 @@ cd tests/
|
|||||||
|
|
||||||
## Conclusion
|
## 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!** 🚀
|
**Ready to merge!** 🚀
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy - Final UI Improvements Complete! ✅
|
# Super Man - Final UI Improvements Complete! ✅
|
||||||
|
|
||||||
## Session Date: 2025-10-28
|
## Session Date: 2025-10-28
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ show_flags "$CMD" "$SYNTAX" "$DESC"
|
|||||||
|
|
||||||
### Test 1: Colorized Syntax in Explain Mode
|
### Test 1: Colorized Syntax in Explain Mode
|
||||||
```bash
|
```bash
|
||||||
./bash-helper.sh explain tar
|
./super-man.sh explain tar
|
||||||
```
|
```
|
||||||
**Result**: ✅
|
**Result**: ✅
|
||||||
- Command "tar" in cyan + bold
|
- Command "tar" in cyan + bold
|
||||||
@@ -345,7 +345,7 @@ SYNTAX:
|
|||||||
|
|
||||||
## Files Changed
|
## Files Changed
|
||||||
|
|
||||||
### `bash-helper.sh`
|
### `super-man.sh`
|
||||||
**Changes**: +111 lines, -86 lines (net +25)
|
**Changes**: +111 lines, -86 lines (net +25)
|
||||||
|
|
||||||
**Sections Modified**:
|
**Sections Modified**:
|
||||||
@@ -372,7 +372,7 @@ SYNTAX:
|
|||||||
|
|
||||||
**Push Status**: ✅ Pushed to remote
|
**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
|
### 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
|
1. Open URL
|
||||||
2. Copy PR description from `PR-DESCRIPTION.md`
|
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
|
### Option 2: Test Locally First
|
||||||
```bash
|
```bash
|
||||||
cd /home/dell/coding/bash/bash-buddy
|
cd /home/dell/coding/bash/super-man
|
||||||
|
|
||||||
# Test explain mode with colorized syntax
|
# Test explain mode with colorized syntax
|
||||||
./bash-helper.sh explain find
|
./super-man.sh explain find
|
||||||
|
|
||||||
# Test interactive menu (if fzf available)
|
# Test interactive menu (if fzf available)
|
||||||
./bash-helper.sh
|
./super-man.sh
|
||||||
|
|
||||||
# Run full test suite
|
# Run full test suite
|
||||||
./test-suite.sh
|
./test-suite.sh
|
||||||
@@ -441,7 +441,7 @@ git checkout main
|
|||||||
git pull origin main
|
git pull origin main
|
||||||
git branch -d testing-suite
|
git branch -d testing-suite
|
||||||
git push origin --delete 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
|
git push origin v2.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -469,6 +469,6 @@ The result is a professional, polished UI with:
|
|||||||
**Created**: 2025-10-28
|
**Created**: 2025-10-28
|
||||||
**Session**: UI Improvements - Color Coordination & UX Fixes
|
**Session**: UI Improvements - Color Coordination & UX Fixes
|
||||||
**Branch**: testing-suite (9 commits)
|
**Branch**: testing-suite (9 commits)
|
||||||
**Files**: bash-helper.sh (+111, -86)
|
**Files**: super-man.sh (+111, -86)
|
||||||
**Tests**: All passing ✓
|
**Tests**: All passing ✓
|
||||||
**User Approval**: Pending
|
**User Approval**: Pending
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Using the `bhelper` Alias
|
# Using the `super-man` Alias
|
||||||
|
|
||||||
## Alias Configuration
|
## 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
|
```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`
|
**Location:** `~/.bashrc`
|
||||||
@@ -22,39 +22,39 @@ Or simply open a new terminal - the alias will be available automatically.
|
|||||||
|
|
||||||
## Quick Start
|
## 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
|
### Natural Language Queries
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bhelper ask "find large files"
|
super-man ask "find large files"
|
||||||
bhelper task "compress a folder"
|
super-man task "compress a folder"
|
||||||
bhelper ask "search text in files"
|
super-man ask "search text in files"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Browse by Category
|
### Browse by Category
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bhelper category files
|
super-man category files
|
||||||
bhelper category network
|
super-man category network
|
||||||
bhelper category system
|
super-man category system
|
||||||
bhelper category text
|
super-man category text
|
||||||
```
|
```
|
||||||
|
|
||||||
### Explain Commands
|
### Explain Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bhelper explain "tar -czf archive.tar.gz folder/"
|
super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
bhelper explain "find . -name '*.txt'"
|
super-man explain "find . -name '*.txt'"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Original Modes (Still Work)
|
### Original Modes (Still Work)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bhelper ls size # Direct flag lookup
|
super-man ls size # Direct flag lookup
|
||||||
bhelper # Interactive fzf mode
|
super-man # Interactive fzf mode
|
||||||
bhelper --help # Show help with ASCII banner
|
super-man --help # Show help with ASCII banner
|
||||||
bhelper --list # List all commands
|
super-man --list # List all commands
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
@@ -62,7 +62,7 @@ bhelper --list # List all commands
|
|||||||
### 1. Quick Command Lookup
|
### 1. Quick Command Lookup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bhelper ask "disk usage"
|
$ super-man ask "disk usage"
|
||||||
|
|
||||||
Searching for: "disk usage"
|
Searching for: "disk usage"
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ Found 5 matches:
|
|||||||
### 2. Learn New Commands
|
### 2. Learn New Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bhelper category files
|
$ super-man category files
|
||||||
|
|
||||||
Category: File Operations
|
Category: File Operations
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ Category: File Operations
|
|||||||
### 3. Understand Command Flags
|
### 3. Understand Command Flags
|
||||||
|
|
||||||
```bash
|
```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/
|
Command: tar -czf archive.tar.gz folder/
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ Flag explanations:
|
|||||||
View complete help anytime:
|
View complete help anytime:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bhelper --help
|
super-man --help
|
||||||
```
|
```
|
||||||
|
|
||||||
Shows:
|
Shows:
|
||||||
@@ -133,28 +133,28 @@ Shows:
|
|||||||
|
|
||||||
1. **Use quotes for multi-word queries:**
|
1. **Use quotes for multi-word queries:**
|
||||||
```bash
|
```bash
|
||||||
bhelper ask "find large files" # ✓ Correct
|
super-man ask "find large files" # ✓ Correct
|
||||||
bhelper ask find large files # ✗ Will only search "find"
|
super-man ask find large files # ✗ Will only search "find"
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Browse categories to discover commands:**
|
2. **Browse categories to discover commands:**
|
||||||
```bash
|
```bash
|
||||||
bhelper category files # See all file operations
|
super-man category files # See all file operations
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Explain any command you're curious about:**
|
3. **Explain any command you're curious about:**
|
||||||
```bash
|
```bash
|
||||||
bhelper explain "any bash command here"
|
super-man explain "any bash command here"
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Original direct lookup still works:**
|
4. **Original direct lookup still works:**
|
||||||
```bash
|
```bash
|
||||||
bhelper ls size # Quick flag reference
|
super-man ls size # Quick flag reference
|
||||||
```
|
```
|
||||||
|
|
||||||
## Version
|
## 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!
|
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:
|
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:**
|
**Latest commits:**
|
||||||
- `13cb602` - docs: Add Phase 1 live demo with examples and benchmarks
|
- `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!
|
## 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:
|
Try it now:
|
||||||
```bash
|
```bash
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
bhelper ask "compress folder"
|
super-man ask "compress folder"
|
||||||
```
|
```
|
||||||
|
|
||||||
🚀 Happy scripting!
|
🚀 Happy scripting!
|
||||||
+28
-28
@@ -1,4 +1,4 @@
|
|||||||
# Bash Buddy v2.1.0 - AI-Powered Release 🤖
|
# Super Man v2.1.0 - AI-Powered Release 🤖
|
||||||
|
|
||||||
## What's New
|
## What's New
|
||||||
|
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
Integrated **NL2SH model** for advanced natural language understanding:
|
Integrated **NL2SH model** for advanced natural language understanding:
|
||||||
|
|
||||||
```bash
|
```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
|
# Generated: find /path/to/directory -type f -name "*.py" -mtime -7
|
||||||
|
|
||||||
bhelper ai "count lines in all javascript files"
|
super-man ai "count lines in all javascript files"
|
||||||
bhelper ai "compress all log files older than 30 days"
|
super-man ai "compress all log files older than 30 days"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
@@ -75,37 +75,37 @@ Filter: -v
|
|||||||
|
|
||||||
### 1. AI Mode (NEW!) 🤖
|
### 1. AI Mode (NEW!) 🤖
|
||||||
```bash
|
```bash
|
||||||
bhelper ai "find large files in home directory"
|
super-man ai "find large files in home directory"
|
||||||
bhelper ai "get network interface information"
|
super-man ai "get network interface information"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Natural Language Queries
|
### 2. Natural Language Queries
|
||||||
```bash
|
```bash
|
||||||
bhelper ask "compress folder" # Database search
|
super-man ask "compress folder" # Database search
|
||||||
bhelper task "disk usage" # Task search
|
super-man task "disk usage" # Task search
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Category Browsing
|
### 3. Category Browsing
|
||||||
```bash
|
```bash
|
||||||
bhelper category files
|
super-man category files
|
||||||
bhelper category network
|
super-man category network
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Command Explanation
|
### 4. Command Explanation
|
||||||
```bash
|
```bash
|
||||||
bhelper explain "tar -czf archive.tar.gz folder/"
|
super-man explain "tar -czf archive.tar.gz folder/"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. Interactive Mode (Enhanced!)
|
### 5. Interactive Mode (Enhanced!)
|
||||||
```bash
|
```bash
|
||||||
bhelper # Browse 90+ commands with fzf
|
super-man # Browse 90+ commands with fzf
|
||||||
# Select command → Enter filter → See flags
|
# Select command → Enter filter → See flags
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6. Direct Flag Lookup
|
### 6. Direct Flag Lookup
|
||||||
```bash
|
```bash
|
||||||
bhelper grep -v # Show grep flags with 'v'
|
super-man grep -v # Show grep flags with 'v'
|
||||||
bhelper ls size # Show ls flags about size
|
super-man ls size # Show ls flags about size
|
||||||
```
|
```
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
@@ -146,20 +146,20 @@ bhelper ls size # Show ls flags about size
|
|||||||
### Try AI Mode
|
### Try AI Mode
|
||||||
```bash
|
```bash
|
||||||
source ~/.bashrc # Reload alias if needed
|
source ~/.bashrc # Reload alias if needed
|
||||||
bhelper ai "find files larger than 100MB"
|
super-man ai "find files larger than 100MB"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Try Enhanced Interactive
|
### Try Enhanced Interactive
|
||||||
```bash
|
```bash
|
||||||
bhelper # Opens fzf with 90+ commands
|
super-man # Opens fzf with 90+ commands
|
||||||
# Type to filter (e.g., "net" for network commands)
|
# Type to filter (e.g., "net" for network commands)
|
||||||
# Select → Enter filter term → See relevant flags
|
# Select → Enter filter term → See relevant flags
|
||||||
```
|
```
|
||||||
|
|
||||||
### All Commands Available
|
### All Commands Available
|
||||||
```bash
|
```bash
|
||||||
bhelper --help # See all modes
|
super-man --help # See all modes
|
||||||
bhelper --list # List all 90+ commands
|
super-man --list # List all 90+ commands
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -178,26 +178,26 @@ Or open a new terminal.
|
|||||||
|
|
||||||
**Find Python files:**
|
**Find Python files:**
|
||||||
```bash
|
```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
|
Generated: find /path/to/directory -type f -name "*.py" -mtime -7
|
||||||
```
|
```
|
||||||
|
|
||||||
**Count lines:**
|
**Count lines:**
|
||||||
```bash
|
```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}'
|
Generated: find . -name "*.js" -exec wc -l {} + | awk '{sum+=$1} END {print sum}'
|
||||||
```
|
```
|
||||||
|
|
||||||
**Network info:**
|
**Network info:**
|
||||||
```bash
|
```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
|
Generated: ip addr show | grep 'inet ' | grep -v 127.0.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Interactive Mode Example
|
### Interactive Mode Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bhelper
|
$ super-man
|
||||||
# Type "tar" → Select "tar:Archive files"
|
# Type "tar" → Select "tar:Archive files"
|
||||||
# Enter filter: "extract"
|
# Enter filter: "extract"
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ Your Ollama models:
|
|||||||
|
|
||||||
**Default:** NL2SH (specialized for shell commands)
|
**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
|
## 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?
|
### 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
|
```bash
|
||||||
"yourcommand:Description of what it does"
|
"yourcommand:Description of what it does"
|
||||||
```
|
```
|
||||||
@@ -268,9 +268,9 @@ Edit the `COMMANDS` array in bash-helper.sh and add:
|
|||||||
|
|
||||||
## Repository
|
## 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
|
**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:
|
Try it now:
|
||||||
```bash
|
```bash
|
||||||
bhelper ai "your complex query here"
|
super-man ai "your complex query here"
|
||||||
```
|
```
|
||||||
|
|||||||
+139
-132
@@ -17,22 +17,25 @@ NC='\033[0m' # No Color
|
|||||||
|
|
||||||
# ASCII Banner
|
# ASCII Banner
|
||||||
show_banner() {
|
show_banner() {
|
||||||
echo -e "${CYAN} ____ __ ____ __ __"
|
echo -en "${CYAN}"
|
||||||
echo -e " / __ )____ ______/ /_ / __ )__ ______/ /___/ /_ __"
|
cat <<'BANNER'
|
||||||
echo -e " / __ / __ \`/ ___/ __ \\ / __ / / / / __ / __ / / / /"
|
____ __ __
|
||||||
echo -e " / /_/ / /_/ (__ ) / / / / /_/ / /_/ / /_/ / /_/ / /_/ /"
|
/ ___| _ _ _ __ ___ _ __ | \/ | __ _ _ __
|
||||||
echo -e "/_____/\\__,_/____/_/ /_/ /_____/\\__,_/\\__,_/\\__,_/\\__, /"
|
\___ \| | | | '_ \ / _ \ '__| | |\/| |/ _` | '_ \
|
||||||
echo -e " /____/${NC}"
|
___) | |_| | |_) | __/ | | | | | (_| | | | |
|
||||||
echo -e "${YELLOW} Your Intelligent CLI Assistant for Bash${NC}"
|
|____/ \__,_| .__/ \___|_| |_| |_|\__,_|_| |_|
|
||||||
|
|_|
|
||||||
|
BANNER
|
||||||
|
echo -e "${NC}${YELLOW} Your Intelligent CLI Assistant for Bash${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
show_banner
|
show_banner
|
||||||
echo -e "${BOLD}${YELLOW}QUICK START${NC}"
|
echo -e "${BOLD}${YELLOW}QUICK START${NC}"
|
||||||
echo -e " ${GREEN}bash-helper ask \"find large files\"${NC} # Ask a question"
|
echo -e " ${GREEN}super-man ask \"find large files\"${NC} # Ask a question"
|
||||||
echo -e " ${GREEN}bash-helper category files${NC} # Browse by category"
|
echo -e " ${GREEN}super-man category files${NC} # Browse by category"
|
||||||
echo -e " ${GREEN}bash-helper explain \"tar -czf\"${NC} # Explain a command"
|
echo -e " ${GREEN}super-man explain \"tar -czf\"${NC} # Explain a command"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}${YELLOW}MODES${NC}"
|
echo -e "${BOLD}${YELLOW}MODES${NC}"
|
||||||
echo -e " ${CYAN}Natural Language Queries:${NC}"
|
echo -e " ${CYAN}Natural Language Queries:${NC}"
|
||||||
@@ -57,17 +60,17 @@ show_help() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}${YELLOW}EXAMPLES${NC}"
|
echo -e "${BOLD}${YELLOW}EXAMPLES${NC}"
|
||||||
echo -e " ${DIM}# Natural language${NC}"
|
echo -e " ${DIM}# Natural language${NC}"
|
||||||
echo " bash-helper ask \"compress folder\""
|
echo " super-man ask \"compress folder\""
|
||||||
echo " bash-helper ask \"search text in files\""
|
echo " super-man ask \"search text in files\""
|
||||||
echo " bash-helper task \"monitor cpu usage\""
|
echo " super-man task \"monitor cpu usage\""
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${DIM}# Browse and learn${NC}"
|
echo -e " ${DIM}# Browse and learn${NC}"
|
||||||
echo " bash-helper category network"
|
echo " super-man category network"
|
||||||
echo " bash-helper explain \"find . -name '*.txt'\""
|
echo " super-man explain \"find . -name '*.txt'\""
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${DIM}# Original modes (still work)${NC}"
|
echo -e " ${DIM}# Original modes (still work)${NC}"
|
||||||
echo " bash-helper ls size # Direct flag lookup"
|
echo " super-man ls size # Direct flag lookup"
|
||||||
echo " bash-helper # Interactive fzf mode"
|
echo " super-man # Interactive fzf mode"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}${YELLOW}REQUIREMENTS${NC}"
|
echo -e "${BOLD}${YELLOW}REQUIREMENTS${NC}"
|
||||||
echo -e " ${GREEN}✓${NC} jq (for natural language queries)"
|
echo -e " ${GREEN}✓${NC} jq (for natural language queries)"
|
||||||
@@ -75,8 +78,8 @@ show_help() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo -e "${BOLD}${YELLOW}AI MODE${NC} 🤖"
|
echo -e "${BOLD}${YELLOW}AI MODE${NC} 🤖"
|
||||||
echo -e " ${GREEN}✓ NL2SH model detected!${NC} Use AI for complex queries:"
|
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}super-man 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 \"count lines in all js files\"${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Other models available: llama3.2, qwen2.5"
|
echo " Other models available: llama3.2, qwen2.5"
|
||||||
echo " To switch models, edit mode_ai() function"
|
echo " To switch models, edit mode_ai() function"
|
||||||
@@ -94,8 +97,8 @@ check_jq() {
|
|||||||
echo "Install it with: sudo apt install jq"
|
echo "Install it with: sudo apt install jq"
|
||||||
echo ""
|
echo ""
|
||||||
echo "You can still use the original modes:"
|
echo "You can still use the original modes:"
|
||||||
echo " bash-helper COMMAND [FILTER]"
|
echo " super-man COMMAND [FILTER]"
|
||||||
echo " bash-helper --interactive"
|
echo " super-man --interactive"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
@@ -215,7 +218,7 @@ mode_ask() {
|
|||||||
|
|
||||||
if [ -z "$query" ]; then
|
if [ -z "$query" ]; then
|
||||||
echo -e "${RED}Error: No query provided${NC}"
|
echo -e "${RED}Error: No query provided${NC}"
|
||||||
echo "Usage: bash-helper ask \"your question\""
|
echo "Usage: super-man ask \"your question\""
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -230,8 +233,8 @@ mode_ask() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Try:"
|
echo "Try:"
|
||||||
echo " • Using different keywords"
|
echo " • Using different keywords"
|
||||||
echo " • Browse by category: bash-helper category files"
|
echo " • Browse by category: super-man category files"
|
||||||
echo " • List all commands: bash-helper --list"
|
echo " • List all commands: super-man --list"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -270,7 +273,7 @@ mode_category() {
|
|||||||
echo ""
|
echo ""
|
||||||
jq -r '.categories | to_entries[] | " \(.key) : \(.value.name)"' "$DB_FILE"
|
jq -r '.categories | to_entries[] | " \(.key) : \(.value.name)"' "$DB_FILE"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage: bash-helper category NAME"
|
echo "Usage: super-man category NAME"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -310,10 +313,10 @@ mode_ai() {
|
|||||||
|
|
||||||
if [ -z "$user_query" ]; then
|
if [ -z "$user_query" ]; then
|
||||||
echo -e "${RED}Error: No query provided${NC}"
|
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 ""
|
||||||
echo "Example:"
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -324,7 +327,7 @@ mode_ai() {
|
|||||||
echo "Install Ollama:"
|
echo "Install Ollama:"
|
||||||
echo " curl -fsSL https://ollama.com/install.sh | sh"
|
echo " curl -fsSL https://ollama.com/install.sh | sh"
|
||||||
echo ""
|
echo ""
|
||||||
echo "For now, try: bash-helper ask \"$user_query\""
|
echo "For now, try: super-man ask \"$user_query\""
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -353,7 +356,7 @@ mode_ai() {
|
|||||||
if [ -z "$response" ]; then
|
if [ -z "$response" ]; then
|
||||||
echo -e "${RED}Error: No response from AI model${NC}"
|
echo -e "${RED}Error: No response from AI model${NC}"
|
||||||
echo ""
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -387,10 +390,10 @@ mode_explain() {
|
|||||||
|
|
||||||
if [ -z "$cmd_line" ]; then
|
if [ -z "$cmd_line" ]; then
|
||||||
echo -e "${RED}Error: No command provided${NC}"
|
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 ""
|
||||||
echo "Example:"
|
echo "Example:"
|
||||||
echo " bash-helper explain \"tar -czf archive.tar.gz folder/\""
|
echo " super-man explain \"tar -czf archive.tar.gz folder/\""
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -635,105 +638,116 @@ extract_all_flags() {
|
|||||||
local flags_output=""
|
local flags_output=""
|
||||||
|
|
||||||
if type "$cmd_name" 2>/dev/null | grep -q "shell builtin"; then
|
if type "$cmd_name" 2>/dev/null | grep -q "shell builtin"; then
|
||||||
# Shell builtin - use help command (basic format)
|
# Shell builtin - parse the "Options:" block from `help`, formatting each
|
||||||
flags_output=$(help "$cmd_name" 2>/dev/null | grep -E '^\s*-')
|
# 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
|
elif command -v "$cmd_name" &> /dev/null; then
|
||||||
# External command - extract from man page OPTIONS or DESCRIPTION section with descriptions
|
# External command - parse the FULL man page. Instead of reading a single
|
||||||
local man_content=$(man "$cmd_name" 2>/dev/null | col -b)
|
# 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
|
||||||
# Try OPTIONS section first, then DESCRIPTION (GNU coreutils use DESCRIPTION)
|
# extract every flag with its description across all option sections.
|
||||||
# Exclude the section headers themselves to prevent early AWK exit
|
# `col -bx` normalises tabs to spaces so indentation can be compared.
|
||||||
local options_section=$(echo "$man_content" | sed -n '/^OPTIONS/,/^[A-Z][A-Z]/{/^OPTIONS/d; /^[A-Z][A-Z]/d; p;}' | head -300)
|
local man_content=$(man "$cmd_name" 2>/dev/null | col -bx)
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if [ -n "$man_content" ]; then
|
||||||
|
flags_output=$(printf '%s\n' "$man_content" | awk '
|
||||||
|
{ lines[++N]=$0; }
|
||||||
END {
|
END {
|
||||||
# Print last flag
|
# --- pre-pass: mark which sections actually contain option tags ---
|
||||||
if (flag != "") {
|
secid=0;
|
||||||
gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc)
|
for (i=1; i<=N; i++) {
|
||||||
if (desc != "") {
|
raw=lines[i];
|
||||||
printf "\033[1;33m%s\033[0m \033[2m—\033[0m %s\n", flag, desc
|
if (raw ~ /^[A-Z]/) { secid++; sname[secid]=fw(raw); }
|
||||||
} else {
|
lsec[i]=secid;
|
||||||
printf "\033[1;33m%s\033[0m\n", flag
|
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
|
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
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1355,7 +1369,7 @@ if [ "$INTERACTIVE" = true ]; then
|
|||||||
echo "Error: fzf is not installed"
|
echo "Error: fzf is not installed"
|
||||||
echo "Install it with: sudo apt install fzf"
|
echo "Install it with: sudo apt install fzf"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Or use direct mode: bash-helper COMMAND [FILTER]"
|
echo "Or use direct mode: super-man COMMAND [FILTER]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1386,7 +1400,7 @@ if [ "$INTERACTIVE" = true ]; then
|
|||||||
if [ -z "$SELECTED" ]; then
|
if [ -z "$SELECTED" ]; then
|
||||||
# User pressed Esc or cancelled
|
# User pressed Esc or cancelled
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${YELLOW}Exiting Bash Buddy. Happy coding! 👋${NC}"
|
echo -e "${YELLOW}Exiting Super Man. Happy coding! 👋${NC}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1415,14 +1429,7 @@ if [ "$INTERACTIVE" = true ]; then
|
|||||||
clear
|
clear
|
||||||
show_flags "$CMD" "$SYNTAX" "$DESC"
|
show_flags "$CMD" "$SYNTAX" "$DESC"
|
||||||
|
|
||||||
# After viewing flags, ask if user wants to search another command
|
# Esc in the flag browser returns straight to the home menu (no intermediary step)
|
||||||
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
|
|
||||||
clear
|
clear
|
||||||
done
|
done
|
||||||
# Direct mode
|
# Direct mode
|
||||||
+14
-14
@@ -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
|
## Overview
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ Interactive HTML dashboard with:
|
|||||||
|
|
||||||
### Required
|
### Required
|
||||||
- **bash** 4.0+ - Shell interpreter
|
- **bash** 4.0+ - Shell interpreter
|
||||||
- **bash-helper.sh** - Script being tested
|
- **super-man.sh** - Script being tested
|
||||||
|
|
||||||
### Optional
|
### Optional
|
||||||
- **jq** - JSON parsing (for detailed analysis)
|
- **jq** - JSON parsing (for detailed analysis)
|
||||||
@@ -210,7 +210,7 @@ brew install jq fzf expect bc
|
|||||||
**Output:**
|
**Output:**
|
||||||
```
|
```
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
Bash Buddy Test Suite
|
Super Man Test Suite
|
||||||
2025-01-XX XX:XX:XX
|
2025-01-XX XX:XX:XX
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ brew install jq fzf expect bc
|
|||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
|
||||||
Test #1: Help display (--help)
|
Test #1: Help display (--help)
|
||||||
✓ PASSED (45ms) - Output contains: "Bash Buddy"
|
✓ PASSED (45ms) - Output contains: "Super Man"
|
||||||
|
|
||||||
Test #2: List all commands (--list)
|
Test #2: List all commands (--list)
|
||||||
✓ PASSED (32ms) - Output contains: "Available commands"
|
✓ PASSED (32ms) - Output contains: "Available commands"
|
||||||
@@ -257,7 +257,7 @@ Pass Rate: 95%
|
|||||||
**Output:**
|
**Output:**
|
||||||
```
|
```
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
Bash Buddy Performance Analysis
|
Super Man Performance Analysis
|
||||||
2025-01-XX XX:XX:XX
|
2025-01-XX XX:XX:XX
|
||||||
═══════════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════════
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ exit $EXIT_CODE
|
|||||||
### GitHub Actions Example
|
### GitHub Actions Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Test Bash Buddy
|
name: Test Super Man
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ print_section "Custom Tests"
|
|||||||
|
|
||||||
run_test_with_output_check \
|
run_test_with_output_check \
|
||||||
"My custom test" \
|
"My custom test" \
|
||||||
"../bash-helper.sh ask 'my query'" \
|
"../super-man.sh ask 'my query'" \
|
||||||
"expected output"
|
"expected output"
|
||||||
|
|
||||||
print_summary
|
print_summary
|
||||||
@@ -498,15 +498,15 @@ Run test and verify output contains expected string.
|
|||||||
```bash
|
```bash
|
||||||
run_test_with_output_check \
|
run_test_with_output_check \
|
||||||
"Help test" \
|
"Help test" \
|
||||||
"./bash-helper.sh --help" \
|
"./super-man.sh --help" \
|
||||||
"Bash Buddy"
|
"Super Man"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `run_benchmark(name, command, iterations)`
|
#### `run_benchmark(name, command, iterations)`
|
||||||
Run performance benchmark with statistics.
|
Run performance benchmark with statistics.
|
||||||
|
|
||||||
```bash
|
```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)`
|
#### `skip_test(name, reason)`
|
||||||
@@ -612,7 +612,7 @@ A: Yes, but be careful with shared resources (log files, etc.)
|
|||||||
A: No, unless installing dependencies
|
A: No, unless installing dependencies
|
||||||
|
|
||||||
**Q: Will tests modify my system?**
|
**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?**
|
**Q: Can I run tests on macOS?**
|
||||||
A: Yes, with dependencies installed via Homebrew
|
A: Yes, with dependencies installed via Homebrew
|
||||||
@@ -632,7 +632,7 @@ A: Check `tests/logs/test_N_*.log` for detailed output
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Same as Bash Buddy - see main repository
|
Same as Super Man - see main repository
|
||||||
|
|
||||||
## Support
|
## 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! 🚀
|
Ensuring quality and performance at every commit! 🚀
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Performance Analysis Tool for Bash Buddy
|
# Performance Analysis Tool for Super Man
|
||||||
# Analyzes test logs and benchmark data to generate insights
|
# Analyzes test logs and benchmark data to generate insights
|
||||||
|
|
||||||
# Color definitions
|
# Color definitions
|
||||||
@@ -27,7 +27,7 @@ mkdir -p "$REPORT_DIR"
|
|||||||
print_header() {
|
print_header() {
|
||||||
echo -e "${BOLD}${CYAN}"
|
echo -e "${BOLD}${CYAN}"
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo " Bash Buddy Performance Analysis"
|
echo " Super Man Performance Analysis"
|
||||||
echo " $(date '+%Y-%m-%d %H:%M:%S')"
|
echo " $(date '+%Y-%m-%d %H:%M:%S')"
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo -e "${NC}"
|
echo -e "${NC}"
|
||||||
@@ -59,7 +59,7 @@ generate_performance_report() {
|
|||||||
local bench_file="$PERF_LOG_DIR/benchmarks.csv"
|
local bench_file="$PERF_LOG_DIR/benchmarks.csv"
|
||||||
local report_file="$REPORT_DIR/performance-report.md"
|
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 "" >> "$report_file"
|
||||||
echo "**Generated:** $(date '+%Y-%m-%d %H:%M:%S')" >> "$report_file"
|
echo "**Generated:** $(date '+%Y-%m-%d %H:%M:%S')" >> "$report_file"
|
||||||
echo "" >> "$report_file"
|
echo "" >> "$report_file"
|
||||||
@@ -188,7 +188,7 @@ generate_html_report() {
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Bash Buddy Performance Report</title>
|
<title>Super Man Performance Report</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
@@ -243,7 +243,7 @@ generate_html_report() {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>🚀 Bash Buddy Performance Report</h1>
|
<h1>🚀 Super Man Performance Report</h1>
|
||||||
<p>Generated: TIMESTAMP</p>
|
<p>Generated: TIMESTAMP</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Master Test Runner for Bash Buddy
|
# Master Test Runner for Super Man
|
||||||
# Runs all test suites and generates comprehensive reports
|
# Runs all test suites and generates comprehensive reports
|
||||||
|
|
||||||
# Color definitions
|
# Color definitions
|
||||||
@@ -83,12 +83,12 @@ print_banner
|
|||||||
print_section "Pre-flight Checks"
|
print_section "Pre-flight Checks"
|
||||||
|
|
||||||
# Check if script exists
|
# Check if script exists
|
||||||
if [ ! -f "$PROJECT_DIR/bash-helper.sh" ]; then
|
if [ ! -f "$PROJECT_DIR/super-man.sh" ]; then
|
||||||
echo -e "${RED}Error: bash-helper.sh not found${NC}"
|
echo -e "${RED}Error: super-man.sh not found${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}✓ bash-helper.sh found${NC}"
|
echo -e "${GREEN}✓ super-man.sh found${NC}"
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
MISSING_DEPS=()
|
MISSING_DEPS=()
|
||||||
@@ -224,7 +224,7 @@ fi
|
|||||||
# Generate CI-friendly output
|
# Generate CI-friendly output
|
||||||
CI_REPORT="$SCRIPT_DIR/reports/ci-report.txt"
|
CI_REPORT="$SCRIPT_DIR/reports/ci-report.txt"
|
||||||
cat > "$CI_REPORT" << EOF
|
cat > "$CI_REPORT" << EOF
|
||||||
Bash Buddy Test Results
|
Super Man Test Results
|
||||||
========================
|
========================
|
||||||
Date: $(date '+%Y-%m-%d %H:%M:%S')
|
Date: $(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Comprehensive test suite for all Bash Buddy operating modes
|
# Comprehensive test suite for all Super Man operating modes
|
||||||
# Tests all non-interactive modes with performance analysis
|
# Tests all non-interactive modes with performance analysis
|
||||||
|
|
||||||
# Get script directory
|
# Get script directory
|
||||||
@@ -10,11 +10,11 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|||||||
source "$SCRIPT_DIR/test-framework.sh"
|
source "$SCRIPT_DIR/test-framework.sh"
|
||||||
|
|
||||||
# Set script path
|
# Set script path
|
||||||
SCRIPT_PATH="$PROJECT_DIR/bash-helper.sh"
|
SCRIPT_PATH="$PROJECT_DIR/super-man.sh"
|
||||||
|
|
||||||
# Verify script exists
|
# Verify script exists
|
||||||
if [ ! -f "$SCRIPT_PATH" ]; then
|
if [ ! -f "$SCRIPT_PATH" ]; then
|
||||||
echo -e "${RED}Error: bash-helper.sh not found at $SCRIPT_PATH${NC}"
|
echo -e "${RED}Error: super-man.sh not found at $SCRIPT_PATH${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ print_section "Help & Informational Modes"
|
|||||||
run_test_with_output_check \
|
run_test_with_output_check \
|
||||||
"Help display (--help)" \
|
"Help display (--help)" \
|
||||||
"$SCRIPT_PATH --help" \
|
"$SCRIPT_PATH --help" \
|
||||||
"Bash Buddy"
|
"Super Man"
|
||||||
|
|
||||||
run_test_with_output_check \
|
run_test_with_output_check \
|
||||||
"Help display (-h)" \
|
"Help display (-h)" \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Bash Buddy Test Framework
|
# Super Man Test Framework
|
||||||
# Provides utilities for testing all operating modes with performance analysis
|
# Provides utilities for testing all operating modes with performance analysis
|
||||||
|
|
||||||
# Color definitions
|
# Color definitions
|
||||||
@@ -25,7 +25,7 @@ declare -A TEST_RESULTS
|
|||||||
# Configuration
|
# Configuration
|
||||||
TEST_LOG_DIR="./tests/logs"
|
TEST_LOG_DIR="./tests/logs"
|
||||||
PERF_LOG_DIR="./tests/performance"
|
PERF_LOG_DIR="./tests/performance"
|
||||||
SCRIPT_PATH="./bash-helper.sh"
|
SCRIPT_PATH="./super-man.sh"
|
||||||
|
|
||||||
# Create directories
|
# Create directories
|
||||||
mkdir -p "$TEST_LOG_DIR"
|
mkdir -p "$TEST_LOG_DIR"
|
||||||
@@ -45,7 +45,7 @@ get_ms_timestamp() {
|
|||||||
print_header() {
|
print_header() {
|
||||||
echo -e "${BOLD}${CYAN}"
|
echo -e "${BOLD}${CYAN}"
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo " Bash Buddy Test Suite"
|
echo " Super Man Test Suite"
|
||||||
echo " $(get_timestamp)"
|
echo " $(get_timestamp)"
|
||||||
echo "═══════════════════════════════════════════════════════════"
|
echo "═══════════════════════════════════════════════════════════"
|
||||||
echo -e "${NC}"
|
echo -e "${NC}"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Interactive mode testing for Bash Buddy
|
# Interactive mode testing for Super Man
|
||||||
# Tests fzf-based interactive mode with automation
|
# Tests fzf-based interactive mode with automation
|
||||||
|
|
||||||
# Get script directory
|
# Get script directory
|
||||||
@@ -10,7 +10,7 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|||||||
source "$SCRIPT_DIR/test-framework.sh"
|
source "$SCRIPT_DIR/test-framework.sh"
|
||||||
|
|
||||||
# Set script path
|
# Set script path
|
||||||
SCRIPT_PATH="$PROJECT_DIR/bash-helper.sh"
|
SCRIPT_PATH="$PROJECT_DIR/super-man.sh"
|
||||||
|
|
||||||
print_header
|
print_header
|
||||||
echo "Testing Interactive Mode"
|
echo "Testing Interactive Mode"
|
||||||
@@ -51,12 +51,12 @@ echo -e "\n${CYAN}Test #1: Launch interactive mode and exit immediately${NC}"
|
|||||||
TEST_LOG="$TEST_LOG_DIR/interactive_launch_test.log"
|
TEST_LOG="$TEST_LOG_DIR/interactive_launch_test.log"
|
||||||
|
|
||||||
# Create expect script for immediate exit
|
# Create expect script for immediate exit
|
||||||
cat > /tmp/bhelper_test_exit.exp << 'EOF'
|
cat > /tmp/super-man_test_exit.exp << 'EOF'
|
||||||
#!/usr/bin/expect -f
|
#!/usr/bin/expect -f
|
||||||
set timeout 10
|
set timeout 10
|
||||||
log_user 0
|
log_user 0
|
||||||
|
|
||||||
spawn bash -c "./bash-helper.sh"
|
spawn bash -c "./super-man.sh"
|
||||||
expect {
|
expect {
|
||||||
timeout { exit 1 }
|
timeout { exit 1 }
|
||||||
eof { exit 0 }
|
eof { exit 0 }
|
||||||
@@ -68,11 +68,11 @@ expect {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /tmp/bhelper_test_exit.exp
|
chmod +x /tmp/super-man_test_exit.exp
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
start_time=$(get_ms_timestamp)
|
start_time=$(get_ms_timestamp)
|
||||||
/tmp/bhelper_test_exit.exp > "$TEST_LOG" 2>&1
|
/tmp/super-man_test_exit.exp > "$TEST_LOG" 2>&1
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
end_time=$(get_ms_timestamp)
|
end_time=$(get_ms_timestamp)
|
||||||
duration=$((end_time - start_time))
|
duration=$((end_time - start_time))
|
||||||
@@ -98,12 +98,12 @@ echo -e "\n${CYAN}Test #2: Select command and view flags${NC}"
|
|||||||
TEST_LOG="$TEST_LOG_DIR/interactive_select_test.log"
|
TEST_LOG="$TEST_LOG_DIR/interactive_select_test.log"
|
||||||
|
|
||||||
# Create expect script to select grep and search for -v
|
# Create expect script to select grep and search for -v
|
||||||
cat > /tmp/bhelper_test_select.exp << 'EOF'
|
cat > /tmp/super-man_test_select.exp << 'EOF'
|
||||||
#!/usr/bin/expect -f
|
#!/usr/bin/expect -f
|
||||||
set timeout 15
|
set timeout 15
|
||||||
log_user 1
|
log_user 1
|
||||||
|
|
||||||
spawn bash -c "./bash-helper.sh"
|
spawn bash -c "./super-man.sh"
|
||||||
|
|
||||||
# Wait for fzf to start
|
# Wait for fzf to start
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -126,11 +126,11 @@ send "\x03"
|
|||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /tmp/bhelper_test_select.exp
|
chmod +x /tmp/super-man_test_select.exp
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
start_time=$(get_ms_timestamp)
|
start_time=$(get_ms_timestamp)
|
||||||
/tmp/bhelper_test_select.exp > "$TEST_LOG" 2>&1
|
/tmp/super-man_test_select.exp > "$TEST_LOG" 2>&1
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
end_time=$(get_ms_timestamp)
|
end_time=$(get_ms_timestamp)
|
||||||
duration=$((end_time - start_time))
|
duration=$((end_time - start_time))
|
||||||
@@ -157,12 +157,12 @@ echo -e "\n${CYAN}Test #3: Filter commands by category${NC}"
|
|||||||
TEST_LOG="$TEST_LOG_DIR/interactive_filter_test.log"
|
TEST_LOG="$TEST_LOG_DIR/interactive_filter_test.log"
|
||||||
|
|
||||||
# Create expect script to filter by "network"
|
# Create expect script to filter by "network"
|
||||||
cat > /tmp/bhelper_test_filter.exp << 'EOF'
|
cat > /tmp/super-man_test_filter.exp << 'EOF'
|
||||||
#!/usr/bin/expect -f
|
#!/usr/bin/expect -f
|
||||||
set timeout 15
|
set timeout 15
|
||||||
log_user 1
|
log_user 1
|
||||||
|
|
||||||
spawn bash -c "./bash-helper.sh"
|
spawn bash -c "./super-man.sh"
|
||||||
|
|
||||||
# Wait for fzf to start
|
# Wait for fzf to start
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -179,11 +179,11 @@ send "\x03"
|
|||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /tmp/bhelper_test_filter.exp
|
chmod +x /tmp/super-man_test_filter.exp
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
start_time=$(get_ms_timestamp)
|
start_time=$(get_ms_timestamp)
|
||||||
/tmp/bhelper_test_filter.exp > "$TEST_LOG" 2>&1
|
/tmp/super-man_test_filter.exp > "$TEST_LOG" 2>&1
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
end_time=$(get_ms_timestamp)
|
end_time=$(get_ms_timestamp)
|
||||||
duration=$((end_time - start_time))
|
duration=$((end_time - start_time))
|
||||||
@@ -213,12 +213,12 @@ SUCCESS_COUNT=0
|
|||||||
for cmd in "${COMMANDS_TO_TEST[@]}"; do
|
for cmd in "${COMMANDS_TO_TEST[@]}"; do
|
||||||
TEST_LOG="$TEST_LOG_DIR/interactive_${cmd}_test.log"
|
TEST_LOG="$TEST_LOG_DIR/interactive_${cmd}_test.log"
|
||||||
|
|
||||||
cat > /tmp/bhelper_test_${cmd}.exp << EOF
|
cat > /tmp/super-man_test_${cmd}.exp << EOF
|
||||||
#!/usr/bin/expect -f
|
#!/usr/bin/expect -f
|
||||||
set timeout 10
|
set timeout 10
|
||||||
log_user 1
|
log_user 1
|
||||||
|
|
||||||
spawn bash -c "./bash-helper.sh"
|
spawn bash -c "./super-man.sh"
|
||||||
sleep 2
|
sleep 2
|
||||||
send "${cmd}\r"
|
send "${cmd}\r"
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -228,10 +228,10 @@ send "\x03"
|
|||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /tmp/bhelper_test_${cmd}.exp
|
chmod +x /tmp/super-man_test_${cmd}.exp
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
/tmp/bhelper_test_${cmd}.exp > "$TEST_LOG" 2>&1
|
/tmp/super-man_test_${cmd}.exp > "$TEST_LOG" 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
|
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
|
||||||
@@ -267,22 +267,22 @@ SUCCESS_COUNT=0
|
|||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
TEST_LOG="$TEST_LOG_DIR/interactive_perf_$i.log"
|
TEST_LOG="$TEST_LOG_DIR/interactive_perf_$i.log"
|
||||||
|
|
||||||
cat > /tmp/bhelper_perf_test.exp << 'EOF'
|
cat > /tmp/super-man_perf_test.exp << 'EOF'
|
||||||
#!/usr/bin/expect -f
|
#!/usr/bin/expect -f
|
||||||
set timeout 10
|
set timeout 10
|
||||||
log_user 0
|
log_user 0
|
||||||
|
|
||||||
spawn bash -c "./bash-helper.sh"
|
spawn bash -c "./super-man.sh"
|
||||||
sleep 1
|
sleep 1
|
||||||
send "\x03"
|
send "\x03"
|
||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /tmp/bhelper_perf_test.exp
|
chmod +x /tmp/super-man_perf_test.exp
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
start_time=$(get_ms_timestamp)
|
start_time=$(get_ms_timestamp)
|
||||||
/tmp/bhelper_perf_test.exp > "$TEST_LOG" 2>&1
|
/tmp/super-man_perf_test.exp > "$TEST_LOG" 2>&1
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
end_time=$(get_ms_timestamp)
|
end_time=$(get_ms_timestamp)
|
||||||
duration=$((end_time - start_time))
|
duration=$((end_time - start_time))
|
||||||
@@ -306,7 +306,7 @@ if [ $SUCCESS_COUNT -gt 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup temp files
|
# Cleanup temp files
|
||||||
rm -f /tmp/bhelper_*.exp
|
rm -f /tmp/super-man_*.exp
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# SUMMARY
|
# SUMMARY
|
||||||
|
|||||||
Reference in New Issue
Block a user