Contributing to Lumos CLI
Thank you for your interest in contributing to the Lumos CLI! This document provides guidelines and instructions for contributors and maintainers.Reporting issues
Please report issues here or contact Lumos directly.Development
Prerequisites
- Python 3.10.6 or higher
- uv (recommended) or pip
Installation
- Clone the repository:
- Install dependencies with uv:
- Set up pre-commit hooks:
Running the CLI Locally
Create an alias for development:Project Structure
Development Workflow
Creating a Branch
- Create a feature branch from
main: - Follow Angular commit conventions:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Adding a New Command
- Create a new module in the appropriate directory (e.g.,
src/lumos/your_feature/cli.py) - Define your click command:
- Register the command in
src/lumos/cli.py: - Add tests in
tests/ - Update documentation in
docs/
Code Style
The project uses ruff for linting and formatting, and basedpyright for type checking.Running Linters
Style Guidelines
- Maximum line length: 120 characters
- Use double quotes for strings
- Use type hints for all function parameters and return values
- Follow PEP 8 naming conventions
Testing
Running Tests
Running Tests with Coverage
Writing Tests
- Place test files in the
tests/directory - Name test files with
_test.pysuffix - Use descriptive test function names:
test_command_does_expected_behavior
Documentation
Documentation is built using Sphinx with MyST Markdown and click-extra’s Sphinx extension for interactive CLI documentation with ANSI color support.Building Documentation Locally
Documentation Structure
Source files (indocs/src/):
docs/src/index.md- Main landing pagedocs/src/installation.md- Installation instructionsdocs/src/examples.md- Usage examples with code samplesdocs/src/reference.md- CLI reference with live examples (via click-extra sphinx)
docs/src/_build/html/- HTML documentation (deployed to GitHub Pages via semantic-release)docs/*.md- Markdown documentation (copied from build, committed during releases)
Using click-extra Sphinx Directives
The documentation uses click-extra’s Sphinx directives to show live CLI examples:Updating Documentation
- For CLI changes: Update docstrings in the source code. The CLI reference uses
click:rundirectives to execute commands and display their help. - For usage examples: Edit
docs/examples.mdwith new code samples. - For installation changes: Update
docs/installation.mdandREADME.md.
Release Process
Releases are automated via semantic-release and GitHub Actions.Triggering a Release
- Go to the GitHub Actions page
- Select the “Release” workflow
- Click “Run workflow”
- Optionally enable “Dry run” to preview the release
What Happens During Release
- Version Analysis: semantic-release analyzes commits to determine the next version
- Build: Cross-platform binaries are built for Linux, macOS, and Windows
- Documentation: Documentation is regenerated with the new version
- Release:
CHANGELOG.mdis updatedpyproject.tomlversion is bumped- Git tag is created
- GitHub Release is published with binaries
- Homebrew formula is updated
Version Bumping
Version bumps are determined by commit messages:feat:→ Minor version bump (e.g., 1.0.0 → 1.1.0)fix:→ Patch version bump (e.g., 1.0.0 → 1.0.1)BREAKING CHANGE:in commit body → Major version bump (e.g., 1.0.0 → 2.0.0)
Manual Release (Emergency)
If automated release fails:Getting Help
- Issues: GitHub Issues
- Discussions: GitHub Discussions