Token导航 LogoToken导航

Agent Skill · 研究检索

cli-productivity(CLI productivity 搜索)

cli-productivity 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cli-productivity 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 40,273。

总安装 1,307周安装 55GitHub Stars 8下载 458核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cli-productivity(CLI productivity 搜索)
来源仓库:https://github.com/vamseeachanta/workspace-hub
仓库路径:skills/cli-productivity
安装命令:
npx skills add https://github.com/vamseeachanta/workspace-hub --skill cli-productivity
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vamseeachanta/workspace-hub --skill cli-productivity

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

cli-productivity 掌握现代 CLI 工具与 Shell 模式,提升终端工作效率。适合构建模糊查找、JSON 管道与自动化脚本等高效工作流。推荐使用 rg、fd、jq 等现代替代品替代 grep、find、awk。安装前应确认终端支持 Unicode 与颜色输出,避免显示异常。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/cli-productivity

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vamseeachanta/workspace-hub --skill cli-produc…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cli-productivity 怎么安装?

在终端执行 npx skills add https://github.com/vamseeachanta/workspace-hub --skill cli-productivity。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cli-productivity 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cli-productivity 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

cli-productivity 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

cli-productivity 用的人多吗?

公开数据是累计安装 1,307 次,近一周安装 55 次,下载 458 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cli-productivity 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
cli-productivity

CLI productivity 搜索 · 本页

1,3078接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

CLI Productivity Skill

Master essential CLI tools and shell patterns for efficient terminal workflows. This skill covers modern replacements for traditional Unix tools, fuzzy finding, pipeline patterns, and shell customization.

When to Use This Skill

USE when:

  • Building efficient terminal workflows
  • Processing text and JSON data
  • Searching codebases quickly
  • Navigating file systems efficiently
  • Automating repetitive tasks
  • Creating shell functions and aliases
  • Building interactive scripts

DON'T USE when:

  • GUI-based workflows are more appropriate
  • Processing binary data (use specialized tools)
  • Complex data analysis (use Python/Pandas)
  • Tasks requiring visual feedback

Prerequisites

Installation

macOS (Homebrew):

# Essential modern tools
brew install jq           # JSON processor
brew install fzf          # Fuzzy finder
brew install ripgrep      # Fast grep (rg)
brew install fd           # Fast find
brew install bat          # Better cat
brew install exa          # Better ls (or eza)
brew install zoxide       # Smart cd
brew install starship     # Shell prompt
brew install tmux         # Terminal multiplexer

# Install fzf keybindings
$(brew --prefix)/opt/fzf/install

Linux (Ubuntu/Debian):

# Update package list
sudo apt-get update

# Install from apt (may be older versions)
sudo apt-get install -y jq fzf ripgrep fd-find bat

# Note: fd is 'fdfind' on Debian/Ubuntu
sudo ln -s $(which fdfind) /usr/local/bin/fd

# bat may be 'batcat' on older systems
sudo ln -s $(which batcat) /usr/local/bin/bat

# Install exa/eza
sudo apt-get install -y exa  # or: cargo install eza

# Install zoxide
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash

# Install starship
curl -sS https://starship.rs/install.sh | sh

Arch Linux:

sudo pacman -S jq fzf ripgrep fd bat exa zoxide starship tmux

Verification:

# Verify installations
for cmd in jq fzf rg fd bat exa zoxide starship; do
    command -v $cmd && echo "$cmd: OK" || echo "$cmd: NOT FOUND"
done

Core Capabilities

1. jq - JSON Processing

Basic Operations:

# Pretty print JSON
echo '{"name":"John","age":30}' | jq '.'

# Extract field
curl -s https://api.github.com/repos/nodejs/node | jq '.stargazers_count'

# Filter arrays
echo '[1,2,3,4,5]' | jq '.[] | select(. > 2)'

# Transform data
echo '{"first":"John","last":"Doe"}' | jq '{fullName: (.first + " " + .last)}'

Common jq Patterns:

# Extract multiple fields
jq '{name: .name, stars: .stargazers_count}'

# Array operations
jq '.items | length'                    # Count items
jq '.items | first'                     # First item
jq '.items | last'                      # Last item
jq '.items[0:5]'                        # Slice first 5

# Filtering
jq '.[] | select(.status == "active")'
jq '.[] | select(.count > 100)'
jq '.[] | select(.name | contains("test"))'

# Sorting
jq 'sort_by(.date)'
jq 'sort_by(.date) | reverse'

# Grouping
jq 'group_by(.category)'
jq 'group_by(.category) | map({key: .[0].category, count: length})'

