帮助你判断并设计一行安装脚本方案,兼顾易用性、安全取舍与适用边界。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "one-line-installer-patterns" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/amplifier-bundle-skills/main/skills/one-line-installer-patterns/SKILL.md 2. 保存为 ~/.claude/skills/one-line-installer-patterns/SKILL.md 3. 装好后重载技能,告诉我可以用了
我有一个基于 Docker Compose 的多服务项目,不能用 npm publish 或 uv tool install。请判断是否适合使用 curl | sh 的一行安装方式,并给出推荐的安装脚本结构、安全提示、回滚策略,以及不适用这种方案的边界条件。
给出是否应采用一行安装脚本的判断,并附带脚本设计原则、安全权衡说明与替代方案建议。
我要给非技术用户分发一个会安装系统依赖和本地 CLI 的工具。请参考 rustup、bun、deno 等社区惯例,设计一个尽量简单的一行安装入口,并明确展示风险提示、权限说明、平台检测和失败后的处理流程。
输出一套更适合非技术用户的一行安装方案,包括文案提示、执行流程和异常处理建议。
请审查我的项目安装需求:它是一个原始 TS/React 应用,涉及浏览器端构建和团队内部部署。请分析 curl 管道安装是否是错误选择,并列出更合适的分发方式、判断标准,以及我应如何向团队解释这个决策。
说明该模式是否不合适,并给出替代分发渠道、决策依据及对团队的沟通说法。
A curl … | bash install script is the right answer in a narrow set of cases. Outside that set, simpler distribution mechanisms exist and should be used.
Use this pattern when:
uv tool install cannot do the job alonedocker compose up, but the user needs a clean way to land the compose file, generate an .env, and start the stackDon't use this pattern when:
uv tool install git+... and see cli-packaging-patternsnpx <tool> or pnpm dlx <tool>curl -L .../tool -o ~/.local/bin/tool && chmod +x ~/.local/bin/tool. This is the modern Go/Rust default.docker-compose.yml. The "install command" is docker compose up -d. Plausible, n8n, and Outline all do this.A curl | bash script is a thin wrapper around one of the four real distribution mechanisms above. It is not its own distribution mechanism.
Piping a remote script to a shell executes whatever the server returns at the moment of invocation. The user has no opportunity to inspect what runs. The trust model is roughly equivalent to running any other unverified binary from the internet — not worse, but not better.
There is also a documented attack class: a malicious server can detect a curl | bash invocation by stalling the response and serve different content than it would to a curl > install.sh && less install.sh inspection. See https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/ — this is real and demonstrated, not theoretical.
Required mitigations:
http://.main.What this pattern cannot give you:
curl -fsSL https://example.com/install.sh | bash
This shape is used by rustup, bun, deno, fly, ollama, pnpm, supabase, and most others. Conform to it.
curl -fsSL: fail on HTTP error (-f), silent progress (-s), show errors (-S), follow redirects (-L)| bash — not | sh. Almost no production installer is strict POSIX sh. Bash 3.2 (the macOS default) is the realistic floor. Documenting | bash is honest about what the script actually requires.For arguments, use the rustup convention:
curl -fsSL https://.../install.sh | bash -s -- --version 1.2.3 --no-modify-path
The bash -s -- form is broadly understood and supported.
For the review-first variant, document this prominently in the README — not as a footnote:
curl -fsSL https://.../install.sh -o install.sh
less install.sh
bash install.sh
1. set -euo pipefail; trap cleanup EXIT
2. Detect: OS, arch, libc (glibc vs musl), shell, existing install
…
帮助你安全编排 Docker 容器任务,并搭建可复现的开发运行环境
帮助你调研、规划并并行执行大规模代码变更,让多个代理分别提交 PR。
以资深工程师视角审视架构、遗留重构与工具选型,给出务实建议。
用多模型视觉能力分析图片内容、提取文字并回答图像相关问题。
帮助开发者设计安全持久的配置与状态文件管理模式,兼顾默认值合并和崩溃恢复。
帮助开发者构建含生命周期管理、WebSocket与SSE的 HTTP 服务模式
帮助开发者设计易安装、易扩展且配置分层清晰的 CLI 工具模式。
帮助开发者掌握地道 Rust 模式、所有权、并发与错误处理实践
帮助用户检测并安装 GitHub CLI,快速完成命令行开发环境准备。
优化 APM CLI 的命令体验、帮助文案与首次使用流程设计
帮助开发者在认证、输入处理、密钥和敏感功能开发中进行系统安全审查