Skip to main content
Thank you for your interest in contributing to Sunshine! This guide will help you get started with contributing code, documentation, translations, and more.

How to Contribute

There are many ways to contribute to Sunshine:
  • Report bugs - Help us identify and fix issues
  • Suggest features - Share ideas for improvements
  • Write code - Fix bugs or implement new features
  • Write documentation - Improve guides and API docs
  • Translate - Help localize Sunshine into other languages
  • Review pull requests - Provide feedback on proposed changes
  • Help others - Answer questions in discussions and Discord

Getting Started

Prerequisites

  1. GitHub account - Required for contributing
  2. Git - For version control
  3. Development environment - See Building from Source
  4. Familiarity with C++ - For code contributions

First Steps

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/Sunshine.git --recurse-submodules
    cd Sunshine
    
  3. Create a branch for your changes:
    git checkout -b feature/my-new-feature
    
  4. Make your changes (see guidelines below)
  5. Test your changes thoroughly
  6. Commit and push your changes
  7. Open a pull request on GitHub

Code Style and Standards

C++ Code Style

Sunshine uses clang-format for consistent code formatting. The configuration is in .clang-format at the repository root. Before committing, format your code:
find ./ -iname *.cpp -o -iname *.h -iname *.m -iname *.mm | xargs clang-format -i
The CI workflow will automatically check code formatting. Pull requests with formatting issues will fail CI checks.

Coding Standards

General Guidelines:
  • Use C++17 or later features where appropriate
  • Follow RAII principles for resource management
  • Prefer std::unique_ptr and std::shared_ptr over raw pointers
  • Use const wherever possible
  • Write self-documenting code with clear variable names
  • Add comments for complex logic
Platform-Specific Code:
  • Place platform-specific code in src/platform/<platform>/
  • Use platform abstraction interfaces in src/platform/common.h
  • Avoid #ifdef blocks in core code when possible
Error Handling:
  • Check return values and handle errors gracefully
  • Use exceptions for exceptional conditions
  • Log errors with appropriate severity levels
Sunshine development is best done with an IDE that supports C++ and CMake:
ToolDescription
CLionRecommended IDE for C and C++ development. Free for non-commercial use.
Visual Studio CodeFree, with C++ and CMake extensions
Visual StudioOn Windows, with CMake support

Web UI Development

The Web UI uses Vue.js 3 with Vite as the build system.

Web UI Structure

  • Location: ./src_assets/common/assets/web
  • Templating: EJS (see template_header.html and template_header_main.html)
  • Styling: Bootstrap 5
  • Icons: Lucide and Simple Icons

Building the Web UI

cmake -B build -G Ninja -S . --target web-ui
ninja -C build web-ui

Web UI Guidelines

  • Follow Vue.js best practices
  • Use existing Bootstrap components when possible
  • Ensure responsive design (mobile, tablet, desktop)
  • Test on multiple browsers
  • Keep dependencies up to date

Localization and Translation

Sunshine supports multiple languages through CrowdIn.

Translation Basics

  • NEVER translate brand names: LizardByte, Sunshine, AMD, Intel, NVIDIA
  • Only add strings to en.json - translations happen on CrowdIn
  • Do not manually edit other language files

Adding Translatable Strings

Web UI (Vue.js)

Sunshine uses Vue I18n for the Web UI. 1. Add the string to the English locale file: src_assets/common/assets/web/public/assets/locale/en.json:
{
  "index": {
    "welcome": "Hello, Sunshine!"
  }
}
JSON keys should be sorted alphabetically. Use jsonabc to sort keys.
2. Use the string in your Vue component:
<template>
  <div>
    <p>{{ $t('index.welcome') }}</p>
  </div>
</template>
More formatting examples:

C++ Code

For system tray or other native UI elements, use boost::locale:
#include <boost/locale.hpp>
#include <string>

std::string msg = boost::locale::translate("Hello world!");
More examples:
Do not include manually updated template files (.po) or compiled language files (.mo) in pull requests. These are generated automatically by CI.

Translation Workflow

  1. Developer adds string to en.json (Web UI) or C++ code
  2. PR is merged to master branch
  3. CI workflow extracts strings and pushes to CrowdIn
  4. Translators translate on CrowdIn
  5. CrowdIn pushes translations to l10n_master branch
  6. PR is created from l10n_master to master
  7. PR is merged, translations are now available

