CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Square CLI

$ square 官方出品 高风险
Square · 办公协作与 SaaS · Proprietary (Square Developer Terms) · macos / linux / windows

Square CLI(square)为开发者与编程 Agent 提供目录、订单、支付、库存和客户 API 的终端访问能力。专为 LLM 自发现而设计,支持通过 square --llms --format json 导出完整命令清单,并在任意子命令上通过 --schema 输出 JSON Schema。

FCRS-1.0 综合评分
89 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
npm install -g @square/cli
CLI vs MCP 选型建议 CLI + MCP 搭配

square 可在本地直接提供 --llms 与 --schema 自省并执行可脚本化的商业 API 调用;若是托管的远程 OAuth 助手会话则更适合使用 Square MCP。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 24 / 25

原生支持 --llms、单命令 --schema 与 --format json,对 Agent 极度友好。

  • square --llms --format json exports machine-readable command manifests
  • Every subcommand supports --schema introspection
安全与权限边界 21 / 25

Sandbox 与 Production 配置隔离清晰,但生产环境命令会直接修改商户数据或触发资金交易。

  • Supports Sandbox isolation and explicit --schema validation
安装与运行摩擦 13 / 15

可通过 npm install -g @square/cli、npx -y @square/cli 及 GitHub 预编译二进制跨平台安装。

  • Cross-platform binaries and npm/npx distribution
能力覆盖与边际价值 13 / 15

无需编写 SDK 样板代码即可覆盖 Square 全套商业 API。

  • Maps catalog, orders, payments, inventory, and locations directly to CLI verbs
维护与来源背书 9 / 10

Square 官方维护(square/cli),但采用专有 Square Developer Terms 而非开源许可证。

  • Published and maintained directly by Square (square about)
文档与可验证性 9 / 10

除了 Square 开发者文档外,还可通过 --schema 与 --llms 实时自验证。

  • Built-in --schema and --llms outputs match live CLI behavior

安全边界、鉴权与放权指南

鉴权方式
环境变量密钥 浏览器 OAuth 本地配置文件
凭证存储位置

将 Sandbox 与 Production 配置文件令牌保存在本地 ~/.square/ 目录中,也支持通过环境变量或命令行参数传入访问令牌。

潜在副作用
只读查询 远端写入 计费影响
费用与配额提示

CLI 按 Square Developer Terms 免费提供;真实生产收款会产生 Square 标准交易手续费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Square CLI (square) Agent Rules
- Run `square --llms --format json` and `<cmd> --schema` instead of guessing API flags.
- Target Sandbox credentials before testing payments, refunds, or order mutations.
- Never execute live production charges or refunds without explicit human confirmation.

Agent 高频安全命令配方

只读查询(安全推荐)

导出面向 LLM 的命令清单
square --llms --format json

以结构化 JSON 输出完整 Square CLI 命令树与说明,供 Agent 规划调用。

查看子命令的 JSON Schema
square catalog list --schema

在调用 Square API 前先输出该命令精确的参数、标志与载荷 JSON Schema。

受控写入与预演

查询 Square 沙盒门店列表
square locations list --format json

以机器可读的 JSON 格式获取当前配置文件下的商户门店信息。

核心优势

  • + 内置 --llms 与 --schema 让 Agent 无需猜测即可获取精确参数契约。
  • + 支持 --format json 清洁输出及 npx -y @square/cli 零配置运行。

注意事项与踩坑点

  • ! 属于受 Square Developer Terms 约束的专有软件,非 OSI 开源协议。
  • ! 若未严格限定 Sandbox 凭据,生产令牌可直接发起真实扣款、退款或商品变更。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI