# glm-coding-sniper **Repository Path**: Darchrow-Mu/glm-coding-sniper ## Basic Information - **Project Name**: glm-coding-sniper - **Description**: 智谱 AI GLM Coding Plan 自动抢购工具 - API探活+UI双路径竞速,macOS/微信双通知 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2026-06-16 - **Last Updated**: 2026-06-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # glm-coding-sniper 智谱 AI GLM Coding Plan 抢购工具。API 探活 + UI 点击双路径竞速,macOS / 微信双通知。 ## 前置条件 1. **Chrome debug 模式**: 启动 Chrome 时加 `--remote-debugging-port=9222` 2. **Chrome 已登录 bigmodel.cn**: 在 debug 模式的 Chrome 中登录一次 3. **Go 1.21+**: 编译用 (需要 CGO 读取 Chrome Cookie) ## 安装 ```bash make install ``` ## 配置 ```bash mkdir -p ~/.sniper cp conf/glm-coding-sniper.yaml ~/.sniper/glm-coding-sniper.yaml # 编辑 ~/.sniper/glm-coding-sniper.yaml,填入微信 ilink user ID ``` ## 使用 ### 设置定时抢购 ```bash glm-coding-sniper install --plan Pro --period QUARTERLY ``` 自动解析页面上的补货时间,生成 macOS launchd 定时任务。 ### 手动运行一次 ```bash glm-coding-sniper --plan Pro --period QUARTERLY ``` ### 演练模式(不下单) ```bash glm-coding-sniper --dry-run ``` ### 取消定时 ```bash glm-coding-sniper uninstall ``` ## 工作原理 1. `install` 从页面解析补货时间,设置 launchd 在补货前 35s 触发 2. 到点后脚本启动,等待到补货前 30s 开始工作 3. **API 探活**: 不规律间隔轮询 pricing API,检测 `canRepurchase` 4. **UI 下单**: chromedp CDP attach 监控按钮 disabled 状态,启用后立即点击 5. 任一路径成功 → macOS 弹窗 + 微信消息通知支付 ## 文件 | 路径 | 说明 | |------|------| | `~/.sniper/glm-coding-sniper.yaml` | 用户配置 | | `~/Library/LaunchAgents/com.darchrow.glm-coding-sniper.plist` | launchd 任务 | | `/tmp/glm-coding-sniper.log` | 运行日志 |