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,7 +1,7 @@
|
||||
# Bash Buddy Enhancement Proposal
|
||||
# Super Man Enhancement Proposal
|
||||
|
||||
## 🎯 Goal
|
||||
Transform bash-helper into an intelligent CLI assistant that can:
|
||||
Transform super-man into an intelligent CLI assistant that can:
|
||||
- Accept natural language questions
|
||||
- Return relevant bash commands with examples
|
||||
- Explain flags in context
|
||||
@@ -14,13 +14,13 @@ Transform bash-helper into an intelligent CLI assistant that can:
|
||||
**Use Case:** Simple, common tasks
|
||||
|
||||
```bash
|
||||
bash-helper "list files by size"
|
||||
super-man "list files by size"
|
||||
# Returns: ls -lhS
|
||||
|
||||
bash-helper "find large files"
|
||||
super-man "find large files"
|
||||
# Returns: find . -type f -size +100M -exec ls -lh {} \;
|
||||
|
||||
bash-helper "search in files"
|
||||
super-man "search in files"
|
||||
# Returns: grep -r "pattern" .
|
||||
```
|
||||
|
||||
@@ -33,11 +33,11 @@ bash-helper "search in files"
|
||||
**Use Case:** More complex tasks with variations
|
||||
|
||||
```bash
|
||||
bash-helper "compress all logs older than 30 days"
|
||||
super-man "compress all logs older than 30 days"
|
||||
# Returns: find /var/log -name "*.log" -mtime +30 -exec gzip {} \;
|
||||
# Explanation: Finds logs older than 30 days and compresses them
|
||||
|
||||
bash-helper "monitor cpu usage every 2 seconds"
|
||||
super-man "monitor cpu usage every 2 seconds"
|
||||
# Returns: watch -n 2 'top -b -n 1 | head -20'
|
||||
```
|
||||
|
||||
@@ -50,7 +50,7 @@ bash-helper "monitor cpu usage every 2 seconds"
|
||||
**Use Case:** Complex, unique queries
|
||||
|
||||
```bash
|
||||
bash-helper --ai "extract all email addresses from files and save to csv"
|
||||
super-man --ai "extract all email addresses from files and save to csv"
|
||||
# Uses local Ollama/llama.cpp for understanding
|
||||
# Generates: grep -roh '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b' . | sort -u > emails.csv
|
||||
```
|
||||
@@ -66,29 +66,29 @@ bash-helper --ai "extract all email addresses from files and save to csv"
|
||||
|
||||
```bash
|
||||
# Ask a question
|
||||
bash-helper ask "how do I find files modified today"
|
||||
super-man ask "how do I find files modified today"
|
||||
|
||||
# Get command + explanation
|
||||
bash-helper explain "what does find . -name '*.log' do"
|
||||
super-man explain "what does find . -name '*.log' do"
|
||||
|
||||
# Get examples for a task
|
||||
bash-helper examples "working with archives"
|
||||
super-man examples "working with archives"
|
||||
```
|
||||
|
||||
### 2. Task-Based Categories
|
||||
|
||||
```bash
|
||||
# Browse by category
|
||||
bash-helper category files # File operations
|
||||
bash-helper category network # Network commands
|
||||
bash-helper category system # System monitoring
|
||||
bash-helper category text # Text processing
|
||||
super-man category files # File operations
|
||||
super-man category network # Network commands
|
||||
super-man category system # System monitoring
|
||||
super-man category text # Text processing
|
||||
```
|
||||
|
||||
### 3. Interactive Examples
|
||||
|
||||
```bash
|
||||
bash-helper demo "find and replace in files"
|
||||
super-man demo "find and replace in files"
|
||||
# Shows:
|
||||
# 1. Basic: sed -i 's/old/new/g' file.txt
|
||||
# 2. Recursive: find . -type f -exec sed -i 's/old/new/g' {} +
|
||||
@@ -98,7 +98,7 @@ bash-helper demo "find and replace in files"
|
||||
### 4. Command Builder
|
||||
|
||||
```bash
|
||||
bash-helper build
|
||||
super-man build
|
||||
# Interactive wizard:
|
||||
# What do you want to do?
|
||||
# > Find files
|
||||
@@ -186,8 +186,8 @@ bash-helper build
|
||||
|
||||
**Files to create:**
|
||||
- `commands-db.json` - Task database
|
||||
- `bash-helper-search.sh` - Search functionality
|
||||
- `bash-helper-ask.sh` - Natural language queries
|
||||
- `super-man-search.sh` - Search functionality
|
||||
- `super-man-ask.sh` - Natural language queries
|
||||
|
||||
### Phase 2: Pattern Matching (Week 2)
|
||||
- Template-based command generation
|
||||
@@ -205,26 +205,26 @@ bash-helper build
|
||||
- Graceful fallback
|
||||
|
||||
**Integration points:**
|
||||
- `bash-helper --ai "complex query"`
|
||||
- `super-man --ai "complex query"`
|
||||
- Local llama3 or codellama
|
||||
- Response caching in ~/.cache/bash-helper/
|
||||
- Response caching in ~/.cache/super-man/
|
||||
|
||||
## 🎨 Enhanced CLI Interface
|
||||
|
||||
```bash
|
||||
# Current
|
||||
bash-helper ls size # Show ls flags with 'size'
|
||||
super-man ls size # Show ls flags with 'size'
|
||||
|
||||
# Enhanced
|
||||
bash-helper ask "show largest files"
|
||||
bash-helper task "compress old logs"
|
||||
bash-helper explain "tar -czf archive.tar.gz folder/"
|
||||
bash-helper category files
|
||||
bash-helper search "find duplicate"
|
||||
bash-helper build # Interactive builder
|
||||
bash-helper recent # Recently used commands
|
||||
bash-helper bookmark "useful-find-command"
|
||||
bash-helper --ai "complex natural language query"
|
||||
super-man ask "show largest files"
|
||||
super-man task "compress old logs"
|
||||
super-man explain "tar -czf archive.tar.gz folder/"
|
||||
super-man category files
|
||||
super-man search "find duplicate"
|
||||
super-man build # Interactive builder
|
||||
super-man recent # Recently used commands
|
||||
super-man bookmark "useful-find-command"
|
||||
super-man --ai "complex natural language query"
|
||||
```
|
||||
|
||||
## 📦 Database Content Areas
|
||||
@@ -262,7 +262,7 @@ bash-helper --ai "complex natural language query"
|
||||
## 🔧 Technical Architecture
|
||||
|
||||
```
|
||||
bash-helper (main script)
|
||||
super-man (main script)
|
||||
│
|
||||
├─> Mode Detection
|
||||
│ ├─> --help, --list (existing)
|
||||
@@ -290,7 +290,7 @@ bash-helper (main script)
|
||||
### Fast Lookup Strategy
|
||||
```bash
|
||||
# Pre-indexed keyword→command mapping
|
||||
KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx
|
||||
KEYWORD_INDEX=~/.local/share/super-man/keywords.idx
|
||||
|
||||
# On first run: build index
|
||||
# Subsequent runs: instant lookup
|
||||
@@ -303,7 +303,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx
|
||||
|
||||
### Caching
|
||||
```bash
|
||||
~/.cache/bash-helper/
|
||||
~/.cache/super-man/
|
||||
├── ai-responses/ # Cached LLM responses
|
||||
├── recent-commands # History
|
||||
└── bookmarks.json # User bookmarks
|
||||
@@ -313,7 +313,7 @@ KEYWORD_INDEX=~/.local/share/bash-helper/keywords.idx
|
||||
|
||||
### Scenario 1: New User Learning
|
||||
```bash
|
||||
$ bash-helper ask "how to find text in files"
|
||||
$ super-man ask "how to find text in files"
|
||||
|
||||
📖 Task: Search for text in files
|
||||
|
||||
@@ -343,7 +343,7 @@ Related tasks:
|
||||
|
||||
### Scenario 2: Quick Lookup
|
||||
```bash
|
||||
$ bash-helper task "compress folder"
|
||||
$ super-man task "compress folder"
|
||||
|
||||
💡 Quick answer:
|
||||
|
||||
@@ -355,13 +355,13 @@ Flags explained:
|
||||
-f : File name follows
|
||||
|
||||
Try also:
|
||||
bash-helper explain "tar -czf archive.tar.gz folder/"
|
||||
bash-helper category files
|
||||
super-man explain "tar -czf archive.tar.gz folder/"
|
||||
super-man category files
|
||||
```
|
||||
|
||||
### Scenario 3: Complex Query (with AI)
|
||||
```bash
|
||||
$ bash-helper --ai "find all python files modified in last week, exclude virtual environments, and count lines of code"
|
||||
$ super-man --ai "find all python files modified in last week, exclude virtual environments, and count lines of code"
|
||||
|
||||
🤖 AI Assistant (using local LLM)
|
||||
|
||||
@@ -389,21 +389,21 @@ curl -fsSL https://ollama.com/install.sh | sh
|
||||
# Pull a code-focused model
|
||||
ollama pull codellama:7b
|
||||
|
||||
# Configure bash-helper
|
||||
bash-helper config set llm.enable true
|
||||
bash-helper config set llm.model codellama:7b
|
||||
# Configure super-man
|
||||
super-man config set llm.enable true
|
||||
super-man config set llm.model codellama:7b
|
||||
```
|
||||
|
||||
### Usage
|
||||
```bash
|
||||
# First time (generates command)
|
||||
bash-helper --ai "complex query" # ~3s
|
||||
super-man --ai "complex query" # ~3s
|
||||
|
||||
# Second time (cached)
|
||||
bash-helper --ai "complex query" # <10ms
|
||||
super-man --ai "complex query" # <10ms
|
||||
|
||||
# Clear cache
|
||||
bash-helper cache clear
|
||||
super-man cache clear
|
||||
```
|
||||
|
||||
## 📈 Success Metrics
|
||||
|
||||
Reference in New Issue
Block a user