# Mapping
jq '.[] | {id, name}'
jq 'map({id: .id, upper_name: (.name | ascii_upcase)})'

Shell Functions for jq:

# Pretty print JSON file
jqp() {
    jq '.' "$1" | bat --language json
}

# Extract field from JSON file
jqf() {
    local file="$1"
    local field="$2"
    jq -r ".$field" "$file"
}

# Count items in JSON array
jqcount() {
    jq 'if type == "array" then length else 1 end' "$1"
}

# Filter JSON by field value
jqfilter() {
    local file="$1"
    local field="$2"
    local value="$3"
    jq --arg val "$value" ".[] | select(.$field == \$val)" "$file"
}

2. fzf - Fuzzy Finder

Basic Usage:

# Find and edit file
vim $(fzf)

# Find with preview
fzf --preview 'bat --color=always {}'

# Multi-select
fzf --multi

# Filter with query
echo -e "apple\nbanana\norange" | fzf --query "an"

fzf Configuration:

# Add to ~/.bashrc or ~/.zshrc

# Default options
export FZF_DEFAULT_OPTS='
    --height 40%
    --layout=reverse
    --border
    --preview-window=right:50%:wrap
    --bind=ctrl-d:preview-page-down
    --bind=ctrl-u:preview-page-up
'

# Use fd for faster file finding
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'

# Preview settings
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
export FZF_ALT_C_OPTS='--preview "exa --tree --level=2 --color=always {}"'

Powerful fzf Functions:

