poke-ordering

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Poke Co Ordering CLI

The Poke Co 订单CLI工具

CLI for browsing menus and placing orders at The Poke Co (South Africa). All output is JSON. Requires Node.js.
这是一款用于浏览南非The Poke Co菜单并下单的CLI工具。所有输出均为JSON格式。需要依赖Node.js环境。

Commands

命令

Run via
node scripts/poke-cli.js <command>
.
CommandFlagsOutput
locations
All locations with open/closed status
hours --location <name>
--location
(partial match)
{ name, is_open, kitchen_status, can_collection, can_delivery }
categories --location <name>
--location
[{ category, item_count }]
search --location <name> --query <text>
--location
,
--query
, optional
--category
Matching items with prices, types, deal groups
menu --location <name>
--location
Full menu dump (large — prefer
search
)
order --from <file | ->
--from
Order confirmation with payment URL
byo --location <name> --size <regular|maxi> ...
see belowBuild Your Own bowl builder
byo-options --location <name>
--location
All BYO ingredient options for a location
通过
node scripts/poke-cli.js <command>
运行。
命令参数输出
locations
所有门店及其营业/打烊状态
hours --location <name>
--location
(支持部分匹配)
{ name, is_open, kitchen_status, can_collection, can_delivery }
categories --location <name>
--location
[{ category, item_count }]
search --location <name> --query <text>
--location
,
--query
, 可选
--category
匹配的商品及其价格、类型、套餐组
menu --location <name>
--location
完整菜单导出(内容较多 — 推荐使用
search
命令)
order --from <file | ->
--from
订单确认信息及支付链接
byo --location <name> --size <regular|maxi> ...
见下文自定义碗(Build Your Own)构建工具
byo-options --location <name>
--location
指定门店的所有自定义碗配料选项

Workflow

操作流程

  1. Find location:
    node scripts/poke-cli.js locations
    — pick one by name
  2. Check hours:
    node scripts/poke-cli.js hours --location "Kloof"
    — confirm
    is_open: true
  3. Search items:
    node scripts/poke-cli.js search --location "Kloof" --query "salmon"
    — find what to order
  4. Place order: pipe JSON to
    node scripts/poke-cli.js order --from -
  1. 查找门店
    node scripts/poke-cli.js locations
    — 根据名称选择一家门店
  2. 查看营业时间
    node scripts/poke-cli.js hours --location "Kloof"
    — 确认
    is_open: true
  3. 搜索商品
    node scripts/poke-cli.js search --location "Kloof" --query "salmon"
    — 找到想要下单的商品
  4. 下单:将JSON内容通过管道传递给
    node scripts/poke-cli.js order --from -

BYO Workflow

自定义碗操作流程

  1. Find location:
    node scripts/poke-cli.js locations
  2. Check hours:
    node scripts/poke-cli.js hours --location "Kloof"
  3. Get options:
    node scripts/poke-cli.js byo-options --location "Kloof"
    — shows all available bases, proteins, toppings, sauces, crunches, extras with prices for both regular and maxi
  4. Build bowl:
    node scripts/poke-cli.js byo --location Kloof --size regular --base ... --protein ... --topping ... --sauce ... --crunch ...
Always run
byo-options
first to see what ingredients are available before building a bowl.
  1. 查找门店
    node scripts/poke-cli.js locations
  2. 查看营业时间
    node scripts/poke-cli.js hours --location "Kloof"
  3. 获取配料选项
    node scripts/poke-cli.js byo-options --location "Kloof"
    — 展示常规款和大份装可用的所有基底、蛋白质、配料、酱料、脆顶、附加食材及其价格
  4. 制作碗品
    node scripts/poke-cli.js byo --location Kloof --size regular --base ... --protein ... --topping ... --sauce ... --crunch ...
在制作自定义碗之前,请务必先运行
byo-options
命令查看可用的配料。

Order JSON Format

订单JSON格式

json
{
  "location": "Kloof St",
  "mobile": "+27XXXXXXXXX",
  "order_type": "collection",
  "time": "asap",
  "items": [
    { "name": "Miso Soup", "quantity": 1 },
    {
      "name": "Build Your Own",
      "quantity": 1,
      "instructions": "Extra sauce",
      "choices": {
        "Choose Your Base": ["White Sushi Rice"],
        "Choose Your Protein": ["Salmon"]
      }
    }
  ]
}
json
{
  "location": "Kloof St",
  "mobile": "+27XXXXXXXXX",
  "order_type": "collection",
  "time": "asap",
  "items": [
    { "name": "Miso Soup", "quantity": 1 },
    {
      "name": "Build Your Own",
      "quantity": 1,
      "instructions": "Extra sauce",
      "choices": {
        "Choose Your Base": ["White Sushi Rice"],
        "Choose Your Protein": ["Salmon"]
      }
    }
  ]
}

Build Your Own (BYO) Command

自定义碗(Build Your Own,BYO)命令

