Contributing to CLI Template
Thank you for your interest in contributing to CLI Template! This document provides guidelines and instructions to help you contribute effectively to this project.
Development Setup
Fork and clone the repository
bashgit clone https://github.com/your-username/cli-template.git cd cli-template
Install dependencies
bashpnpm install
Link the CLI locally
bashpnpm link --global
Run in development mode
bashcli-template interactive
Project Structure
cli-template/
├── src/
│ ├── commands/ # CLI commands implementation
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ └── index.ts # Main entry point
├── tests/ # Test files
├── docs/ # Documentation
└── package.json # Project configuration
Coding Standards
- Follow the existing code style and formatting
- Use TypeScript for all new code
- Write clear, descriptive comments
- Include proper error handling
- Follow the best practices outlined in our Best Practices guide
Commit Guidelines
We follow the Conventional Commits specification. This means all commit messages should be structured as follows:
<type>[optional scope]: <description>
Common Types
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.; no code change)
- refactor: Code refactoring (no feature change, no bug fix)
- perf: Performance improvements
- test: Adding or updating tests
- chore: Maintenance tasks, dependencies updates, etc.
Examples
feat(commands): add new build command
fix: resolve interactive mode error
docs: update installation instructions
Using Commitizen
To make it easier to follow this format, you can use Commitizen:
pnpm commit
This will guide you through creating a properly formatted commit message.
Pull Request Process
Create a new branch for your feature or bug fix
bashgit checkout -b feature/your-feature-name
Make your changes and commit them using the conventional commits format
Run tests to ensure your changes don't break existing functionality
bashpnpm test
Push your branch to your fork
bashgit push origin feature/your-feature-name
Create a Pull Request against the
main
branch of the original repository
Pull Request Guidelines
When opening a pull request, please:
- Use a clear, descriptive title following the Conventional Commits format
- Reference any related issues using the GitHub issue number
- Fill out the pull request template completely
- Keep your PR focused on a single topic to streamline the review process
- Be responsive to feedback and questions
Types of Contributions
Bug Fixes
- Clearly describe the bug in the pull request description
- Include steps to reproduce the bug
- Explain how your solution fixes the issue
New Features
- Discuss major new features in an issue before implementing
- Include tests for new functionality
- Update documentation to reflect new features
Documentation
- Ensure documentation is clear, accurate, and comprehensive
- Check for spelling and grammar errors
- Follow the existing documentation style
Testing
- Write tests for all new features and bug fixes
- Run the existing test suite before submitting a pull request
- Aim for high test coverage for critical code paths
pnpm test # Run all tests
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Check test coverage
Code Review Process
- All submissions require review
- Maintainers will review your PR as soon as possible
- Address all feedback and requested changes
- Your PR must pass CI checks before it can be merged
License
By contributing to CLI Template, you agree that your contributions will be licensed under the project's MIT License.
Questions?
If you have any questions about contributing, feel free to open an issue or reach out to the maintainers.
Thank you for contributing to CLI Template!