Costco Inventory Monitor
Goal
Provide a repeatable workflow to check Costco inventory for one or more products across multiple ZIP codes, then write a report for downstream channels (for example WeCom).
Repository Safety Rules
- - The
skills/costco-inventory-monitor directory must contain scripts, templates, and docs only. - Never store real AK/SK, tokens, passwords, or proxy credentials inside
skills/. - Real runtime secrets must be stored in
/root/.openclaw/workspace/.secrets/costco-monitor.env. - INLINECODE3 must stay in
.gitignore and should not be committed.
Files
- - Runner: INLINECODE5
- Inventory checker: INLINECODE6
- Config template (safe to commit): INLINECODE7
- Standard reference: INLINECODE8
Runtime Setup
- 1. Create the real secret config from template:
CODEBLOCK0
- 2. Edit
/root/.openclaw/workspace/.secrets/costco-monitor.env and fill real values:
- -
PRODUCT_1, PRODUCT_2, ... - INLINECODE12
- INLINECODE13
- output paths (
OUTPUT_JSONL, STATE_FILE, REPORT_FILE, LOG_FILE)
- 3. Run once to validate:
CODEBLOCK1
OpenClaw Cron (every 5 minutes)
Use OpenClaw cron, not system crontab, for this skill.
CODEBLOCK2
Existing production job id (created): 29515da3-2b5b-491b-b516-69875b4376a6.
Example Products and ZIPs
- - Product: INLINECODE19
- ZIPs:
03051, INLINECODE21
Output Locations
- - Report: INLINECODE22
- Log: INLINECODE23
- Snapshot JSONL: INLINECODE24
- State: INLINECODE25
GitHub Checklist
- - Commit:
skills/costco-inventory-monitor/** and optional ops wrapper scripts. - Do not commit:
/root/.openclaw/workspace/.secrets/**, real proxy/account credentials, runtime logs, local state files.
Costco 库存监控器
目标
提供一个可重复执行的工作流程,用于检查多个邮政编码区域内一个或多个产品的 Costco 库存情况,然后为下游渠道(例如企业微信)生成报告。
仓库安全规则
- - skills/costco-inventory-monitor 目录只能包含脚本、模板和文档。
- 切勿在 skills/ 目录内存储真实的 AK/SK、令牌、密码或代理凭证。
- 运行时真实密钥必须存储在 /root/.openclaw/workspace/.secrets/costco-monitor.env 中。
- .secrets/ 必须保留在 .gitignore 中,且不应被提交。
文件
- - 运行器:scripts/runmonitor.sh
- 库存检查器:scripts/checkcostco_inventory.py
- 配置模板(可安全提交):config/monitor.env.example
- 标准参考:references/costco-inventory-standard.md
运行时设置
- 1. 根据模板创建真实密钥配置:
bash
mkdir -p /root/.openclaw/workspace/.secrets
cp /root/.openclaw/workspace/skills/costco-inventory-monitor/config/monitor.env.example /root/.openclaw/workspace/.secrets/costco-monitor.env
chmod 600 /root/.openclaw/workspace/.secrets/costco-monitor.env
- 2. 编辑 /root/.openclaw/workspace/.secrets/costco-monitor.env 并填写真实值:
- - PRODUCT1、PRODUCT2、...
- ZIPCODES
- PROXYURL
- 输出路径(OUTPUTJSONL、STATEFILE、REPORTFILE、LOGFILE)
- 3. 运行一次以验证:
bash
/root/.openclaw/workspace/skills/costco-inventory-monitor/scripts/run_monitor.sh
OpenClaw 定时任务(每 5 分钟)
此技能使用 OpenClaw 定时任务,而非系统 crontab。
bash
openclaw cron create \
--name costco-inventory-monitor-5m \
--every 5m \
--session isolated \
--model hunyuan/hunyuan-t1-latest \
--delivery none \
--message 运行 /root/.openclaw/workspace/skills/costco-inventory-monitor/scripts/runmonitor.sh,然后仅返回 /root/.openclaw/workspace/ops/costco-monitor/latestreport.txt 的内容。
现有生产任务 ID(已创建):29515da3-2b5b-491b-b516-69875b4376a6。
示例产品和邮政编码
- - 产品:4000362984|TCL 55 Q77K|https://www.costco.com/p/-/tcl-55-class-q77k-series-4k-uhd-qled-smart-tv-allstate-3-year-protection-plan-bundle-included-for-5-years-of-total-coverage/4000362984?langId=-1
- 邮政编码:03051、97230
输出位置
- - 报告:/root/.openclaw/workspace/ops/costco-monitor/latest_report.txt
- 日志:/root/.openclaw/workspace/ops/costco-monitor/monitor.log
- 快照 JSONL:/root/.openclaw/workspace/ops/costco-monitor/snapshots.jsonl
- 状态:/root/.openclaw/workspace/ops/costco-monitor/state.json
GitHub 检查清单
- - 提交:skills/costco-inventory-monitor/ 和可选的 ops 包装脚本。
- 不提交:/root/.openclaw/workspace/.secrets/、真实的代理/账户凭证、运行时日志、本地状态文件。