Thank you for your interest in contributing to the SuperOps CLI! This document provides guidelines and instructions for contributing.
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and professional in all interactions.
- Node.js 20.0.0 or higher
- npm or yarn
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/superops-cli.git
cd superops-cli- Install dependencies:
npm install- Set up environment variables for testing:
export SUPEROPS_API_TOKEN="your-test-token"
export SUPEROPS_SUBDOMAIN="your-test-subdomain"
export SUPEROPS_REGION="us"- Build the project:
npm run build- Link for local testing:
npm link- Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name- Make your changes following our coding standards
- Test your changes thoroughly
- Commit your changes with clear, descriptive messages
- Follow the existing code style
- Use TypeScript for all new code
- Include type definitions for all functions and exports
- Add JSDoc comments for public APIs
- Keep functions focused and single-purpose
- Prioritize readability and maintainability over cleverness
- Enable strict mode
- Avoid
anytypes when possible - Use interfaces for object shapes
- Export types alongside implementations
Follow conventional commit format:
feat: add new featurefix: resolve bug in XYZdocs: update READMErefactor: improve code structuretest: add tests for XYZchore: update dependencies
Run tests before submitting:
npm testRun type checking:
npm run typecheckRun linting:
npm run lintBuild the project to ensure it compiles:
npm run build- Update the README.md with details of changes if applicable
- Update CHANGELOG.md following Keep a Changelog format
- Ensure all tests pass and linting is clean
- Push your branch to your fork
- Submit a Pull Request to the main repository
- Wait for review and address any feedback
- Keep PRs focused on a single feature or fix
- Include a clear description of the changes
- Reference any related issues
- Ensure CI/CD checks pass
- Respond to review comments promptly
When adding new commands:
- Create a new command file in
src/commands/ - Follow the existing command structure
- Support both JSON and table output formats
- Add appropriate options and filters
- Include error handling
- Update README.md with usage examples
- Update CHANGELOG.md
Example command structure:
import { Command } from 'commander';
import { createClient } from '../utils/client.js';
import { output, outputError } from '../utils/output.js';
export const yourCommand = new Command('resource')
.description('Manage resources');
yourCommand
.command('list')
.description('List resources')
.option('--format <format>', 'Output format (json|table)', 'json')
.action(async (options) => {
try {
const client = createClient();
const result = await client.resources.list();
output(result, options.format);
} catch (error) {
outputError(error instanceof Error ? error.message : String(error));
process.exit(1);
}
});When reporting issues, please include:
- Clear description of the problem
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (OS, Node version, etc.)
- Relevant logs or error messages
We welcome feature requests! Please:
- Check if the feature already exists or is planned
- Provide a clear use case
- Explain the expected behavior
- Consider contributing the implementation
If you have questions about contributing, please open an issue with the question label.
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in the project. Thank you for helping improve SuperOps CLI!