用途:goplaces 是面向 Google Places API (New) 的现代命令行工具,用于地点查询,包括文本搜索、地点解析(resolve)、地点详情与评论获取。默认输出人类可读文本,加 --json 输出 JSON,便于脚本处理。
安装:Homebrew 执行 brew install steipete/tap/goplaces。
配置:必须设置环境变量 GOOGLE_PLACES_API_KEY;可选 GOOGLE_PLACES_BASE_URL,用于测试或代理。
主要命令:搜索 goplaces search "coffee" --open-now --min-rating 4 --limit 5;按位置偏好 goplaces search "pizza" --lat 40.8 --lng -73.9 --radius-m 3000;分页 goplaces search "pizza" --page-token "NEXT_PAGE_TOKEN";解析 goplaces resolve "Soho, London" --limit 5;详情 goplaces details <place_id> --reviews;JSON 输出 goplaces search "sushi" --json。
限制与说明:--no-color 或 NO_COLOR 可关闭 ANSI 颜色;价格等级为 0..4(免费到非常昂贵);类型过滤只发送第一个 --type 值,因为 API 只接受一个。其余功能、收费与平台支持资料暂未提供。