@fluid-app/fluid-cli-products
v0.1.229
Published
Fluid CLI plugin for catalog products — create a priced product from flags
Readme
@fluid-app/fluid-cli-products
Fluid CLI plugin for catalog products.
npm install -g @fluid-app/fluid-cli @fluid-app/fluid-cli-products
fluid login
fluid products create --title "Beet Powder" --price 29.99 --sku BEET-12 --yes
fluid products create --title "Beet Powder" --price 29.99 --country CA --publish --yescreate makes one product with one variant, priced in one country the
company sells in (--country, an ISO code; it defaults to the company's
only country, or else its default country). --price is in that country's
currency, with no more decimal places than the currency keeps (none for JPY,
three for KWD): Fluid rounds a price to those before saving it, so create
refuses a price it would change. The product stays a draft unless you pass
--publish.
--image-url sets the product's main image and its first gallery image. To
sell in a country the company doesn't have yet, open it first with
fluid countries open from @fluid-app/fluid-cli-localization.
Before creating, it looks for a product with exactly the same SKU (or,
without --sku, the same title, ignoring case). If one exists it prints
alreadyExists: true with that product and changes nothing. The check reads
the first 100 search hits, so it can miss a product created moments ago, or
one far down a long list of similar names. If product search isn't
answering, it creates nothing and says so, rather than risk a duplicate.
The signed-in account needs permission to view the company's countries as well as to edit products.
Every command prints JSON; failures print a JSON error on stderr and exit
non-zero. create changes live configuration, so it asks for confirmation
unless you pass --yes.
