Thank you for your interest in contributing to Shelly CLI! This document provides guidelines and instructions for contributing.
Please read and follow our Code of Conduct.
Before submitting a bug report:
- Check existing issues to avoid duplicates
- Use the latest version of the CLI
- Collect relevant information (OS, Go version, device type, etc.)
When submitting a bug report, include:
- Clear, descriptive title
- Steps to reproduce the issue
- Expected vs actual behavior
- CLI version (
shelly version) - Device information (if applicable)
- Relevant logs or error messages
Feature requests are welcome! Please:
- Check existing issues for similar suggestions
- Describe the problem the feature would solve
- Explain the proposed solution
- Consider alternative approaches
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
make test) - Run linter (
make lint) - Commit with clear messages (see below)
- Push to your fork
- Open a Pull Request
- Go 1.25.5 or later
- golangci-lint v2.7.1 or later
- Make
# Clone the repository
git clone https://github.com/tj-smith47/shelly-cli.git
cd shelly-cli
# Install dependencies
go mod download
# Build
make build
# Run tests
make test
# Run linter
make lintshelly-cli/
├── cmd/shelly/ # Entry point
├── internal/ # Private packages
│ ├── cmd/ # Command implementations (subdirectory per command)
│ ├── cmdutil/ # Command utilities (factory, runner, flags)
│ ├── iostreams/ # I/O abstraction (output, progress, prompts)
│ ├── shelly/ # Business logic service layer
│ ├── tui/ # TUI components (BubbleTea)
│ ├── config/ # Configuration management
│ ├── output/ # Output formatting (JSON, YAML, table)
│ ├── helpers/ # Device discovery helpers
│ ├── plugins/ # Plugin system
│ ├── browser/ # Cross-platform URL opening
│ ├── theme/ # Theme management (bubbletint)
│ ├── model/ # Domain models
│ └── version/ # Version info
├── pkg/api/ # Public API for plugins
├── docs/ # Documentation
└── examples/ # Example configurations
- Follow standard Go formatting (
gofmt) - Pass all golangci-lint checks
- Use meaningful variable and function names
- Write clear comments for exported types and functions
- Keep functions focused and reasonably sized
- Write tests for new functionality
- Maintain 90%+ code coverage
- Use table-driven tests where appropriate
- Test edge cases and error conditions
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code change that neither fixes a bug nor adds a featuretest: Adding or updating testschore: Maintenance tasks
Examples:
feat(discovery): add BLE device discovery
fix(config): handle missing config file gracefully
docs(readme): update installation instructions
- Keep PRs focused on a single change
- Update documentation as needed
- Add tests for new functionality
- Ensure CI passes before requesting review
- Respond to review feedback promptly
- Open an issue for questions
- Check existing documentation
- Join discussions in GitHub Discussions
By contributing, you agree that your contributions will be licensed under the MIT License.