Token导航 LogoToken导航

Agent Skill · 研究检索

command-prompt(命令提示符)

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

command-prompt 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 68,490。

总安装 233周安装 10GitHub Stars 3下载 82核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/iuliandita/skills --skill command-prompt

这个 Skill 是做什么的

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

提供多 shell 环境下的命令编写与配置参考,支持主流版本。适用于编写脚本、配置 dotfiles 或调试 shell 特定行为。自动识别目标 shell 并匹配相应语法与最佳实践。涉及敏感操作时应显式确认步骤,防止误执行危险命令。

command-prompt 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/command-prompt

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

command-prompt 怎么安装?

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

command-prompt 支持哪些 AI 工具?

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

command-prompt 需要什么权限?

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

command-prompt 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

command-prompt 用的人多吗?

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

command-prompt 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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调用外部服务未明确有提醒
command-prompt

命令提示符 · 本页

2333接触敏感数据未明确通过

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

SKILL.md 原文

Command Prompt: Shell Scripting and Configuration

Reference skill for writing commands, scripts, and configuration across Unix shells. Detects the target shell from context and routes to the appropriate reference.

Target versions (April 2026):

  • Zsh: 5.10
  • Bash: 5.3
  • Fish: 4.6
  • Nushell: 0.111
  • Tcsh: 6.24
  • Dash: 0.5.13

When to use

  • Writing shell commands, scripts, or one-liners
  • Configuring dotfiles (.zshrc, .bashrc, .profile, config.fish)
  • Writing completions, shell functions, or aliases
  • Porting scripts between shells
  • Debugging shell-specific behavior (globbing, arrays, expansion, quoting)
  • Setting up oh-my-zsh, starship, p10k, or other shell frameworks
  • Choosing which shell to target for a new script
  • Writing interactive commands on the user's local machine (zsh)

When NOT to use

  • Remote FreeBSD/OPNsense/pfSense commands - use firewall-appliance (handles tcsh/csh in the BSD context)
  • Ansible shell/command modules - use ansible (module gotchas differ from raw shell)
  • CI/CD pipeline shell blocks - use ci-cd (restricted environments, no interactive features)
  • General Linux sysadmin that isn't shell-specific - just do the task directly

AI Self-Check

