-
Notifications
You must be signed in to change notification settings - Fork 28
Common Flows
ohadedry edited this page Oct 22, 2025
·
2 revisions
Before starting implementation, review your new command's design with the Fabric CLI team through the relevant issue or task. Clearly describe the command's purpose, expected usage, and rationale to ensure alignment and avoid unnecessary rework.
When adding a new command:
- Follow naming conventions and code style used in the project.
- Add the command to the appropriate parser module under the
parsersfolder, or create a new module if needed. Fabric CLI uses Python argparse to parse command prompts; see the argparse documentation for details. - Implement the command handler in the relevant module under the
commandsfolder, reusing existing modules and functions where possible. - Decorate the handler with exception handling and context-setting decorators.
- Validate that the command is supported by the execution context before running its logic.
- Handle failures by raising
FabricCLIErrorwith clear, actionable messages. See the Error handling section for more details. - Support both text and JSON output formats using the output functions. Refer to the Output format section for guidelines.
- Provide usage examples and update documentation (e.g., help text and docs folder) to ensure users understand how to use the new command.
- Add tests for the new command, including edge cases and error scenarios. Refer to the E2E command tests section for guidelines.