Thank you for your interest in contributing to Null Terminal! This document provides guidelines and instructions for contributing.
Be respectful, inclusive, and constructive. We're building something cool together.
- Python 3.12+
uvpackage manager- Git
# Clone the repository
git clone https://github.com/starhound/null-terminal.git
cd null-terminal
# Install dependencies
uv sync
# Run the application
uv run main.py
# Run tests
uv run pytest- Check existing issues to avoid duplicates
- Use the bug report template
- Include:
- Null Terminal version
- Python version
- OS and terminal emulator
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs or screenshots
- Check existing issues/discussions
- Describe the use case clearly
- Explain why existing features don't solve it
- Propose implementation if possible
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/null-terminal.git
cd null-terminal
git checkout -b feature/your-feature-nameBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions/fixes
Follow the coding standards below. Commit often with clear messages.
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=. --cov-report=term-missing
# Run specific tests
uv run pytest tests/unit/ai/
# Lint your code
uv run ruff check .
uv run ruff format --check .- Push your branch to your fork
- Open a PR against
main - Fill out the PR template
- Link related issues
- Wait for review
- Formatter: We use
ruff format - Linter: We use
ruff check - Type hints: Required for all public functions
- Docstrings: Required for classes and public methods
async def my_function(param: str, count: int = 10) -> list[str]:
"""Brief description of what this does.
Args:
param: Description of param
count: Description of count
Returns:
Description of return value
"""
pass- All I/O operations must be async
- Use
asyncio.create_subprocess_shellinstead ofsubprocess - Use
httpx.AsyncClientinstead ofrequests - Never use
time.sleep()- useasyncio.sleep()
- Never use
print()- useself.notify()orself.log() - Use TCSS classes for styling, not inline styles
- Use
self.post_message()for widget communication - Keep widget
compose()methods simple
- All new features need tests
- All bug fixes need regression tests
- Use the
mock_homefixture to protect user data - Integration tests use the
pilotpattern
import pytest
@pytest.mark.asyncio
async def test_feature(mock_home, mock_storage):
"""Test description."""
# Arrange
...
# Act
...
# Assert
assert result == expectedFollow conventional commits:
type(scope): short description
Longer description if needed.
Fixes #123
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(ai): add support for Gemini 2.0 Flashfix(blocks): handle empty command outputdocs: update provider configuration guidetest(mcp): add client connection tests
See DEVELOPMENT.md
- Create
ai/newprovider.pyinheriting fromLLMProvider - Implement required methods
- Register in
ai/factory.py - Add tests in
tests/unit/ai/ - Update
docs/user/providers.md
See DEVELOPMENT.md
- Add
cmd_method to appropriate module incommands/ - Register in
commands/handler.py - Add tests
- Update
docs/user/commands.md
- Create widget in
widgets/ - Use
reactiveproperties for state - Style via TCSS in
styles/main.tcss - Add integration tests
The block system (widgets/blocks/) is critical. Changes here require:
- Unit tests for the widget
- Integration tests for rendering
- Review of
BlockStatemodel compatibility
- Automated checks must pass (tests, linting)
- One approval required from maintainers
- Squash merge preferred for clean history
- Tests included and passing
- Code follows style guidelines
- No breaking changes without discussion
- Documentation updated if needed
- Commit messages are clear
Releases are managed by maintainers:
- Version bump in
pyproject.toml - Update
CHANGELOG.md - Create GitHub release with tag
- CI/CD handles PyPI and Docker publishing
- Questions: Open a Discussion on GitHub
- Bugs: Open an Issue
- Chat: [Discord/Matrix link if available]
Contributors are recognized in:
- GitHub contributors list
- Release notes for significant contributions
- Special thanks in README for major features
Thank you for contributing to Null Terminal!