# Fuzzy edit file
fe() {
    local file
    file=$(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}')
    [[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}

# Fuzzy cd into directory
fcd() {
    local dir
    dir=$(fd --type d --hidden --follow --exclude .git | fzf --preview 'exa --tree --level=2 --color=always {}')
    [[ -n "$dir" ]] && cd "$dir"
}

# Fuzzy kill process
fkill() {
    local pid
    pid=$(ps aux | sed 1d | fzf --multi | awk '{print $2}')
    [[ -n "$pid" ]] && echo "$pid" | xargs kill -9
}

# Fuzzy git checkout branch
fco() {
    local branch
    branch=$(git branch -a --color=always | grep -v '/HEAD' | fzf --ansi | sed 's/^[* ]*//' | sed 's#remotes/origin/##')
    [[ -n "$branch" ]] && git checkout "$branch"
}

# Fuzzy git log
flog() {
    git log --oneline --color=always | fzf --ansi --preview 'git show --color=always {1}' | awk '{print $1}'
}

# Fuzzy history search
fh() {
    local cmd
    cmd=$(history | fzf --tac | sed 's/^[ ]*[0-9]*[ ]*//')
    [[ -n "$cmd" ]] && eval "$cmd"
}

# Fuzzy environment variable
fenv() {
    local var
    var=$(env | fzf | cut -d= -f1)
    [[ -n "$var" ]] && echo "${!var}"
}

# Fuzzy docker container
fdocker() {
    local container
    container=$(docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}' | fzf | awk '{print $1}')
    [[ -n "$container" ]] && docker exec -it "$container" sh
}

3. ripgrep (rg) - Fast Search

Basic Usage:

# Search for pattern
rg "function"

# Case insensitive
rg -i "error"

# Show line numbers
rg -n "TODO"

# Search specific file types
rg --type py "import"
rg -t js "require"

# Exclude patterns
rg "pattern" --glob '!*.min.js'
rg "pattern" --glob '!node_modules'

Advanced ripgrep:

# Context lines
rg -C 3 "error"        # 3 lines before and after
rg -B 2 "error"        # 2 lines before
rg -A 2 "error"        # 2 lines after

# Fixed strings (no regex)
rg -F "func()"

# Word boundaries
rg -w "log"            # Match "log" not "logging"

# Multiple patterns
rg -e "pattern1" -e "pattern2"

# Files matching pattern
rg -l "TODO"           # List files only
rg -c "TODO"           # Count matches per file

# Inverse match
rg -v "DEBUG"          # Lines NOT containing DEBUG

# Replace
rg "old" --replace "new"

# JSON output
rg --json "pattern" | jq '.'

# Statistics
rg --stats "pattern"

ripgrep Functions:

# Search and preview with fzf
rgs() {
    rg --color=always --line-number "$1" | fzf --ansi --preview 'bat --color=always $(echo {} | cut -d: -f1) --highlight-line $(echo {} | cut -d: -f2)'
}

# Search and open in editor
rge() {
    local selection
    selection=$(rg --color=always --line-number "$1" | fzf --ansi)
    if [[ -n "$selection" ]]; then
        local file=$(echo "$selection" | cut -d: -f1)
        local line=$(echo "$selection" | cut -d: -f2)
        ${EDITOR:-vim} "+$line" "$file"
    fi
}

# Search TODOs
todos() {
    rg --color=always "TODO|FIXME|HACK|XXX" "${1:-.}" | fzf --ansi
}

# Search function definitions
funcs() {
    rg --color=always "^(def |function |async function |const .* = |class )" "${1:-.}" | fzf --ansi
}

4. fd - Fast Find

Basic Usage:

# Find files by name
fd "readme"

# Find with extension
fd -e md
fd -e py -e js

# Find directories
fd -t d "src"

# Find files
fd -t f "config"

# Exclude patterns
fd -E node_modules -E .git

# Hidden files
fd -H "config"

# Execute command on results
fd -e log -x rm {}
fd -e py -x wc -l {}

fd Functions:

# Find and preview
fdp() {
    fd "$@" | fzf --preview 'bat --color=always {} 2>/dev/null || exa --tree --level=2 --color=always {}'
}

# Find and edit
fde() {
    local file
    file=$(fd -t f "$@" | fzf --preview 'bat --color=always {}')
    [[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}

# Find large files
fdlarge() {
    local size="${1:-100M}"
    fd -t f -S +"$size" | xargs ls -lh | sort -k5 -h
}

# Find recent files
fdrecent() {
    local days="${1:-7}"
    fd -t f --changed-within "${days}d"
}

# Find duplicates by name
fddup() {
    fd -t f | sort | uniq -d
}

5. bat - Better cat

Basic Usage:

# Syntax highlighted output
bat file.py

# Show line numbers
bat -n file.py

# Show all non-printable chars
bat -A file.py

# Multiple files
bat file1.py file2.py

# Plain output (no decorations)
bat -p file.py

# Specific language
bat -l json data.txt

# Diff two files
bat --diff file1 file2

bat Configuration:

# Add to ~/.bashrc or ~/.zshrc

# Set bat as default pager
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export PAGER="bat"

# Bat theme
export BAT_THEME="TwoDark"

# Bat style
export BAT_STYLE="numbers,changes,header"

bat Aliases:

# Replace cat with bat
alias cat='bat --paging=never'

# Preview alias for fzf
alias preview='fzf --preview "bat --color=always {}"'

# Pretty print JSON
alias json='bat -l json'

# Pretty print YAML
alias yaml='bat -l yaml'

# Diff with bat
alias diff='bat --diff'

6. exa/eza - Better ls

Basic Usage:

# Basic list
exa

# Long format
exa -l

# All files including hidden
exa -la

# Tree view
exa --tree
exa --tree --level=2

# Sort by modified
exa -l --sort=modified

# With git status
exa -l --git

# Group directories first
exa -l --group-directories-first

# Icons
exa -l --icons

exa Aliases:

# Add to ~/.bashrc or ~/.zshrc

# Replace ls with exa
alias ls='exa --group-directories-first'
alias ll='exa -l --group-directories-first --git'
alias la='exa -la --group-directories-first --git'
alias lt='exa --tree --level=2'
alias lta='exa --tree --level=2 -a'

# With icons (if supported)
alias li='exa -l --icons --group-directories-first --git'

7. zoxide - Smart cd

Basic Usage:

# Initialize (add to shell rc)
eval "$(zoxide init bash)"  # or zsh

# Use z instead of cd
z projects          # Jump to most frequent/recent match
z pro               # Partial match

# Interactive selection
zi                  # Opens fzf for selection

# Add directory manually
zoxide add /path/to/dir

# Query database
zoxide query projects
zoxide query -l     # List all entries

zoxide Configuration:

# Add to ~/.bashrc or ~/.zshrc

# Initialize zoxide
eval "$(zoxide init bash --cmd cd)"  # Replace cd

# Or use custom command
eval "$(zoxide init bash --cmd j)"   # Use 'j' for jump

8. Shell Aliases and Functions

Essential Aliases:

# Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ~='cd ~'
alias -- -='cd -'

# Safety
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'

# Shortcuts
alias c='clear'
alias h='history'
alias q='exit'
alias v='vim'
alias e='${EDITOR:-vim}'

# Git shortcuts
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias gl='git log --oneline -20'
alias gd='git diff'
alias gb='git branch'
alias gco='git checkout'

# Docker shortcuts
alias d='docker'
alias dc='docker compose'
alias dps='docker ps'
alias dimg='docker images'
alias dlog='docker logs -f'

# Common directories
alias proj='cd ~/projects'
alias docs='cd ~/Documents'
alias dl='cd ~/Downloads'

Utility Functions:

# Create directory and cd into it
mkcd() {
    mkdir -p "$1" && cd "$1"
}

# Extract any archive
extract() {
    if [[ -f "$1" ]]; then
        case "$1" in
            *.tar.bz2) tar xjf "$1" ;;
            *.tar.gz)  tar xzf "$1" ;;
            *.tar.xz)  tar xJf "$1" ;;
            *.bz2)     bunzip2 "$1" ;;
            *.rar)     unrar x "$1" ;;
            *.gz)      gunzip "$1" ;;
            *.tar)     tar xf "$1" ;;
            *.tbz2)    tar xjf "$1" ;;
            *.tgz)     tar xzf "$1" ;;
            *.zip)     unzip "$1" ;;
            *.Z)       uncompress "$1" ;;
            *.7z)      7z x "$1" ;;
            *)         echo "'$1' cannot be extracted" ;;
        esac
    else
        echo "'$1' is not a valid file"
    fi
}

