Rain
$ rain 官方出品 高风险Rain(rain)通过 rain deploy、rain diff、rain ls、rain logs、rain build --json 与 rain fmt --json 简化 AWS CloudFormation 编写与部署,无需冗长的原生参数即可快速对比变更并排查失败日志。
brew install rain rain 可在本地校验/转换 YAML 与 JSON 模板,并用更紧凑的格式对比线上堆栈,比原生 aws cloudformation 或 MCP 更省 Token。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
模板命令(build、fmt)支持 --json,部署支持 --yes 非交互模式及清晰的 --profile/--region 参数。
- Supports
rain build --json,rain fmt --json, andrain deploy --yes - Clean Go CLI with concise stack event logs via
rain logs
遵循标准 AWS IAM 权限边界,默认对 deploy/rm 进行确认拦截(除非传 --yes),但 CloudFormation 变更影响面较大。
- Requires
--yesto bypass interactive confirmation ondeployandrm
静态 Go 单二进制,可通过 Homebrew 与 GitHub Releases 跨 macOS、Linux、Windows 安装。
- Available via
brew install rainwith no Python/Node runtime required
在堆栈差异对比、模板生成与失败日志查看方面比 aws cloudformation 更高效且省 Token。
- Built-in
rain diff,rain logs, andrain forecastdiagnostics
AWS CloudFormation 官方团队维护(aws-cloudformation/rain),Apache-2.0 协议。
- Official
aws-cloudformation/rainrepository under Apache-2.0
官方站点文档清晰,Cobra --help 层级规范。
- Published docs at aws-cloudformation.github.io/rain
安全边界、鉴权与放权指南
复用标准 AWS SDK Profile(~/.aws/credentials、~/.aws/config、--profile)与 AWS_* 环境变量。
Apache-2.0 开源 CLI 免费;rain deploy 会创建计费的 AWS 云资源。
# Rain (AWS CloudFormation) Agent Rules - Run `rain fmt <file>` and `rain ls` / `rain logs <stack>` before deploying. - Pass `--yes` on `rain deploy` only after user approval; never run `rain rm <stack> --yes` unapproved. - Pin `--profile` and `--region` explicitly.
Agent 高频安全命令配方
只读查询(安全推荐)
rain ls
查看目标 AWS 区域中的堆栈名称与状态。
rain fmt template.yaml --json
解析校验本地 CloudFormation 模板并向 stdout 输出标准 JSON。
受控写入与预演
rain deploy template.yaml my-stack --yes --params Env=staging
显式传入 --yes 与 --params,防止 rain deploy 停在确认提示。
核心优势
- +
rain fmt --json与rain build --json简化本地模板校验与转换。 - +
rain logs与rain diff比原生 AWS CLI 噪音更低。 - + 静态 Go 单二进制,支持
--yes非交互部署。
注意事项与踩坑点
- !
rain ls与rain logs默认输出人类可读文本而非 JSON。 - !
rain deploy或rain rm若漏传--yes会触发交互确认而阻塞。