|
| 1 | +# Contributing to Komet Node |
| 2 | + |
| 3 | +## Development environment |
| 4 | + |
| 5 | +This repository ships a [devcontainer](.devcontainer/) that provisions the full |
| 6 | +toolchain (Nix, the flake's `nix develop` shell, the Claude Code CLI, and the |
| 7 | +GitHub CLI). Open the repo in a devcontainer-aware editor and everything below is |
| 8 | +available out of the box. |
| 9 | + |
| 10 | +## Using the GitHub CLI (`gh`) |
| 11 | + |
| 12 | +`gh` is preinstalled in the devcontainer for creating pull requests, reviewing |
| 13 | +issues, and other GitHub tasks from the terminal. |
| 14 | + |
| 15 | +### Authenticating |
| 16 | + |
| 17 | +Authenticate once with a personal access token: |
| 18 | + |
| 19 | +```bash |
| 20 | +gh auth login |
| 21 | +``` |
| 22 | + |
| 23 | +Choose **GitHub.com** → **HTTPS** → **Paste an authentication token** when |
| 24 | +prompted, then paste the token you create below. |
| 25 | + |
| 26 | +Your credentials are stored in `~/.config/gh` inside the container, which is |
| 27 | +backed by a named volume. This means **your token survives container rebuilds** — |
| 28 | +you only need to authenticate once, not every time the container is recreated. |
| 29 | + |
| 30 | +To check or reset your authentication at any time: |
| 31 | + |
| 32 | +```bash |
| 33 | +gh auth status # show the current login |
| 34 | +gh auth logout # remove stored credentials |
| 35 | +``` |
| 36 | + |
| 37 | +### Creating a token with minimal permissions |
| 38 | + |
| 39 | +Create a **fine-grained** personal access token at **GitHub → Settings → Developer |
| 40 | +settings → [Fine-grained personal access tokens](https://github.com/settings/personal-access-tokens/new)** |
| 41 | +with the least privilege for your work: |
| 42 | + |
| 43 | +- **Repository access** → *Only select repositories* → `runtimeverification/komet-node` |
| 44 | +- **Contents** → *Read and write* |
| 45 | +- **Pull requests** → *Read and write* |
| 46 | +- **Issues** → *Read and write* (only if you triage issues) |
| 47 | + |
| 48 | +`Metadata → Read` is selected automatically; leave everything else at *No access*. |
| 49 | + |
| 50 | +## Signing commits |
| 51 | + |
| 52 | +To sign commits made with `git`, add an SSH or GPG key of type **Signing key** to |
| 53 | +your GitHub account. |
| 54 | + |
| 55 | +> [!WARNING] |
| 56 | +> Never place an SSH key registered as an **Authentication key** in the container. |
| 57 | +> An authentication key grants full account-wide git access and would bypass the |
| 58 | +> minimal permissions of your fine-grained PAT. Use a **signing-only** key here. |
0 commit comments