cli-command-development

Create and organize B2C CLI commands using oclif templates.

51|16|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill cli-command-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-command-development
Source: https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/.claude/skills/cli-command-development
Command: npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill cli-command-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating consistent, reusable patterns for adding new CLI commands and topics to the B2C CLI using oclif, reducing boilerplate and onboarding time.

Core Features & Use Cases

  • Command organization templates: maps topic and command structure to file paths under packages/b2c-cli/src/commands.
  • Base-class guidance: outlines suitable base classes (BaseCommand, OAuthCommand, InstanceCommand, etc.) and when to use them.
  • Example templates: provides example command skeletons and i18n usage to accelerate development.
  • Use Case: A developer adds a new feature topic and a corresponding command, following standard patterns, and publishes it with consistent documentation.

Quick Start

Create a new command file at packages/b2c-cli/src/commands/<topic>/<command>.ts, implement the command using the recommended base class, add necessary i18n keys, and update the skill page if applicable. Build and test with pnpm to verify the new topic.

Frequently Asked Questions about cli-command-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new oclif command for the B2C CLI?

To create an oclif command, add a TypeScript file at packages/b2c-cli/src/commands/<topic>/<command>.ts, implement the run() method using a standard base class, and define static properties. This structure ensures the command integrates correctly with the B2C CLI framework.

What base classes are available for B2C CLI command development?

Available base classes for B2C CLI command development include BaseCommand, OAuthCommand, and InstanceCommand. Selecting the appropriate base class provides built-in handling for standard authentication and instance-level operations required by your specific command.

How should I organize topics and file paths when developing CLI commands?

Organize CLI command topics by mapping the topic and command structure directly to file paths under packages/b2c-cli/src/commands. This standardized file organization ensures commands are automatically discovered and correctly routed by the oclif framework.

Does B2C CLI command development require internationalization?

Yes, CLI command development requires adding necessary i18n keys for user-facing strings. Integrating internationalization during command creation ensures the CLI output remains consistent and accessible across different locales.

How do I test a newly developed B2C CLI command topic?

Test a newly developed B2C CLI command topic by building and verifying the package using pnpm. Running pnpm ensures the TypeScript compiles correctly and the new topic structure integrates without breaking existing CLI functionality.