Command reference
Every sorai command, with its flags and the key permissions it needs.
Every command below takes --profile <name> to pick a saved login. Output is JSON on stdout.
General
sorai login: Sign in with a secret key (ssk_...) from the API keys page of your Sorai console.sorai logout: Forget the saved key on this machine.sorai auth status: Show the signed-in key: its name, prefix, scopes and stores, the default store, and whether it came from the saved login orSORAI_API_KEY.sorai whoami: Show the key's name, scopes and stores, and the API it acts on.sorai guide: Print a Markdown guide to every command and flag, for AI agents.sorai version: Print the version of sorai.
stores
sorai stores list: List the stores this key's organization runs, with each store's id, slug, name, currency and status.sorai stores get: Get one store's settings: theme, notifications, enabled payment methods and tracking pixels.
products
sorai products list: List a store's products, newest first, with the total for paging.sorai products get: Get one product: its fields, selling content and fulfilment settings.sorai products create: Create a product.sorai products files: List the files buyers get from a product, with each one's status.sorai products delete-file: Remove a file from a product.sorai products update: Change some of a product's fields.sorai products archive: Take a product off sale.sorai products upload-file: Upload a file buyers get after paying, such as an ebook or a zip, to a product.
prices
sorai prices list: List a product's prices.sorai prices create: Add a price to a product.sorai prices update: Change some of a price's fields.sorai prices delete: Remove a price from a product.
media
sorai media list: List a store's uploaded images, newest first.sorai media upload: Upload an image (JPEG, PNG, WebP or GIF, up to 20 MB) to the store's media library.
courses
sorai courses get: Get a course product's sections and lessons in order, with each lesson's file status.sorai courses add-section: Add a section to the end of a course.sorai courses rename-section: Change a section's title.sorai courses delete-section: Delete a section and every lesson in it.sorai courses add-lesson: Add a lesson to the end of a section.sorai courses update-lesson: Change some of a lesson's fields, such as published.sorai courses delete-lesson: Delete a lesson.
bundles
sorai bundles list: List the products inside a bundle.sorai bundles add: Put a product from the same store into a bundle.sorai bundles update: Change a component's quantity or position.sorai bundles remove: Take a product out of a bundle.
orders
sorai orders list: List a store's orders, newest first, with the total for paging.sorai orders get: Get one order, with the buyer, attribution and payment detail.
checkout
sorai checkout create: Open a checkout link for one price of an active product, to send to a buyer.
pages
sorai pages list: List a store's pages with their slug, kind and publish state.sorai pages get: Get one page: its slug, kind, SEO metadata and header and footer setting.sorai pages update: Change a page's slug, kind, SEO metadata or header and footer setting.sorai pages create: Create a page as an unpublished draft with no content yet.
analytics
sorai analytics overview: Revenue by currency, orders, visitors, and the view, checkout and purchase funnel for a date range.

