Overhaul help system UX with navi, recipes, and onboarding

- Rewrite fhelp: add 'start' onboarding, recipe fallback chain
  (our files → cheat → tldr), 'workflow' dynamic loader, tier badges
- Add welcome.sh: unified English welcome for bash/zsh/fish
- Replace German README with concise English version
- Add Zsh F1/Ctrl+/ widget for inline help while typing
- Configure navi Ctrl+G widget for interactive cheatsheet browsing
- Fix dangerous 'alias help=fhelp' (was breaking bash builtin)
- Add 'h' and 'analyse' as safe aliases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
tobias
2026-03-28 17:38:37 +01:00
parent f3ccc09c3d
commit 3a8e5d90ef
5 changed files with 423 additions and 233 deletions
+10 -9
View File
@@ -1,11 +1,12 @@
README - pdfanalysis
Dieser Container enthält Tools um PDFs zu analysieren:
REMnux Malware Analysis Container
===================================
397 analysis tools | 8 workflows | Fully offline help
pdfid.py - Schnelle Übersicht über PDF-Aufbau.
pdf-parser.py - Zerlegen und extrahieren von PDF-Elementen
peepdf.py - PDF - Analyse Framework mit Javascript Analyse
pdftk - Tool um das PDF zu "flatten"
convert - ImageMagick Tool zum convertieren
fhelp - Help system overview
fhelp start - Quick start guide (30 sec)
fhelp tools <keyword> - Search for tools
fhelp cheat <tool> - Usage examples for a tool
fhelp workflow - Step-by-step analysis workflows
Ctrl+G - Interactive cheatsheet browser
Für Kommandobeispiele /opt/command_help lesen.
Der Nutzer innerhalb des Containers braucht Schreibrechte auf das gemountete Verzeichnis.
For mounted files: /work/ (or your mounted directory)
+14 -13
View File
@@ -7,17 +7,13 @@ alias grep='grep --color=auto'
alias fd='fdfind'
alias rg='rg --color=auto'
alias analyse='fhelp'
alias ?='fhelp'
alias h='fhelp'
# Fish prompt - simple and clean
# Fish prompt
function fish_prompt
set_color cyan
echo -n 'remnux'
set_color normal
echo -n '@'
set_color blue
echo -n (prompt_hostname)
set_color normal
echo -n ':'
set_color yellow
echo -n (prompt_pwd)
@@ -25,10 +21,15 @@ function fish_prompt
echo -n '> '
end
# Welcome message
if test -f /opt/README
cat /opt/README
echo ""
echo "🐚 Shell: fish | Type 'fhelp' for help"
echo ""
end
# Navi widget (Ctrl+G)
if command -q navi
navi widget fish | source 2>/dev/null
end
# Welcome message (only once per session)
if not set -q _WELCOME_SHOWN
set -gx _WELCOME_SHOWN 1
if test -f /usr/local/bin/welcome.sh
bash /usr/local/bin/welcome.sh
end
end
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# Unified welcome message for all shells
# Sourced by bash, zsh, and fish on login
# Only show on login shells, not subshells
if [[ -n "$_WELCOME_SHOWN" ]]; then
return 0 2>/dev/null || exit 0
fi
export _WELCOME_SHOWN=1
# Colors (works in bash, zsh, fish)
_C='\033[0;36m' # cyan
_G='\033[0;32m' # green
_Y='\033[1;33m' # yellow
_N='\033[0m' # reset
echo ""
echo -e "${_C}REMnux Malware Analysis Container${_N}"
echo -e "$(printf '%.0s=' {1..38})"
echo ""
echo -e " ${_G}fhelp${_N} Help system"
echo -e " ${_G}fhelp start${_N} Quick start guide"
echo -e " ${_G}fhelp cheat${_N} <tool> Tool examples"
echo -e " ${_G}fhelp workflow${_N} Analysis workflows"
echo -e " ${_Y}Ctrl+G${_N} Interactive browser"
echo ""
+47 -37
View File
@@ -9,12 +9,12 @@ if [[ ! -d "$HOME" ]] || [[ ! -w "$HOME" ]]; then
HISTFILE=/tmp/.zsh_history_$$
HISTSIZE=10000
SAVEHIST=10000
autoload -Uz compinit && compinit -d /tmp/.zcompdump_$$
autoload -U colors && colors
PROMPT='%F{red}[🔍]%f %F{cyan}%~%f $ '
PROMPT='%F{red}[>]%f %F{cyan}%~%f $ '
# Load plugins if available
[[ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] && \
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
@@ -23,7 +23,7 @@ if [[ ! -d "$HOME" ]] || [[ ! -w "$HOME" ]]; then
else
# Oh My Zsh setup for regular users
export ZSH="$HOME/.oh-my-zsh"
# Install Oh My Zsh if not present
if [[ ! -d "$ZSH" ]]; then
echo "Installing Oh My Zsh..."
@@ -32,25 +32,21 @@ else
RUNZSH=no CHSH=no sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 2>/dev/null
}
fi
# Oh My Zsh theme - using agnoster-like theme for security work
# Oh My Zsh theme
ZSH_THEME="robbyrussell"
# Custom theme for file analysis work
if [[ -d "$ZSH" ]]; then
# Plugins to load
plugins=(git docker command-not-found colored-man-pages)
# Load Oh My Zsh
source $ZSH/oh-my-zsh.sh 2>/dev/null || true
# Custom prompt with analysis indicator
PROMPT='%F{red}🔍%f %F{cyan}%~%f $(git_prompt_info)%# '
PROMPT='%F{red}>%f %F{cyan}%~%f $(git_prompt_info)%# '
RPROMPT='%F{yellow}%*%f'
else
# Fallback if OMZ installation failed
autoload -U colors && colors
PROMPT='%F{red}[🔍]%f %F{cyan}%~%f $ '
PROMPT='%F{red}[>]%f %F{cyan}%~%f $ '
fi
fi
@@ -89,7 +85,7 @@ setopt AUTO_MENU
[[ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] && \
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Aliases for file analysis
# Standard aliases
alias ls='ls --color=auto'
alias ll='ls -lah'
alias la='ls -A'
@@ -100,12 +96,12 @@ alias egrep='egrep --color=auto'
# Tool aliases
alias fd='fdfind'
alias bat='batcat' # Ubuntu names it batcat
alias bat='batcat'
alias rg='rg --color=auto'
alias analyse='fhelp'
alias help='fhelp'
# Help alias (? needs special handling in zsh)
# Help system aliases (note: 'help' intentionally NOT aliased — preserves bash builtin)
alias analyse='fhelp'
alias h='fhelp'
if [[ -n "$ZSH_VERSION" ]]; then
alias \?='fhelp'
else
@@ -135,21 +131,35 @@ fi
export EDITOR=vim
export VISUAL=vim
# Welcome message (only on interactive shells)
if [[ -o interactive ]] && [[ -f /opt/README ]]; then
# Only show welcome once per session
if [[ -z "$_WELCOME_SHOWN" ]]; then
echo ""
echo "\033[1;36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
echo "\033[1;31m File Analysis Container\033[0m \033[1;33m(zsh with Oh My Zsh)\033[0m"
echo "\033[1;36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
echo ""
echo " \033[1;32mfhelp\033[0m or \033[1;32m?\033[0m - Help system"
echo " \033[1;32mfhelp cheat <tool>\033[0m - Quick examples"
echo " \033[1;32mfhelp tools pdf\033[0m - Find PDF tools"
echo ""
echo " Shells: \033[0;36mbash\033[0m (default), \033[0;36mzsh\033[0m (current), \033[0;36mfish\033[0m"
echo ""
export _WELCOME_SHOWN=1
fi
# ============================================================
# Navi interactive cheatsheet widget (Ctrl+G)
# ============================================================
if command -v navi &>/dev/null; then
eval "$(navi widget zsh)" 2>/dev/null
fi
# ============================================================
# F1 / Ctrl+H: Show help for the command being typed
# ============================================================
_fhelp_inline_widget() {
local cmd="${BUFFER%% *}"
if [[ -n "$cmd" ]]; then
zle -I
echo ""
fhelp cheat "$cmd" 2>/dev/null || fhelp tools "$cmd" 2>/dev/null || echo "No help for: $cmd"
echo ""
zle reset-prompt
zle redisplay
fi
}
zle -N _fhelp_inline_widget
bindkey '\eOP' _fhelp_inline_widget # F1
bindkey '\e[11~' _fhelp_inline_widget # F1 (alternate escape)
bindkey '^_' _fhelp_inline_widget # Ctrl+/ (universal fallback)
# ============================================================
# Welcome message (login shells only)
# ============================================================
if [[ -o interactive && -o login ]] || [[ -o interactive && -z "$_WELCOME_SHOWN" ]]; then
[[ -f /usr/local/bin/welcome.sh ]] && source /usr/local/bin/welcome.sh
fi