Before returning any generated shell script or command, verify:

  • Shebang matches the detected target shell (not assumed bash)
  • set -euo pipefail (bash/zsh) or set -eu (POSIX sh) present in scripts
  • All variables double-quoted ("$var") unless word splitting is intentional
  • No shell-isms from the wrong shell (no [[]] in #!/bin/sh, no BASH_SOURCE in zsh)
  • Array indexing correct for the target shell (bash: 0-indexed, zsh: 1-indexed)
  • printf used over echo for non-trivial output
  • Glob safety guards in place (empty-glob case handled)
  • No hardcoded paths for tools (/usr/bin/git) - use command -v or bare command names
  • Temp files use mktemp with cleanup traps, not hardcoded /tmp/foo
  • No secrets in command history (use read -s or environment variables)

Workflow

Step 1: Detect the target shell

Before writing any shell code, determine the target shell. Check these signals in order:

SignalHow to checkRoutes to
ShebangFirst line of existing script#!/usr/bin/env zsh -> zsh, #!/usr/bin/env bash -> bash, #!/bin/sh -> posix-sh
File name/extension.zsh, .zshrc, .zprofile, .zshenv -> zsh; .bash, .bashrc, .bash_profile -> bash; .fish, config.fish -> fish
User's shellConversation context, $SHELLUser's local machine = zsh
Task typeWhat the script doesSee routing below

Task-based routing

TaskTarget shellWhy
Interactive commands on user's machinezshUser's default shell
Portable scripts (new)bashWidest deployment, good feature set
Docker/CI containersbash or shContainers often lack zsh
Minimal Alpine/BusyBox scriptsPOSIX shOnly ash/dash available
BSD system administrationtcshFreeBSD default (but see firewall-appliance skill)
Cross-shell startup (env vars, PATH)POSIX sh.profile sourced by all POSIX shells
Maximum portability requirementPOSIX shOnly standard guaranteed on all Unixes

Step 2: Load the right reference

Target shellReference file
Zshreferences/zsh.md (~680 lines, 14 sections)
Bashreferences/bash.md (~710 lines, 13 sections)
POSIX shreferences/posix-sh.md (~490 lines, 10 sections)
Fish, tcsh, nushell, othersreferences/alt-shells.md (~420 lines, 4 shells)

Don't load all references. Pick the one that matches. If porting between two shells, load both.

Step 3: Write code, then verify

Use the cross-shell comparison below for quick lookups. After writing, run through the Verification Checklist at the bottom of this section.


Quick Cross-Shell Comparison

FeaturePOSIX shBashZshFish
Arraysno (use $@)0-indexed1-indexedlists (1-indexed)
Assoc arraysnodeclare -A (4.0+)typeset -Ano
Glob **/noshopt -s globstarbuilt-inbuilt-in
Failed globpasses literalpasses literalerrorno match
[[]]noyesyesno (use test)
Process sub <()noyesyes + =()`(command \psub)`
Word splittingon unquoted $varon unquoted $varnono
Arithmetic$(()) only$(()), (()), let$(()), (())math
String lowercase-${var,,}${var:l}string lower
Completionsnonebasic (bash-completion)powerful (compsys)powerful (built-in)
Config file.profile.bashrc.zshrcconfig.fish
Shebang#!/bin/sh#!/usr/bin/env bash#!/usr/bin/env zsh#!/usr/bin/env fish
Script safetyset -euset -euo pipefailset -euo pipefailN/A (strict by default)
Non-forking cmd subno${cmd;} (5.3+)${cmd} (5.10+)no

Universal Patterns (All POSIX Shells)

These work in sh, bash, and zsh. Fish has different syntax for most of these - see the alt-shells reference.

Piping and redirection

PatternEffect
`cmd1 \cmd2`Pipe stdout of cmd1 to stdin of cmd2
cmd > fileRedirect stdout to file (overwrite)
cmd >> fileRedirect stdout to file (append)
cmd 2> fileRedirect stderr to file
cmd &> fileRedirect both stdout and stderr (bash/zsh, not POSIX)
cmd 2>&1Redirect stderr to stdout
cmd > /dev/null 2>&1Silence all output (POSIX-portable)
cmd < fileFeed file as stdin
cmd <<'EOF'Here document (single-quoted delimiter = no expansion)
cmd <<< "string"Here string (bash/zsh, not POSIX)
`cmd1 \tee file \cmd2`Send stdout to both file and cmd2

Chaining

PatternBehavior
cmd1; cmd2Run sequentially, ignore exit codes
cmd1 && cmd2Run cmd2 only if cmd1 succeeds (exit 0)
`cmd1 \\cmd2`Run cmd2 only if cmd1 fails (exit non-0)
cmd &Run in background
`cmd1 && cmd2 \\cmd3`Poor man's if/else (not reliable - cmd3 runs if cmd2 fails too)

Job control

CommandEffect
Ctrl+ZSuspend foreground job
bg / bg %NResume job in background
fg / fg %NResume job in foreground
jobsList background jobs
kill %NKill job by number
waitWait for all background jobs
wait $PIDWait for specific PID
disown %NDetach job from shell (survives logout)

Signals and traps

# Cleanup on exit (works in sh, bash, zsh)
cleanup() {
    rm -f "$tmpfile"
}
trap cleanup EXIT INT TERM

# Ignore a signal
trap '' HUP

# Common signals: EXIT (0), HUP (1), INT (2), TERM (15), USR1 (10), USR2 (12)

# Graceful kill with SIGTERM -> wait -> SIGKILL escalation
kill_gracefully() {
    local pid=$1 timeout=${2:-5}
    kill -TERM "$pid" 2>/dev/null || return
    local i=0
    while kill -0 "$pid" 2>/dev/null && [ $i -lt $timeout ]; do
        sleep 1; i=$((i+1))
    done
    kill -0 "$pid" 2>/dev/null && kill -KILL "$pid"
}

Interactive "kill by name" (zsh) - covers search, space-safe names, confirm, TERM->KILL escalation:

pk() {                                           # usage: pk <pattern>
    local pattern=$1 pids
    pids=(${(f)"$(pgrep -af -- "$pattern")"})    # -f matches full cmdline (spaces ok)
    (( $#pids )) || { print -u2 "no match"; return 1 }
    printf '%s\n' "${pids[@]}"                   # show PID + cmdline
    read -q "?kill these? [y/N] " || { print; return 1 }
    print
    for line in $pids; do kill_gracefully ${line%% *} 3; done
}

Quoting rules

SyntaxExpansionUse for
"double"$var, $(cmd), ${param} expand; \ escapesMost strings with variables
'single'Nothing expands, completely literalRegexes, JSON, strings with $ or !
$'ansi'\n, \t, \' interpreted (bash/zsh)Strings needing literal control chars
\charEscapes one characterSingle special chars in unquoted context

Golden rule: when in doubt, double-quote. "$var" is almost always correct. Unquoted $var causes word splitting (in sh/bash) or glob expansion.

Exit codes

CodeMeaning
0Success
1General error
2Misuse of shell builtin
126Command found but not executable
127Command not found
128+NKilled by signal N (e.g., 130 = Ctrl+C / SIGINT)

Common portable idioms

# Check if command exists
command -v git >/dev/null 2>&1 || { echo "git required" >&2; exit 1; }

# Default variable value
: "${VAR:=default}"       # set VAR to "default" if unset or empty
name="${1:-anonymous}"     # parameter default

# Temporary file (portable)
tmpfile=$(mktemp) || exit 1
trap 'rm -f "$tmpfile"' EXIT

# Read file line by line
while IFS= read -r line; do
    printf '%s\n' "$line"
done < file.txt

# Loop over glob results
for f in *.txt; do
    [ -e "$f" ] || continue    # guard against no matches (POSIX sh)
    echo "$f"
done

Completions Quick Reference (Zsh)

Zsh's completion system (compsys) handles subcommand routing natively. Minimal working example for a CLI tool with subcommands:

#compdef mycli

_mycli() {
  local -a subcmds=(
    'init:Initialize a new project'
    'build:Build the project'
    'deploy:Deploy to target environment'
  )

  _arguments -C \
    '(-h --help)'{-h,--help}'[Show help]' \
    '1:command:->subcmd' \
    '*::arg:->args'

  case $state in
    subcmd) _describe 'command' subcmds ;;
    args)
      case $words[1] in
        deploy) _arguments '--env[Target environment]:env:(dev staging prod)' ;;
      esac
      ;;
  esac
}

