智能购物清单批量管理助手
简介
基于 Bring! 官方 API 的 CLI 工具,支持批量添加、管道导入及 dry-run 预览,环境变量管理凭证,让购物清单管理高效且安全可控。
原始描述
Use when user wants to add items to Bring! shopping lists. For adding single items, batch items, or items from stdin/files. Supports dry-run preview and JSON output.
通过你的 Agent 添加
安装目录:bring-add/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
bring-add 是一款专为 Bring! 购物清单设计的命令行工具,提供多种灵活的添加方式:
- 单条添加:
bring-add "牛奶" "1L"— 快速添加带规格的商品 - 批量模式:
bring-add --batch "番茄500g, 洋葱, 奶酪200g"— 逗号分隔批量导入 - 管道输入:
cat shopping.txt | bring-add -— 从文件或其他命令读取 - 交互模式:直接运行
bring-add进入 TTY 交互式输入 - 预览功能:
--dry-run预览而不实际添加,适合核对 - JSON 输出:
--json支持脚本自动化集成
用户需先配置 BRING_EMAIL 和 BRING_PASSWORD 环境变量完成认证,可选设置 BRING_DEFAULT_LIST 指定默认清单。
显著优点
- 多场景覆盖:从单次购物到批量采购,从手动输入到文件导入,覆盖用户所有添加场景
- 零 App 操作:无需打开手机应用,在终端即可完成全部操作,大幅提升效率
- 智能规格解析:自动识别 "商品名 + 数量/单位" 格式(如 "牛奶 1L"),减少输入负担
- 开发者友好:完整的退出码定义、JSON 输出、stderr 分离设计,便于脚本集成
- 隐私安全优先:凭证仅通过环境变量读取,无硬编码、无本地存储,符合 GDPR 原则
潜在缺点与局限性
- 功能单向性:仅支持添加,不支持删除、修改或浏览清单内容,需配合 Bring! App 使用
- 网络依赖:完全依赖 Bring! 官方 API,服务不可用时功能受限
- 无离线缓存:添加失败时无本地重试队列,需用户手动重试
- 平台限制:基于 Node.js 18+,Windows 原生支持需额外配置
- 规格解析边界:复杂描述可能被误判(如 "Red onions" 正确,"Red onions 3" 会被拆分)
适合的目标群体
- 效率型用户:习惯命令行工作流,希望减少手机操作的中重度用户
- 家庭采购协调员:需要快速批量录入家庭成员发来的采购清单
- 自动化爱好者:希望将购物清单管理整合到个人工作流的开发者
- Recipe-to-List 场景:从食谱提取食材后批量导入购物清单
使用风险
- 依赖版本风险:
bring-shopping 使用通配符版本,可能引入破坏性更新,建议锁定版本
- 开发依赖 CVE:开发依赖(mocha 相关)存在 9 个中高危 CVE,虽不影响生产但需关注
- 网络稳定性:无内置重试机制,弱网环境下可能失败
- 输入验证:建议添加长度限制防止异常输入导致资源消耗
- 凭证管理:环境变量方式虽安全,但需避免在共享环境泄露 shell 历史
- 功能单向性:仅支持添加,不支持删除、修改或浏览清单内容,需配合 Bring! App 使用
- 网络依赖:完全依赖 Bring! 官方 API,服务不可用时功能受限
- 无离线缓存:添加失败时无本地重试队列,需用户手动重试
- 平台限制:基于 Node.js 18+,Windows 原生支持需额外配置
- 规格解析边界:复杂描述可能被误判(如 "Red onions" 正确,"Red onions 3" 会被拆分)
适合的目标群体
- 效率型用户:习惯命令行工作流,希望减少手机操作的中重度用户
- 家庭采购协调员:需要快速批量录入家庭成员发来的采购清单
- 自动化爱好者:希望将购物清单管理整合到个人工作流的开发者
- Recipe-to-List 场景:从食谱提取食材后批量导入购物清单
使用风险
- 依赖版本风险:
bring-shopping 使用通配符版本,可能引入破坏性更新,建议锁定版本
- 开发依赖 CVE:开发依赖(mocha 相关)存在 9 个中高危 CVE,虽不影响生产但需关注
- 网络稳定性:无内置重试机制,弱网环境下可能失败
- 输入验证:建议添加长度限制防止异常输入导致资源消耗
- 凭证管理:环境变量方式虽安全,但需避免在共享环境泄露 shell 历史
- 依赖版本风险:
bring-shopping使用通配符版本,可能引入破坏性更新,建议锁定版本 - 开发依赖 CVE:开发依赖(mocha 相关)存在 9 个中高危 CVE,虽不影响生产但需关注
- 网络稳定性:无内置重试机制,弱网环境下可能失败
- 输入验证:建议添加长度限制防止异常输入导致资源消耗
- 凭证管理:环境变量方式虽安全,但需避免在共享环境泄露 shell 历史
技能正文
name: bring-add
description: Use when user wants to add items to Bring! shopping lists. For adding single items, batch items, or items from stdin/files. Supports dry-run preview and JSON output.
Bring! Add Items CLI
Overview
Overview
CLI for adding items to Bring! shopping lists. Supports quick single-item mode, batch mode, stdin/pipe input, and interactive mode.
When to Use
Use this skill when:
- User wants to add items to a Bring! shopping list
- Adding single item with optional specification (e.g., "Milk 1L")
- Adding multiple items at once (batch mode)
- Piping items from a file or other command
- Need to preview additions with dry-run
- Need JSON output for scripting
Don't use when:
- User wants to browse recipes (use bring-recipes instead)
- User wants to remove items from a list
- User wants to view current list contents
Quick Reference
Command
Purpose
bring-add "Item" "spec"
Add single item with specification
bring-add --batch "A, B 1L, C"
Add multiple comma-separated items
bring-add -
Read items from stdin
bring-add
Interactive mode (TTY only)
bring-add lists
Show available shopping lists
bring-add --dry-run ...
Preview without modifying
| Command | Purpose |
|---|---|
bring-add "Item" "spec" |
Add single item with specification |
bring-add --batch "A, B 1L, C" |
Add multiple comma-separated items |
bring-add - |
Read items from stdin |
bring-add |
Interactive mode (TTY only) |
bring-add lists |
Show available shopping lists |
bring-add --dry-run ... |
Preview without modifying |
Environment variables:
export BRING_EMAIL="your@email.com"
export BRING_PASSWORD="yourpassword"
export BRING_DEFAULT_LIST="Shopping" # optional
Installation
cd skills/bring-add
npm install
Common Workflows
cd skills/bring-add
npm install
Add a single item:
node index.js "Tomatoes" "500g"
node index.js "Milk"
Add to specific list:
node index.js --list "Party" "Chips" "3 bags"
Batch add multiple items:
node index.js --batch "Tomatoes 500g, Onions, Cheese 200g"
Pipe from file:
cat shopping-list.txt | node index.js -
echo -e "Milk 1L\nBread\nButter" | node index.js -
Preview before adding:
node index.js --dry-run --batch "Apples 1kg, Pears"
Get JSON output:
node index.js --json --batch "Milk, Bread" 2>/dev/null
List available lists:
node index.js lists
node index.js --json lists
Flags Reference
Flag
Description
-l, --list <name>
Target list (name or UUID)
-b, --batch <items>
Comma-separated items
-n, --dry-run
Preview without modifying
-q, --quiet
Suppress non-error output
-v, --verbose
Show detailed progress
--json
Output JSON to stdout
--no-color
Disable colored output
--no-input
Never prompt; fail if input required
Input Format
| Flag | Description |
|---|---|
-l, --list <name> |
Target list (name or UUID) |
-b, --batch <items> |
Comma-separated items |
-n, --dry-run |
Preview without modifying |
-q, --quiet |
Suppress non-error output |
-v, --verbose |
Show detailed progress |
--json |
Output JSON to stdout |
--no-color |
Disable colored output |
--no-input |
Never prompt; fail if input required |
Items follow the pattern: ItemName [Specification]
| Input | Item | Spec |
|---|---|---|
Tomatoes 500g |
Tomatoes | 500g |
Oat milk 1L |
Oat milk | 1L |
Red onions 3 |
Red onions | 3 |
Cheese |
Cheese | (empty) |
Rule: Last word becomes specification if it contains a number or unit (g, kg, L, ml, Stück, pck).
Exit Codes
Code
Meaning
0
Success
1
Generic failure (API error, network)
2
Invalid usage (bad args, missing input)
3
Authentication failed
4
List not found
130
Interrupted (Ctrl-C)
Common Mistakes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Generic failure (API error, network) |
2 |
Invalid usage (bad args, missing input) |
3 |
Authentication failed |
4 |
List not found |
130 |
Interrupted (Ctrl-C) |
Forgetting environment variables:
Set BRING_EMAIL and BRING_PASSWORD before running.
Wrong list name:
Use bring-add lists to see available lists and their exact names.
Specification parsing: The last word is treated as specification only if it looks like a quantity. "Red onions" stays as one item, but "Red onions 3" splits into item "Red onions" with spec "3".
Interactive mode in scripts:
Use --no-input flag in scripts to fail explicitly rather than hang waiting for input.
Implementation Notes
- Uses
node-bring-api with batchUpdateList() API
- Requires Node.js 18.0.0+
- Outputs data to stdout, progress/errors to stderr
- JSON mode available for automation
- Interactive mode only when stdin is a TTY
node-bring-api with batchUpdateList() API正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。