The
byo
command provides a typed CLI for building custom bowls without needing to know the raw deal group structure.
Required flags:
  • --location <name>
    — location (partial match)
  • --size <regular|maxi>
    — bowl size (R83 regular, R99 maxi)
  • --base <name>
    — 1-2 bases (repeat flag for split base, or "none")
  • --protein <name>
    — 1 protein (or "none")
  • --topping <name>
    — 1-4 toppings (repeat flag)
  • --sauce <name>
    — 1-2 sauces (repeat flag), or "none" for no sauce
  • --crunch <name>
    — 1 crunch (or "none")
Optional flags:
  • --extra <name>
    — paid extras, up to 2 (repeat flag)
  • --extra-protein <name>
    — extra protein
  • --extra-sauce <name>
    — extra sauce (paid, repeat flag)
  • --remove <name>
    — remove defaults
  • --side <name>
    — add a side
  • --drink <name>
    — add a drink
  • --json
    — output order-ready JSON item (for piping into
    order
    )
Example:
bash
node scripts/poke-cli.js byo --location Kloof --size regular \
  --base "sticky rice" --protein salmon \
  --topping mango --topping cucumber --topping edamame --topping radish \
  --sauce "house shoyu" --sauce "creamy togarashi" \
  --crunch "cashew nuts"
Discover options: Use
byo-options --location <name>
to see all available ingredients with prices.
byo
命令提供了一个类型化的CLI,无需了解原始套餐组结构即可构建自定义碗品。
必填参数:
  • --location <name>
    — 门店名称(支持部分匹配)
  • --size <regular|maxi>
    — 碗品尺寸(常规款83兰特,大份装99兰特)
  • --base <name>
    — 1-2种基底(重复参数可选择双拼基底,或输入"none")
  • --protein <name>
    — 1种蛋白质(或输入"none")
  • --topping <name>
    — 1-4种配料(重复参数添加多种)
  • --sauce <name>
    — 1-2种酱料(重复参数添加多种),或输入"none"选择无酱料
  • --crunch <name>
    — 1种脆顶(或输入"none")
可选参数:
  • --extra <name>
    — 付费附加食材,最多2种(重复参数添加多种)
  • --extra-protein <name>
    — 额外蛋白质
  • --extra-sauce <name>
    — 额外酱料(付费,重复参数添加多种)
  • --remove <name>
    — 移除默认配料
  • --side <name>
    — 添加配菜
  • --drink <name>
    — 添加饮品
  • --json
    — 输出可直接用于下单的JSON格式商品信息(可通过管道传递给
    order
    命令)
示例:
bash
node scripts/poke-cli.js byo --location Kloof --size regular \
  --base "sticky rice" --protein salmon \
  --topping mango --topping cucumber --topping edamame --topping radish \
  --sauce "house shoyu" --sauce "creamy togarashi" \
  --crunch "cashew nuts"
查看可用选项: 使用
byo-options --location <name>
命令查看所有可用配料及其价格。

Deal Items (generic)

套餐商品(通用)

When
search
returns an item with
deal_groups
, you must provide
choices
in the order:
  • Each key is a partial match on the group's
    description
  • Each value is an array of partial matches on option names
  • Check
    required
    and
    min
    /
    max
    to know which groups need selections
search
命令返回包含
deal_groups
的商品时,你必须提供
choices
字段,规则如下:
  • 每个键是对套餐组
    description
    的部分匹配
  • 每个值是对选项名称的部分匹配数组
  • 查看
    required
    min
    /
    max
    字段了解哪些套餐组需要选择

Authentication

身份验证

Ensure
POKE_TOKEN=<token>
is set
请确保已设置环境变量
POKE_TOKEN=<token>

Errors

错误处理

All errors return
{ "error": "..." }
to stderr with exit code 1.
ErrorFix
No location matching "X"Check
locations
output for exact names
Not currently accepting orders
is_open
is false — try another location or wait
No menu item matching "X"Broaden search query or check
categories
first
Deal requires "choices"Use
search
to see
deal_groups
, then provide
choices
所有错误都会向stderr返回
{ "error": "..." }
,并以退出码1结束程序。
错误解决方法
没有匹配“X”的门店查看
locations
命令的输出获取准确名称
当前不接受订单
is_open
为false — 尝试其他门店或稍后再试
没有匹配“X”的菜单商品扩大搜索范围或先查看
categories
命令的结果
套餐需要“choices”字段使用
search
命令查看
deal_groups
,然后提供对应的
choices

Tips

小贴士

  • Prefer
    search
    over
    menu
    — menu dumps 80+ items; search returns only matches
  • Partial matching everywhere — "kloof" matches "Kloof St", "salmon" matches "Salmon Sashimi"
  • Mobile format — use international format:
    +27XXXXXXXXX
  • Filter by category
    search --location Kloof --query rice --category sides
  • 优先使用
    search
    而非
    menu
    menu
    命令会导出80+个商品;
    search
    仅返回匹配结果
  • 全平台支持部分匹配 — “kloof”会匹配“Kloof St”,“salmon”会匹配“Salmon Sashimi”
  • 手机号格式 — 使用国际格式:
    +27XXXXXXXXX
  • 按分类筛选
    search --location Kloof --query rice --category sides