@jackemcpherson/bhs-cli
v2.2.3
Published
CLI for Blackhearts & Sparrows product search, stock checking, and cart management
Readme
bhs
CLI for searching Blackhearts & Sparrows products, checking stock, and managing a cart.
Install
npm install -g @jackemcpherson/bhs-cliRequires Node.js 20+.
Commands
Search
bhs search pinot noir
bhs search --type Wine --country France --region Burgundy
bhs search --varietal Grenache --price-max 35 --in-stock
bhs search --body Medium --drinkability Guzzle --sort price:asc
bhs search --farming Organic --dietary Vegan --limit 50Flags: --type, --country (-c), --region, --varietal, --price-min, --price-max, --body, --drinkability, --farming, --dietary, --collection, --in-stock, --package (-p), --sort, --filter, --limit (-l), --page, --store (-s), --json (-j)
Product
bhs product 44253
bhs product 44253 --jsonStores
bhs storesFacets
bhs facets # list all facet names
bhs facets region_lvl0 # show countries with product counts
bhs facets drinkability.name # show drinkability valuesConfig
bhs config # show current config
bhs config --store Fitzroy # set default storeCart
Server-side cart with automatic discount calculation.
bhs cart add 44253 # add 1x product
bhs cart add 29920 --qty 6 # add 6x (triggers 10% wine discount)
bhs cart list # show cart with discounts
bhs cart remove 29920 # remove product
bhs cart checkout # open in browser for payment
bhs cart clear # empty the cartOutput
Table output by default when connected to a terminal. Pipe or use --json for JSON:
bhs search --type Wine --json | jq '.[].name'
bhs cart list --jsonLibrary
The package also exports typed API functions for programmatic use:
import { searchProducts, buildFilter, fetchStores } from "@jackemcpherson/bhs-cli";
import {
createCheckout,
addLineItems,
getCheckout,
} from "@jackemcpherson/bhs-cli";License
MIT
