---
name: zone-cli
description: Use this skill to operate, troubleshoot, and automate the mere.zone CLI, including browser auth, store admin settings, product upserts, inventory adjustments, order fulfillment/refunds, workspace provisioning/sync, storefront commands, and workspace order lookups.
---

# Zone CLI

Use this skill for requests that operate `mere-zone`/`merezone` from `/Users/nerd/mere/zone`.

## Quick Start

1. Work from the repo root:
   - `cd /Users/nerd/mere/zone`
2. Build the CLI:
   - `pnpm build:cli`
3. Inspect commands:
   - `./dist/run.js --help`
4. Authenticate for admin commands:
   - `./dist/run.js auth login`
   - `./dist/run.js auth whoami`
5. Prefer `--json` for automation.
6. Use `completion [bash|zsh|fish]` for shell setup.
7. Use `--yes` for fulfillments and negative stock adjustments; use `--yes --confirm <exact-id>` for refunds and disconnects.

Session file:

- `~/.local/state/mere-zone/session.json`

## Command Families

- `auth login|whoami|logout`
- `workspace list|current|use`
- `store list|show`
- `products list|show`
- `product upsert --store <storeId> --data-file product.json`
- `collections list --store <storeId>`
- `settings update --store <storeId>`
- `inventory adjust --store <storeId> --variant <variantId> --quantity-delta <n>`
- `orders list|show`
- `order fulfill <orderId>`
- `order refund <orderId>`
- `customers list --store <storeId>`
- `stripe status --store <storeId>`
- `checkout create --slug <storeSlug> --data|--data-file`
- `completion [bash|zsh|fish]`
- `workspace provision|sync|bootstrap|disconnect`
- `workspace command --workspace <workspaceId> <command>`
- `workspace order --workspace <workspaceId> <orderNumber>`

Admin commands use the shared CLI session or `MERE_ZONE_TOKEN`. Workspace automation commands use `MERE_ZONE_INTERNAL_TOKEN`, `MEREZONE_INTERNAL_TOKEN`, `INTERNAL_SERVICE_TOKEN`, or `--token`.

## References

- `/Users/nerd/mere/zone/cli/README.md`
- `/Users/nerd/mere/zone/skills/zone-cli/references/command-reference.md`

## Safe Edit Boundaries

- CLI: `/Users/nerd/mere/zone/cli/*`
- CLI auth routes: `/Users/nerd/mere/zone/src/routes/api/cli/v1/auth/*`
- CLI auth helper: `/Users/nerd/mere/zone/src/lib/server/cli-auth.ts`
- Workspace automation routes: `/Users/nerd/mere/zone/src/routes/api/internal/mere/*`
