用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill interactive-menu-builder-3-table-display命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | interactive-menu-builder-3-table-display |
| description | Sub-skill of interactive-menu-builder: 3. Table Display (+1). |
| version | 1.0.0 |
| category | _core |
| type | reference |
| scripts_exempt | true |
Display data in formatted tables:
#!/bin/bash
# ABOUTME: Table display functions for CLI menus
# ABOUTME: Format data in aligned columns with headers
# Print table header
print_table_header() {
local -a headers=("$@")
local format=""
# Build format string
for header in "${headers[@]}"; do
format+="%-20s "
done
echo ""
printf "${CYAN}${format}${NC}\n" "${headers[@]}"
printf "${CYAN}%s${NC}\n" "$(printf '─%.0s' {1..80})"
}
# Print table row
print_table_row() {
local format=""
local -a values=("$@")
for _ in "${values[@]}"; do
format+="%-20s "
done
printf "${format}\n" "${values[@]}"
}
# Display repository table
show_repo_table() {
print_table_header "Repository" "Category" "Status" "Branch"
for repo in "${REPOS[@]}"; do
local category=$(get_category "$repo")
local status=$(get_status "$repo")
local branch=$(get_branch "$repo")
# Color-code status
case "$status" in
"Clean") status="${GREEN}Clean${NC}" ;;
"Modified") status="${YELLOW}Modified${NC}" ;;
"Untracked") status="${RED}Untracked${NC}" ;;
esac
print_table_row "$repo" "$category" "$status" "$branch"
done
}
Let users select from a list:
#!/bin/bash
# ABOUTME: Selection list patterns
# ABOUTME: Single and multi-select from numbered lists
# Single selection
select_single() {
local prompt="$1"
shift
local -a options=("$@")
echo ""
for i in "${!options[@]}"; do
echo " $((i+1))) ${options[$i]}"
done
echo ""
echo " 0) Cancel"
echo ""
read -p "$prompt: " choice
if [[ "$choice" == "0" ]]; then
return 1
elif [[ "$choice" -ge 1 && "$choice" -le ${#options[@]} ]]; then
SELECTED="${options[$((choice-1))]}"
return 0
else
echo -e "${RED}Invalid selection"
1
}
() {
prompt=
-a options=()
-a selected=()
i ;
-p input
[[ == ]];
SELECTED=()
0
num ;
[[ -ge 1 && -le ]];
selected+=()
SELECTED=()
[[ -gt 0 ]]
}
repos=( )
select_single ;
select_multiple ;