Repository navigation
Add shop management commands - #14
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🟡 Changes recommended
Coupon discount validation allows negative, null, array, and percentage values above 100 to be sent unchanged to the API during both creation and updates.
1 open issue
What changed in this PR
Adds a dedicated halo shop command area for Halo Pro/Commercial ecommerce management, using a command-local Axios client for APIs unavailable in the published SDK.
Changes:
- Adds product, category, order, customer, coupon, discount, statistics, and configuration commands.
- Introduces input validation, mutation confirmations, output formatting, and safer product updates.
- Adds completion, tests, and documentation, and rejects anonymous login sessions.
Tests, builds, and linters were not rerun because the review environment has no installed project dependencies.
| File | Description |
|---|---|
| src/utils/errors.ts | Prioritizes API error details. |
| src/utils/confirmation.ts | Requires explicit boolean force confirmation. |
| src/utils/completion.ts | Adds shop commands and flags. |
| src/utils/__test__/completion.spec.ts | Tests shop completion candidates. |
| src/commands/shop/types.ts | Defines ecommerce resource and request types. |
| src/commands/shop/stats.ts | Adds daily statistics commands. |
| src/commands/shop/product.ts | Adds product management and update safeguards. |
| src/commands/shop/order.ts | Adds order management and fulfillment. |
| src/commands/shop/input.ts | Adds JSON input and validation helpers. |
| src/commands/shop/index.ts | Routes shop commands and reports API availability. |
| src/commands/shop/format.ts | Formats shop tables, details, and JSON output. |
| src/commands/shop/discount.ts | Adds discount management. |
| src/commands/shop/customer.ts | Adds customer updates, addresses, and entitlements. |
| src/commands/shop/coupon.ts | Adds coupon management and distribution. |
| src/commands/shop/config.ts | Adds shop configuration commands. |
| src/commands/shop/cli.ts | Preserves option values and normalizes boolean flags. |
| src/commands/shop/category.ts | Adds category management and tree listing. |
| src/commands/shop/api.ts | Wraps ecommerce Console API requests. |
| src/commands/shop/__test__/input.spec.ts | Tests input parsing and validation. |
| src/commands/shop/__test__/format.spec.ts | Tests shop output formatting. |
| src/commands/shop/__test__/cli.spec.ts | Tests option normalization and preservation. |
| src/commands/auth/index.ts | Rejects anonymous authentication responses. |
| src/commands/auth/__test__/auth-entry.spec.ts | Tests anonymous login rejection. |
| src/cli.ts | Registers and dispatches shop commands. |
| skills/README.md | Lists the shop skill. |
| skills/halo-cli/SKILL.md | Adds shop skill routing. |
| skills/halo-cli-shop/SKILL.md | Documents shop workflows, payloads, and safety. |
| skills/halo-cli-shared/SKILL.md | Adds shared shop command references. |
| README.zh-CN.md | Lists shop commands and skills in Chinese documentation. |
| README.md | Lists shop commands and skills. |
| AGENTS.md | Documents the shop area and API integration. |
Review effort: Balanced
- Add a read-only shop diagnostic command with capability, permission, and configuration reporting - Validate coupon discount values and percentage limits - Merge config group updates instead of replacing the whole group - Require confirmation when removing variants from published products - Add tests, completion entries, and skill documentation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b51ecaf442
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The specifications endpoint archives omitted variants regardless of product status, so detect removals for draft and archived products too.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

Summary
Add a new
halo shopcommand area for managing Halo Pro/Commercial ecommerce resources through the Console API groupconsole.api.ecommerce.halo.run/v1alpha1.The command area covers:
The published
@halo-dev/api-clientpackage does not expose the ecommerce Console API, so shop requests use a command-local axios client insrc/commands/shop/api.ts.Implementation notes
halo shopsub-CLI following the existing command-area architecture.--forcein non-interactive use.auth logininstead of persisting a broken profile.Compatibility
Shop commands require Halo Pro or Halo Commercial with the ecommerce feature enabled.
halo shop statusreports when the shop API is unavailable.Validation
pnpm typecheckvp test— 534 tests passedvp run buildvp check --fix src/commands/shop