# Get public IP
myip() {
    curl -s https://ifconfig.me
}

# Weather
weather() {
    curl -s "wttr.in/${1:-}"
}

# Quick note
note() {
    local notes_dir="${NOTES_DIR:-$HOME/notes}"
    local date=$(date +%Y-%m-%d)
    mkdir -p "$notes_dir"
    ${EDITOR:-vim} "$notes_dir/$date.md"
}

# Serve current directory
serve() {
    local port="${1:-8000}"
    python -m http.server "$port"
}

# Show disk usage for directory
duh() {
    du -h "${1:-.}" | sort -h | tail -20
}

# Find process by name
psg() {
    ps aux | grep -v grep | grep -i "$1"
}

Integration Examples

1. Complete Shell Configuration

~/.bashrc or ~/.zshrc:

# ═══════════════════════════════════════════════════════════════
# CLI Productivity Configuration
# ═══════════════════════════════════════════════════════════════

# ─────────────────────────────────────────────────────────────────
# Environment
# ─────────────────────────────────────────────────────────────────

export EDITOR="vim"
export VISUAL="$EDITOR"
export PAGER="bat"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"

# XDG Base Directory
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"

# ─────────────────────────────────────────────────────────────────
# History
# ─────────────────────────────────────────────────────────────────

HISTSIZE=50000
HISTFILESIZE=50000
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend

# ─────────────────────────────────────────────────────────────────
# fzf Configuration
# ─────────────────────────────────────────────────────────────────

export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_DEFAULT_OPTS='
    --height 40%
    --layout=reverse
    --border
    --preview-window=right:50%:wrap
'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
export FZF_ALT_C_OPTS='--preview "exa --tree --level=2 --color=always {}"'

# ─────────────────────────────────────────────────────────────────
# Tool Initialization
# ─────────────────────────────────────────────────────────────────

# fzf keybindings
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

# zoxide
eval "$(zoxide init bash)"

# starship prompt
eval "$(starship init bash)"

# ─────────────────────────────────────────────────────────────────
# Aliases
# ─────────────────────────────────────────────────────────────────

# Modern replacements
alias ls='exa --group-directories-first'
alias ll='exa -l --group-directories-first --git'
alias la='exa -la --group-directories-first --git'
alias lt='exa --tree --level=2'
alias cat='bat --paging=never'
alias grep='rg'
alias find='fd'

# Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# Git
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias gl='git log --oneline -20'
alias gd='git diff'

# Docker
alias d='docker'
alias dc='docker compose'
alias dps='docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"'

# ─────────────────────────────────────────────────────────────────
# Functions
# ─────────────────────────────────────────────────────────────────

