Thanks for your interest in contributing to stonks-cli! stonks-cli is a terminal dashboard for tracking your investment portfolio with live market prices.
This guide explains how to set up a development environment, run checks, and submit changes.
- Python 3.11+
- uv
- Git
- GNU Make
git clone https://github.com/igorpaniuk/stonks-cli.git
cd stonks-climake inituv run pre-commit installstonks-cli uses ruff (format + lint), mypy, and pytest.
make check-allmake check # ruff linter
make format-check # ruff format (check only)
make type # mypy
make test # pytest + coveragemake formatmake helpWhen adding or changing behaviour, please include unit tests.
Guidelines:
- Prefer pure / deterministic functions and small units.
- Mock external services (Yahoo Finance / yfinance network calls).
- Tests should not require network access -- stub the price refresh worker
in TUI tests (see
tests/conftest.pyfor the existing autouse fixture).
We follow a clean history approach with fast-forward merges.
-
Fork the repository
-
Clone your fork:
git clone https://github.com/<your-username>/stonks-cli.git -b main cd stonks-cli
-
Create a feature branch:
git checkout -b feature/my-change
-
Make changes + add tests
-
Run all checks:
make check-all
-
Commit and push to your fork:
git add . git commit -s -m "feat: your descriptive commit message" git push -u origin feature/my-change
-
Open a Pull Request on GitHub
- Keep PRs focused (avoid mixing refactors with unrelated functional changes).
- Ensure CI passes.
- Add a clear PR description explaining what and why.
This project uses the Conventional Commits specification: https://www.conventionalcommits.org/en/v1.0.0/
Format:
<type>(optional-scope): short summary
optional body
Common types:
feat-- new featurefix-- bug fixdocs-- documentation changestest-- adding/updating testsrefactor-- internal refactoringchore-- tooling/meta changesci-- CI-related changes (GitHub Actions)
Examples:
$ git log --oneline
5cbb7bc feat: add support for multiple portfolios
7d7beb8 feat: make total portfolio currency configurable via YAML
3869d4a feat: add cash position support (add-cash / remove-cash commands)
dd892dc refactor: rename show command to dashboard
9256446 test: stub price refresh worker to prevent flaky live-network failures
182a7ef fix: guard against worker callback firing after app teardownAll commits must carry a Signed-off-by trailer. It is your attestation
that you wrote the change and have the right to submit it under the project's
license (see the Developer Certificate of Origin).
Add it automatically with the -s flag:
git commit -s -m "feat: your descriptive commit message"This appends a line like the following to the commit body:
Signed-off-by: Your Name <you@example.com>
Git reads your name and e-mail from user.name / user.email in your
git config, so make sure those are set correctly before you start.
To keep the commit history clean and easier to follow, please squash fix commits into the original commits they relate to, instead of adding separate "fix" commits.
Having standalone fix commits makes the history harder to read and review later. When each commit is logically complete (i.e. it compiles, passes tests, and includes any follow-up fixes), it:
- Makes
git blamemore meaningful - Keeps the history easier to understand
- Simplifies potential reverts
- Maintains a clean and intentional commit narrative
Use an interactive rebase to squash the fixes into the relevant commits:
git rebase -i <your-feature-branch>If you're unsure about an implementation approach or want to propose a bigger change, open an issue first so we can discuss direction before you invest time.