Testing

Unit Testing

Sunshine uses Google Test for unit testing. Location: ./tests/ Run tests:
./build/tests/test_sunshine
Run specific tests:
./build/tests/test_sunshine --gtest_filter="TestSuiteName.TestName"
Run with verbose output:
./build/tests/test_sunshine --gtest_verbose
Help:
./build/tests/test_sunshine --help

Code Coverage

Sunshine uses gcovr to generate code coverage reports. Coverage is checked by Codecov:
  • PRs must maintain or improve total coverage
  • New code should have adequate test coverage
Excluding code from coverage: If code cannot be tested in CI (e.g., requires GPU access), you can exclude it:
// GCOV_EXCL_START
void untestable_gpu_function() {
    // This code won't be counted in coverage
}
// GCOV_EXCL_STOP
See gcovr exclusion markers for more options.
Even if your code can’t be tested in CI, we encourage you to write tests for it. This allows maintainers to run tests locally with proper hardware.

Clang Format Testing

CI automatically checks code formatting. To test locally before pushing:
python ./scripts/update_clang_format.py
Then check for changes:
git diff
If there are changes, commit them before pushing.

Pull Request Process

Before Submitting

  • Code is formatted with clang-format
  • All tests pass locally
  • New features have tests
  • Documentation is updated (if applicable)
  • Commit messages are clear and descriptive
  • Branch is up to date with master

Pull Request Guidelines

Title:
  • Use a clear, descriptive title
  • Start with a verb: “Add”, “Fix”, “Update”, “Improve”, “Remove”
  • Examples:
    • “Add support for AV1 encoding”
    • “Fix crash when disconnecting client”
    • “Update documentation for KMS capture”
Description:
  • Describe what changed and why
  • Reference related issues: “Fixes #123” or “Related to #456”
  • Include screenshots/videos for UI changes
  • List breaking changes (if any)
  • Explain how to test the changes
Example:
## Summary

Adds support for AV1 encoding on Linux using VAAPI.

## Changes

- Added AV1 encoder initialization in `video.cpp`
- Updated encoder selection logic
- Added AV1 configuration options

## Testing

1. Build with `SUNSHINE_ENABLE_VAAPI=ON`
2. Set encoder to "av1" in config
3. Start streaming session
4. Verify AV1 encoding in client logs

Fixes #789

Review Process

  1. Automated checks run (CI, formatting, tests)
  2. Maintainers review your code
  3. Address feedback if requested
  4. Approval from maintainer(s)
  5. Merge to master branch
Be patient - maintainers are volunteers. It may take a few days to review your PR.

Reporting Bugs

When reporting bugs, please include:
  • Sunshine version (e.g., v0.20.0)
  • Platform (Linux, Windows, macOS, FreeBSD)
  • OS version (e.g., Ubuntu 22.04, Windows 11, macOS 14)
  • GPU (vendor and model)
  • Steps to reproduce (detailed and numbered)
  • Expected behavior
  • Actual behavior
  • Logs (see log locations in Architecture)
  • Screenshots/videos (if applicable)
Use the bug report template when creating an issue on GitHub.

Feature Requests

When requesting features:
  • Check existing issues - your feature may already be requested
  • Describe the use case - why is this feature needed?
  • Provide examples - how would it work?
  • Consider alternatives - are there other solutions?
Use the feature request template when creating an issue on GitHub.

Community Guidelines

Code of Conduct

Sunshine follows LizardByte’s community guidelines:
  • Be respectful - treat everyone with kindness
  • Be constructive - provide helpful feedback
  • Be patient - remember maintainers are volunteers
  • Be inclusive - welcome all contributors

Communication Channels

  • GitHub Issues: Bug reports and feature requests
  • GitHub Discussions: General questions and discussions
  • Discord: Real-time chat and support
  • Documentation: Official docs

Additional Resources

For more detailed contribution guidelines, see the organization-level documentation:

Thank You!

Your contributions make Sunshine better for everyone. Whether you’re fixing a typo, translating a string, or implementing a major feature - thank you for being part of the community!

GitHub Repository

Start contributing on GitHub

Translation Project

Help translate Sunshine

Build docs developers (and LLMs) love