# Fuzzy edit
fe() {
    local file
    file=$(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}')
    [[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}

# Fuzzy cd
fcd() {
    local dir
    dir=$(fd --type d | fzf --preview 'exa --tree --level=2 --color=always {}')
    [[ -n "$dir" ]] && cd "$dir"
}

# Search and edit
rge() {
    local selection
    selection=$(rg --color=always --line-number "$1" | fzf --ansi)
    if [[ -n "$selection" ]]; then
        local file=$(echo "$selection" | cut -d: -f1)
        local line=$(echo "$selection" | cut -d: -f2)
        ${EDITOR:-vim} "+$line" "$file"
    fi
}

# Create and cd
mkcd() {
    mkdir -p "$1" && cd "$1"
}

2. Data Processing Pipeline

# Process JSON API response
curl -s 'https://api.github.com/users/torvalds/repos?per_page=100' \
    | jq '.[] | {name: .name, stars: .stargazers_count}' \
    | jq -s 'sort_by(.stars) | reverse | .[0:10]'

# Find large log files and show preview
fd -e log -S +10M \
    | fzf --preview 'tail -100 {}' \
    | xargs -I{} bat --line-range=:50 {}

# Search code, preview matches, edit selected
rg --color=always -l "TODO" \
    | fzf --preview 'rg --color=always -C 3 "TODO" {}' \
    | xargs -o ${EDITOR:-vim}

# Git log with diff preview
git log --oneline --color=always \
    | fzf --ansi --preview 'git show --color=always {1}' \
    | awk '{print $1}' \
    | xargs git show

3. Interactive Script Template

#!/bin/bash
# ABOUTME: Interactive CLI script using fzf and modern tools
# ABOUTME: Template for building interactive shell tools

set -e

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'

log_info() { echo -e "${GREEN}[INFO]${NC} $*"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
log_error() { echo -e "${RED}[ERROR]${NC} $*" >&2; }

# Check dependencies
check_deps() {
    local missing=()
    for cmd in fzf rg fd bat jq; do
        command -v "$cmd" >/dev/null || missing+=("$cmd")
    done

    if [[ ${#missing[@]} -gt 0 ]]; then
        log_error "Missing dependencies: ${missing[*]}"
        exit 1
    fi
}

# Main menu using fzf
main_menu() {
    local options=(
        "Search files"
        "Search content"
        "Edit config"
        "Run tests"
        "Exit"
    )

    local selection
    selection=$(printf '%s\n' "${options[@]}" | fzf --header="Select action:")

    case "$selection" in
        "Search files") search_files ;;
        "Search content") search_content ;;
        "Edit config") edit_config ;;
        "Run tests") run_tests ;;
        "Exit") exit 0 ;;
    esac
}

search_files() {
    local file
    file=$(fd --type f | fzf --preview 'bat --color=always {}')
    [[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}

search_content() {
    local query
    read -p "Search pattern: " query
    rge "$query"
}

edit_config() {
    local configs=("~/.bashrc" "~/.vimrc" "~/.gitconfig")
    local config
    config=$(printf '%s\n' "${configs[@]}" | fzf --header="Select config:")
    [[ -n "$config" ]] && ${EDITOR:-vim} "${config/#\~/$HOME}"
}

run_tests() {
    log_info "Running tests..."
    # Add test command here
}

# Main
check_deps
while true; do
    main_menu
done

Best Practices

1. Tool Selection Guidelines

TaskToolWhy
Find files by namefdFast, intuitive syntax
Find files by contentrgFaster than grep, better defaults
View filesbatSyntax highlighting, line numbers
List filesexaIcons, git status, tree view
Navigate directorieszoxideLearns your patterns
Interactive selectionfzfFuzzy matching, preview
Process JSONjqPowerful, composable

2. Performance Tips

# Use fd instead of find
fd "pattern"              # Instead of: find . -name "*pattern*"

# Use rg instead of grep
rg "pattern"              # Instead of: grep -r "pattern" .

# Limit search depth
fd --max-depth 3
rg --max-depth 3

# Exclude directories
fd -E node_modules -E .git
rg --glob '!node_modules'

3. Shell Startup Optimization

# Lazy load slow tools
nvm() {
    unset -f nvm
    [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
    nvm "$@"
}

# Cache expensive operations
_update_ps1_cache() {
    PS1_CACHE="$(expensive_command)"
}

Troubleshooting

Common Issues

fzf not finding files:

# Check FZF_DEFAULT_COMMAND
echo $FZF_DEFAULT_COMMAND

# Test fd directly
fd --type f

# Check for hidden files
fd -H

Colors not working:

# Check terminal capabilities
echo $TERM

# Force color output
export CLICOLOR_FORCE=1

Slow shell startup:

# Profile startup time
time bash -i -c exit

# Identify slow sources
for f in ~/.bashrc ~/.bash_profile; do
    echo "--- $f ---"
    time source "$f"
done

zoxide not working:

# Check initialization
type z

# Rebuild database
zoxide import --from=z

Version History

  • 1.0.0 (2026-01-17): Initial release

- Core CLI tools coverage (jq, fzf, ripgrep, fd, bat, exa) - Shell aliases and functions - Pipeline patterns - Integration examples - Shell configuration templates


Use this skill to build efficient, productive terminal workflows with modern CLI tools!

平台分布

Claude Code

31.14%
按下载量换算143

Codex

25.12%
按下载量换算115

OpenCode

16.49%
按下载量换算76

Cursor

13.71%
按下载量换算63

Gemini CLI

7.85%
按下载量换算36

Antigravity

3.36%
按下载量换算15

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills