4.7 KiB
Contributing to grom
grom is open source under the MIT License. Contributions are welcome and appreciated. This guide covers how to set up a development environment, submit changes, and follow project conventions.
Development Setup
Prerequisites
- Go 1.25+ — go.dev/dl
- Make — Build automation
- Prometheus (optional) — Any
/api/v1/query-compatible endpoint for live dashboards. The demo gallery runs without one.
Clone and Build
git clone https://github.com/qf-studio/grom.git
cd grom
make build
The binary is output to bin/grom.
Run Without Prometheus
make demo # built-in demo gallery
./bin/grom demo --theme tokyo-night
Run Tests
make test
Lint
make lint
Format
make fmt
How to Contribute
Report Bugs
Open a GitHub Issue with:
- Steps to reproduce
- Expected vs actual behavior
- grom version (
grom version) - OS, architecture, and terminal emulator (rendering bugs are often terminal-specific)
Suggest Features
Open a GitHub Issue with the enhancement label. Describe the use case and why it matters. Feature discussions happen in issues before implementation starts.
Submit Code
- Open an issue first for non-trivial changes. This avoids duplicated effort and ensures alignment on approach.
- Fork the repository
- Create a feature branch from
main - Make your changes
- Run
make test && make lint— both must pass - Submit a pull request
Improve Documentation
Documentation lives in:
README.md— Project overview and usageexamples/— Example dashboard configs
PRs for documentation improvements follow the same process as code changes.
Code Standards
Go Conventions
- Formatting:
gofmt(enforced by CI) - Vetting:
go vet(enforced by CI) - Linting:
golangci-lint(enforced by CI) - Testing: Table-driven tests are the standard pattern
- Dependencies: Standard library first. The sanctioned UI dependency is the Charm stack (Bubble Tea / Lipgloss). Don't add dependencies casually.
- Errors: Return errors as values, wrap with
fmt.Errorf("...: %w", err). No panics in library code.
Terminal Rendering
- All column/width math goes through
pkg/tui/render(ANSI-aware). Never uselen()on a styled string — visual width islipgloss.Width(s). - Pull colors from
theme.Themetokens. Never hardcode hex values in render code. - Render primitives get table-driven tests that include ANSI cases. Full panels get golden-output tests with fixtures under
testdata/.
Commit Messages
Follow Conventional Commits:
type(scope): description
feat(render): ANSI-aware truncation
fix(prom): handle empty range-query result
refactor(grid): extract panel placement
test(widget): add braille chart golden tests
docs(readme): update installation instructions
chore(ci): upgrade Go version in workflow
Types: feat, fix, refactor, test, docs, chore
Tests and Prometheus
Unit tests never talk to a live Prometheus. Use recorded responses under testdata/ instead.
Pull Request Process
- CI must pass — Tests, vetting, linting, and formatting are checked automatically
- One approval required — A maintainer reviews all PRs
- Keep PRs focused — One logical change per PR. Split large changes into smaller PRs.
- Update tests — New features need tests. Bug fixes need regression tests.
- Update docs — If your change affects user-facing behavior, update the README or examples.
Project Structure
grom/
├── cmd/grom/ # CLI entrypoint
├── internal/
│ ├── app/ # Bubble Tea application model
│ ├── config/ # Dashboard config loading (YAML)
│ ├── datasource/ # Datasource interface
│ │ └── prom/ # Prometheus implementation
│ ├── grafana/ # Grafana dashboard JSON model + import
│ └── grid/ # Terminal grid layout
├── pkg/tui/
│ ├── render/ # ANSI-aware width/truncation primitives
│ ├── theme/ # Color themes and tokens
│ └── widget/ # Charts, meters, stats
├── examples/ # Example dashboard configs
└── docs/ # Demo recording (vhs tape + gif)
License
grom is licensed under the MIT License. By contributing, you agree that your contributions will be licensed under the same terms.
Getting Help
- GitHub Issues — Bug reports and feature requests
- Email — hello@quantflow.studio
Thank you for contributing.