Contributing to portview
July 31, 2026 ยท View on GitHub
Thanks for your interest in contributing! Here's how to get started.
Development setup
git clone https://github.com/Mapika/portview.git
cd portview
cargo build
cargo test
Requires Rust 1.85+ (edition 2024).
Running locally
# Run directly
cargo run
# Run the TUI
cargo run -- watch
# Run with Docker support
cargo run -- watch --docker
Code structure
| File | Purpose |
|---|---|
src/main.rs | CLI parsing, output formatting, entry point |
src/cli.rs | Clap CLI definitions (shared with build.rs) |
src/tui.rs | Interactive TUI (watch mode) |
src/linux.rs | Linux /proc filesystem parsing |
src/macos.rs | macOS libproc FFI |
src/windows.rs | Windows iphlpapi/kernel32 FFI |
src/docker.rs | Docker container detection and actions |
Guidelines
- Run
cargo fmtandcargo clippybefore submitting - Add tests for new functionality
- Keep platform-specific code in the respective platform module
--jsonoutput must work in all display modes
Only Linux can be run here, but the other two platforms can still be
type-checked โ do this before touching macos.rs, windows.rs, or anything
they share:
cargo check --target aarch64-apple-darwin
cargo check --target x86_64-pc-windows-msvc
Submitting changes
- Fork the repo and create a branch from
main - Make your changes
- Ensure
cargo test,cargo fmt --check, andcargo clippypass - Open a pull request
Releasing
-
Bump the version in
Cargo.toml,flake.nix, andserver.json(both the top-levelversionandpackages[0].version), and add aCHANGELOG.mdentry. The release workflow checks all of them against the tag and fails on any mismatch, so a missed file turns into a red release rather than a wrong publish. -
Push a full version tag, e.g.
v2.1.0. That triggers the release workflow: cross-platform builds, checksums, a GitHub release, and the Homebrew formula update. The tag pattern isv*.*.*, so partial tags do not fire it. -
Move the major tag so
uses: mapika/portview@v2keeps resolving:git tag -f v2 && git push -f origin v2Users pin the GitHub Action to the major tag; without this step that reference breaks. This deliberately does not trigger a release.
-
cargo publishis manual and not run by CI.
Reporting bugs
Use the bug report template or open a plain issue with:
- Your OS and version
- portview version (
portview --version) - What you expected vs what happened
- Steps to reproduce