p2p-chat is an open-source project licensed under AGPL-3.0. Contributions are welcome — whether that means fixing a bug, improving the documentation, or adding a new feature. This page covers the development environment setup, project conventions, and licensing requirements you need to know before submitting a change.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Project516/p2p-chat/llms.txt
Use this file to discover all available pages before exploring further.
p2p-chat does not currently have an automated test suite. All verification is done by running the program manually with
go run.Requirements
- Go 1.26.2 or later. The project uses standard library features and module support from this version.
install-go.sh which downloads and installs Go 1.26.2 on Linux:
PATH:
Clone and build
Download dependencies
The project uses Go modules. Dependencies are recorded in
go.mod and go.sum. Fetch them with:Formatting and vetting
Before submitting a change, runrun.sh to format and vet the code:
run.sh runs the following commands in sequence:
go fmt (no diff) and go vet (no output) before being merged.
Project structure
internal/ if they are not intended for use outside the module, or at the top level alongside crypto/ if they are general-purpose.
Making changes
Adding or changing CLI subcommands
Adding or changing CLI subcommands
The argument dispatcher lives in
main.go. Add new cases to the switch statement there and implement the logic in a new or existing package under internal/.Adding or changing slash commands
Adding or changing slash commands
Slash commands are parsed and dispatched in
internal/chat/chat.go. Add a new case to the slash command handler and implement the behavior in the same file or a helper function. If the command sends data to the peer, encrypt it through the transport layer as the existing commands do.Changing the transport protocol
Changing the transport protocol
The wire frame format is defined in
internal/transport/transport.go. Any change to SendFrame or ReceiveFrame will break compatibility with existing clients, so document the change clearly and update both functions together.Updating the version
Updating the version
Bump the version by editing
assets/version.txt. The string is read at runtime by internal/version/version.go and used by both go run . version and the /version slash command.License
p2p-chat is released under the GNU Affero General Public License v3.0 (AGPL-3.0). By contributing to this project, you agree that your contributions will be licensed under the same license. The full license text is in theLICENSE file at the root of the repository. When in doubt about license compatibility, open a discussion on the GitHub repository before submitting a pull request.