Improving CLI
Welcome to the nanoservice-ts
CLI contribution guide! This document outlines the best practices for contributing to the CLI, ensuring consistency, usability, and maintainability.
Overview
The CLI (@nanoservice-ts/cli
) is a core tool for managing workflows, nodes, and deployments. Contributions should focus on:
✅ Enhancing Developer Experience – Commands should be intuitive and efficient.
✅ Maintaining Consistency – Follow existing patterns and structures.
✅ Ensuring Robustness – Proper error handling, validations, and tests are mandatory.
Getting Started
1. Setup the Development Environment
Clone the repository and navigate to the CLI package:
2. CLI Structure
The CLI follows a modular command structure:
Adding a New CLI Command
All commands should be placed inside /src/commands/
and registered in index.ts
.
Coding Guidelines
1. Naming Conventions
- Commands should use kebab-case (e.g.,
deploy-workflow
,init-project
). - Functions should use camelCase (e.g.,
fetchNodes()
). - Files should use PascalCase.ts (e.g.,
ListNodes.ts
).
2. Command Structure
Each command should include:
✅ A clear description (.description()
).
✅ Error handling using try/catch
.
✅ Logging (logSuccess()
, logError()
).
✅ Async execution (await
where necessary).
3. Logging & Feedback
Use consistent logging to improve UX:
Submitting a Pull Request
1. Open a New Branch
Follow branch naming conventions:
2. Ensure Code Quality
Run linting and formatting checks:
3. Submit a PR
- Provide a clear description of the change.
- Reference any related issues.
- Request a review from maintainers before merging.
Final Notes
Contributing to the nanoservice-ts
CLI means helping developers build and deploy faster with nanoservices. We value clean, well-documented, and intuitive CLI tools. If you have any questions, feel free to open an issue! 🚀