Dynein
$ dy 官方出品 高风险dynein(dy)是一款对人类和脚本都友好的 DynamoDB Rust CLI,能自动消除繁琐的 DynamoDB AttributeValue 语法({"S": ...}),直接使用标准 JSON。支持 dy list、dy desc、dy scan、dy get、dy put 及 dy export --format json|jsonl|csv。
brew install dynein dy 在本地自动完成 DynamoDB AttributeValue 与标准 JSON 的双向转换并读写 JSON/CSV 文件,比 aws dynamodb 或 MCP 更精炼。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
export --format json|jsonl、desc 与 get 支持标准 JSON,但 dy export 需指定 --output-file 而非直接输出至标准输出,且 dy use 会修改全局状态。
dy export --format json|jsonl --output-fileemits standard JSON; statefuldy usecontext
继承基于 IAM 权限隔离的 AWS 凭据,支持 --region local 对接 DynamoDB Local 测试,但 put/del/import 缺少 --dry-run。
- Standard AWS IAM auth and
--region localtesting; no--dry-runflag
单一 Rust 二进制,可通过 Homebrew、Cargo 与 GitHub Releases 在 macOS、Linux 与 Windows 安装。
- Available via
brew install dyneinandcargo install dynein
彻底免去日常查询与 JSON/CSV 导入时手写 aws dynamodb 类型描述符({"S": ...})的痛苦。
- Automatic conversion between standard JSON and DynamoDB AttributeValues
由 AWS Labs 维护(awslabs/dynein),采用 Apache-2.0 协议。
- Official
awslabs/dyneinrepository under Apache-2.0
GitHub README 示例清晰且 Clap --help 详尽,但无独立文档站。
- Documented in GitHub README and
--help
安全边界、鉴权与放权指南
复用标准 AWS SDK 凭据链(~/.aws/credentials、AWS_PROFILE、AWS_ACCESS_KEY_ID、IAM 角色),并在 ~/.dynein/ 保存当前表上下文。
Apache-2.0 开源 CLI 免费;DynamoDB 读写容量单元(RCU/WCU)与存储会产生 AWS 费用。
# Dynein (dy) Agent Rules - Always pass explicit `--region` and `--table` flags instead of relying on mutable `dy use` state. - Remember `dy scan` samples items and consumes read capacity units (RCUs); use `dy get` or `dy query` with keys when possible. - Never run `dy admin delete-table` or `dy del` without explicit approval.
Agent 高频安全命令配方
只读查询(安全推荐)
dy --region us-east-1 list
使用标准 AWS 凭据列出 us-east-1 区域内的 DynamoDB 表。
dy --region us-east-1 export --table users --format jsonl --output-file users.jsonl
将表记录以标准 JSON Lines 格式导出至 users.jsonl,无需 DynamoDB 类型包装。
受控写入与预演
dy --region us-east-1 put --table users "user_123" '{"name": "Ada", "role": "admin"}' 使用标准 JSON 属性向 users 表插入或覆盖指定主键记录。
核心优势
- + 自动将 DynamoDB AttributeValue 转换为干净的标准 JSON 与 JSONL。
- + 支持
--region local以便在 DynamoDB Local 中安全测试。
注意事项与踩坑点
- !
dy use会在~/.dynein/持久化当前表上下文,Agent 务必显式传递--table与--region。 - !
dy export依赖--output-file落盘,无法直接流向标准输出。