Place in a file named _mycli on your fpath, then ensure the directory is registered:

# In .zshrc, BEFORE compinit:
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit

Or source inline with compdef _mycli mycli (no fpath needed). The reference files have deeper coverage: glob-qualified completions, _files, _hosts, _values, and async completion patterns.


Verification Checklist

Before returning any shell script, check:

  • Shebang matches the target shell. #!/usr/bin/env bash for bash, #!/usr/bin/env zsh for zsh, #!/bin/sh for POSIX sh. Never #!/bin/bash (not portable across distros).
  • set -euo pipefail present for bash and zsh scripts. For POSIX sh: set -eu (no pipefail).
  • Variables are quoted. "$var" not $var, unless word splitting is intentional.
  • No shell-isms in the wrong shell. No [[]] in #!/bin/sh. No BASH_SOURCE in zsh. No bash arrays in POSIX sh.
  • Glob safety. POSIX sh: guard with [-e "$f"] || continue. Zsh: use (N) qualifier. Bash: shopt -s nullglob or guard.
  • Array indexing matches the shell. Bash: 0-indexed. Zsh: 1-indexed. POSIX sh: no arrays.
  • printf over echo for anything non-trivial (echo behavior varies across shells and platforms).

Reference Files

  • references/zsh.md - Zsh 5.9/5.10 patterns, glob qualifiers, arrays, parameter expansion, completions, autoloading, dotfile config, prompt hooks, zsh-only features, 5.10 additions (non-forking ${}, namerefs, SRANDOM), bash porting matrix
  • references/bash.md - Bash 5.3 patterns, parameter expansion, arrays, conditionals, process substitution, error handling, traps, heredocs, coprocesses, bash 5.x features (non-forking ${cmd;}, GLOBSORT, SRANDOM), script template
  • references/posix-sh.md - Portable POSIX sh patterns, what's POSIX and what's not, bashism avoidance checklist, which-sh-am-I, arithmetic, parameter expansion, portable conditionals
  • references/alt-shells.md - Fish 4.6 (syntax, functions, completions, config, 4.6 additions), tcsh/csh 6.24 (syntax, when you'll encounter it), nushell 0.111 (structured pipelines, types), elvish 0.22/oils 0.37 (brief)

Related Skills

  • firewall-appliance - OPNsense/pfSense uses tcsh/csh on FreeBSD. That skill handles the BSD firewall context; this skill covers tcsh syntax in general.
  • ansible - Ansible shell/command modules have their own idiosyncrasies beyond raw shell scripting. Use ansible for playbook work.
  • ci-cd - CI shell blocks run in restricted environments (no interactive features, possibly no bash). Use ci-cd for pipeline design; use this skill for the shell syntax within them.

Rules

  1. Detect the shell first. Check shebang, file extension, or ask. Don't assume bash when the user might mean zsh.
  2. Load the right reference. Don't wing zsh arrays or bash parameter expansion from memory - the subtle differences justify loading the reference every time.
  3. Shebang is #!/usr/bin/env <shell>. Not #!/bin/bash. The env form is portable across distros. Exception: #!/bin/sh for POSIX scripts (this IS the standard form).
  4. set -euo pipefail in every bash/zsh script. No exceptions for scripts beyond a one-liner.
  5. User's interactive shell is zsh. When writing commands for the user to run locally, use zsh syntax. Bash for scripts and remote machines unless the script specifically needs zsh.
  6. Don't mix shell syntaxes. A bash script uses bash idioms. A zsh script uses zsh idioms. "Works in both" compromises use neither well and confuse readers.
  7. Quote your variables. "$var" is the default. Unquoted $var is the exception that needs justification.

平台分布

Codex

37.67%
按下载量换算31

Claude

30.14%
按下载量换算25

Cursor

19.26%
按下载量换算16

Gemini CLI

9.9%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills