Token导航 LogoToken导航

Agent Skill · 开发

windows-shell-syntax(Windows shell 语法)

windows-shell-syntax 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

windows-shell-syntax 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 8,901。

总安装 2,946周安装 124GitHub Stars 公开资料未说明下载 1,032核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:windows-shell-syntax(Windows shell 语法)
来源仓库:https://github.com/loevery/windows-shell-syntax
安装命令:
openclaw skills install windows-shell-syntax
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install windows-shell-syntax

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

提供 Windows 终端命令语法指导,对比 Linux shell 差异。适用于跨平台脚本开发与命令行调试场景。调用命令 openclaw skills install windows-shell-syntax 安装。需先检测当前 shell 类型(PowerShell 或 cmd.exe),适配建议。

建议结合具体项目环境验证命令有效性。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install windows-shell-syntax;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

windows-shell-syntax 怎么安装?

在终端执行 openclaw skills install windows-shell-syntax。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

windows-shell-syntax 支持哪些 AI 工具?

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

windows-shell-syntax 需要什么权限?

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

windows-shell-syntax 是免费的吗?

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

windows-shell-syntax 用的人多吗?

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

windows-shell-syntax 安全吗?

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

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

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

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

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
windows-shell-syntax

Windows shell 语法 · 本页

2,946—接触敏感数据MIT-0通过

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

SKILL.md 原文

name
windows-shell-syntax
description
Use when giving terminal commands on Windows or when comparing Windows vs Linux shell syntax. Detect whether the shell is PowerShell or cmd.exe before suggesting commands. Prevent Bash-only syntax from being given to Windows users. Covers quoting, escaping, chaining, env vars, line continuation, and safe rewrite patterns for cmd, PowerShell, and Bash.

Windows Shell Syntax

Use this skill whenever the user is on Windows and asks for terminal commands, shell scripts, escaping rules, or asks to compare Windows and Linux terminal syntax.

First rule: identify the shell

Do not say "Windows terminal syntax" as if Windows had one shell.

On Windows, distinguish between:

  • PowerShell (powershell, pwsh)
  • cmd.exe (cmd)
  • Git Bash / WSL bash (Unix-style shell on Windows)

Windows Terminal is only the terminal app. It can host multiple shells.

If the shell is unclear:

  • Ask which shell they use, or
  • Give separate PowerShell: and cmd: variants.

Hard rule

Never give Bash-only syntax to a Windows user unless they explicitly said they are using:

  • Git Bash
  • WSL
  • MSYS2
  • Cygwin
  • a Linux remote shell

Examples of Bash-only habits that must not be handed to cmd/PowerShell users without labeling:

  • export NAME=value
  • $VAR for environment variables in cmd
  • backslash escaping like \" as the default Windows answer
  • rm, mv, cp as if they were native cmd syntax
  • line continuation with \

The && / || compatibility rule

Do not say "Windows does not support &&".

The real compatibility matrix is:

  • cmd.exe: supports &, &&, and ||
  • PowerShell 7+: supports && and ||
  • Windows PowerShell 5.1: does not support && and ||
  • Git Bash / WSL: supports && and ||

This means the question is which shell and which PowerShell version, not just "Windows or not".

Safe default for uncertain PowerShell version

If you know only that the user is in PowerShell, but do not know whether it is:

  • Windows PowerShell 5.1 (powershell), or
  • PowerShell 7+ (pwsh / modern PowerShell)

then avoid && / || in the default answer and use explicit guarded logic instead.

Quick mapping

Escaping / quoting

cmd.exe
  • Escape metacharacters with ^
  • Typical special chars: & | ( ) < > ^
  • Example literal quote in a cmd snippet for users who need cmd escaping context: ^"
  • Use "..." for paths with spaces
  • Environment variables: %USERPROFILE%
  • Line continuation: ^ at end of line
  • Chain commands:

- always run next: & - next only on success: && - next only on failure: ||

PowerShell
  • Prefer single quotes '...' for literal strings
  • Double quotes "..." are expandable: variables/interpolation work inside them
  • Escape character is the backtick: ` ``
  • Literal double quote often does not need escaping if you wrap the whole string in single quotes
  • Environment variables: $env:USERPROFILE
  • Line continuation: usually avoid; if needed use backtick at end of line, but prefer splatting or parentheses for readability
  • PowerShell 7+ supports && / ||
  • Windows PowerShell 5.1 does not support && / ||
  • When compatibility matters, prefer explicit if checks over pipeline chain operators
Bash
  • Escape character: \
  • Strong literal quotes: '...'
  • Expandable quotes: "..."
  • Environment variables: $HOME, $VAR
  • Line continuation: \ at end of line

Safe answer pattern

When the user asks for a command and the shell is not specified, prefer this structure:

PowerShell:
<command>

cmd:
<command>

Do not provide only one unlabeled command if syntax differs.

If version compatibility matters, prefer this structure:

PowerShell 5.1 compatible:
<command>

PowerShell 7+:
<command>

cmd:
<command>

Rewrite rules

1. Command chaining

If you were about to write Bash chaining, rewrite for the actual shell.

  • Bash: cmd1 && cmd2
  • cmd: cmd1 && cmd2
  • PowerShell 7+: cmd1 && cmd2
  • PowerShell 5.1 compatible: cmd1; if ($?) { cmd2 }

Example:

PowerShell 5.1 compatible:
cmd1
if ($?) { cmd2 }

PowerShell 7+:
cmd1 && cmd2

cmd:
cmd1 && cmd2

2. How to replace &&

When a user says && does not work, first infer the likely shell:

  • If they are in Windows PowerShell 5.1, replace:

- cmd1 && cmd2 → cmd1; if ($?) { cmd2 } - cmd1 || cmd2 → cmd1; if (-not $?) { cmd2 }

  • If they are in cmd, keep && / ||
  • If they are in PowerShell 7+, && / || are valid and usually can stay as-is

For native executables in PowerShell, a more explicit form may be safer when exit-code behavior matters:

cmd1
if ($LASTEXITCODE -eq 0) { cmd2 }

Use this especially when the left-hand side is an .exe or external CLI and you want to be precise about process exit codes.

3. Environment variables

  • Bash: export NAME=value
  • PowerShell: $env:NAME = 'value'
  • cmd: set NAME=value

For reading values:

  • Bash: $NAME
  • PowerShell: $env:NAME
  • cmd: %NAME%

4. Paths with spaces

Always quote Windows paths with spaces.

  • PowerShell: "C:\Program Files\App"
  • cmd: "C:\Program Files\App"

5. Embedded quotes

If the user is in cmd, remember ^ escaping for metacharacters and quote-sensitive cases. If the user is in PowerShell, prefer changing quote style instead of piling on escapes.

Example:

PowerShell:
python -c 'print("hello")'

cmd:
python -c "print(^\"hello^\")"

Keep cmd examples minimal and tested-looking; cmd quoting gets messy fast.

6. Multi-line commands

Prefer shell-native multi-line styles:

PowerShell:
& python `
  script.py `
  --name test

cmd:
python ^
  script.py ^
  --name test

But if a one-line command is acceptable, prefer one line.

6.5 Quoting hell: prefer avoiding it

For cmd and PowerShell, deeply nested quoting can become fragile fast, especially for commands like:

  • python -c "..."
  • JSON passed inline on the command line
  • regex patterns with both quotes and backslashes
  • commands embedded inside another shell command

If quoting starts getting ugly, prefer a safer rewrite instead of trying to perfectly escape everything.

Preferred escape hatches:

  • Put the content in a script file and run the file
  • Put JSON in a file and pass the file path
  • In PowerShell, prefer single quotes outside and double quotes inside when possible
  • In cmd, prefer moving complex logic out of the command line entirely
  • If both shells are possible, give a PowerShell variant rather than forcing a complicated cmd example

Rule of thumb: if the example needs a paragraph to explain the escaping, rewrite the approach.

6.6 Redirection/pipeline pitfalls: prefer simple patterns

Windows shells differ a lot in redirection and pipeline behavior.

  • cmd pipelines are text-based
  • PowerShell pipelines pass objects between commands
  • stderr/stdout redirection can behave differently across native commands, cmd, and PowerShell

If a command depends on tricky redirection, prefer a simpler pattern:

  • Write output to a file first, then read/process the file
  • Run commands as separate steps instead of one dense pipeline
  • In PowerShell, prefer explicit variables over clever pipeline chaining when clarity matters
  • When giving a cross-shell answer, avoid advanced redirection unless you label shell-specific variants clearly

Rule of thumb: if correctness depends on subtle pipe/redirection semantics, choose a more explicit multi-step form.

7. Bash → Windows rewrite cheat sheet

Use this section when the user pastes a Bash command and wants the Windows equivalent.

cmd1 && cmd2
Bash:
cmd1 && cmd2

PowerShell 5.1 compatible:
cmd1
if ($?) { cmd2 }

PowerShell 7+:
cmd1 && cmd2

cmd:
cmd1 && cmd2
cmd1 || cmd2
Bash:
cmd1 || cmd2

PowerShell 5.1 compatible:
cmd1
if (-not $?) { cmd2 }

PowerShell 7+:
cmd1 || cmd2

cmd:
cmd1 || cmd2
export NAME=value
Bash:
export NAME=value

PowerShell:
$env:NAME = 'value'

cmd:
set NAME=value
echo $NAME
Bash:
echo $NAME

PowerShell:
echo $env:NAME

cmd:
echo %NAME%
~/file.txt
Bash:
cat ~/file.txt

PowerShell:
Get-Content $HOME\file.txt

cmd:
type %USERPROFILE%\file.txt
rm, cp, mv
Bash:
rm file.txt
cp a.txt b.txt
mv a.txt b.txt

PowerShell:
Remove-Item file.txt
Copy-Item a.txt b.txt
Move-Item a.txt b.txt

cmd:
del file.txt
copy a.txt b.txt
move a.txt b.txt
VAR=value command

This Bash pattern has no direct same-shape equivalent in PowerShell or cmd.

Bash:
NAME=value mytool

PowerShell:
$env:NAME = 'value'
mytool

cmd:
set NAME=value
mytool

If the temporary-only behavior matters, mention that Bash can scope env vars to one command, while PowerShell/cmd examples usually need extra cleanup if true one-command scope is required.

`command \

--flag value`

Bash:
command \
  --flag value

PowerShell:
command `
  --flag value

cmd:
command ^
  --flag value
grep pattern file.txt
Bash:
grep pattern file.txt

PowerShell:
Select-String pattern file.txt

cmd:
findstr pattern file.txt
pwd and ls
Bash:
pwd
ls

PowerShell:
Get-Location
Get-ChildItem

cmd:
cd
dir

Note: ls and pwd may appear to work in PowerShell because of aliases, but if you are teaching shell syntax clearly, prefer the native command names.

Version detection hints

Use these heuristics when deciding whether && is safe in PowerShell:

  • If the environment/tooling says shell=powershell, that only tells you the shell family, not always the exact version
  • pwsh usually means PowerShell 7+
  • powershell often means Windows PowerShell 5.1 on older/default Windows setups
  • If the user says "Windows PowerShell", assume 5.1 unless they say otherwise
  • If the user says just "PowerShell" and compatibility matters, use the 5.1-safe form

If you need a detection command, give:

PowerShell:
$PSVersionTable.PSVersion

Response policy

When replying to Windows users:

  1. Infer shell from context if obvious.
  2. If not obvious, label commands by shell.
  3. Prefer PowerShell examples when the environment says shell=powershell.
  4. If the user explicitly mentions cmd or says ^", answer in cmd syntax.
  5. If converting from Linux/Bash to Windows, explain the key syntax changes briefly.
  6. Do not call PowerShell syntax "Windows syntax" if the distinction matters.
  7. If && is involved, distinguish cmd, PowerShell 7+, and PowerShell 5.1 instead of treating all Windows shells the same.

Minimal explanation to include when helpful

Use short phrasing like:

  • Windows Terminal is just the terminal app; the real syntax depends on whether you're running PowerShell or cmd.
  • In cmd, escape special characters with ^.
  • In PowerShell, the escape character is the backtick, and single quotes are usually the easiest literal form.
  • && works in cmd and PowerShell 7+, but not in Windows PowerShell 5.1.

Notes

  • cmd commonly uses ^ for escaping special characters.
  • PowerShell quoting rules differ substantially from cmd.
  • For maximum compatibility in PowerShell, cmd1; if ($?) { cmd2 } is safer than assuming && support.
  • When in doubt, provide both variants instead of guessing.

平台分布

OpenClaw

84.18%
按下载量换算869

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills