Connect and Authenticate
Choose GitHub or GitLab, review repository routing, supply a token or import one from gh, and understand token permissions, validation, expiry and instance-bound GitLab credentials.
Provider settings
Forge configuration lives in Settings > Code forge, under the Integrations group. A switcher at the top of the tab moves between General and one entry per registered provider, so with the built-ins you see General, GitHub and GitLab. A fresh visit opens on the first provider rather than on General, because that is where a token goes.
GitHub and GitLab each draw their own settings section. A provider without one gets a generic credential form built from the fields it declares, with a Provider group naming its plugin and the capabilities it supports.
General
General holds the provider routing for the active project and the forge audit log.
Provider routing opens with Default provider, which applies to every project without its own provider setting. The default choice, Auto-detect, picks the first installed provider whose hostname matches the remote. Each registered provider is listed below it with the hostnames it matches.
Under the default, a group named after the active project lists each of its git remotes with its fetch URL. The remote the project actually routes through carries an In use badge (In use · auto-detected when no forge remote is pinned). On the right of each row, Daintree states the outcome:
| Result | Meaning |
|---|---|
| GitHub or GitLab, by project setting | Resolved from this project's provider override. |
| A provider, by default provider | Resolved by your global default. |
| A provider, by hostname | Resolved by matching the remote's hostname. |
| No provider | Nothing resolves this remote. The line beneath reads Set one in Project settings, or Install a forge plugin when no provider is registered at all. Check the override and the global default first: a fail-closed explicit choice lands here too, not just an unknown hostname. |
| Couldn't resolve | The lookup itself failed, which is not the same answer as no match. A Retry row appears beneath the list. |
If you're ever unsure why a project is or isn't talking to a forge, this list is the place to check.
Forge audit log
Below the routing list, the Forge audit log keeps a record of each call Daintree makes to a forge provider (list, get, assign, validate and the rest), with arguments redacted. It keeps the last 500 calls on this machine. Record forge provider calls is on by default; turning it off stops new records, and the ones already kept stay until you clear them. The viewer beside it shows the records with refresh, export and clear controls, plus any anomaly signals. It's there for triaging a slow provider or a cluster of failures, not for everyday use.
Per-project override
To override forge behavior for a single project, open Project settings > Code forge (switch the Settings sidebar heading from Global to the project). The Remote and provider section holds two settings.
Forge remote selects which git remote Daintree uses for issues, pull requests, and pulse data. The default, Auto-detect, prefers origin, then any other remote a forge provider recognizes. The other options list each configured remote with its name and owner/repo label. Change this when origin points to a fork and you'd rather track the upstream repository. The setting is honored in toolbar issue and PR resolution as well as in worktree linkage.
Forge provider pins the project to a specific provider. The default, Auto-detect, uses the default provider from the global Code forge settings, then the remote's hostname. Set it explicitly when matching picks the wrong provider, or when a remote's hostname doesn't make the right provider obvious, as with a self-hosted GitLab.
forgeRemote fails closed too. If the remote you named is later renamed or removed, the select shows it as (unavailable) and resolution reports the missing remote instead of quietly falling back to origin. Forge resolution backs mutations (assign, close, merge), so substituting a different repository for the one you named could redirect a write to a fork. A toolbar without issue and PR counts is a prompt to fix the setting; a write to the wrong repo is not recoverable.GitHub provider
Connecting GitHub takes a single personal access token, which you can paste or import from the GitHub CLI.
Personal access token
Open Settings > Code forge, switch to GitHub, and find the Authentication section. The token authenticates repository statistics, issue and PR detection, and linking worktrees to GitHub. Daintree keeps its own copy, so none of these features depend on the gh CLI.
A Status row reads Token saved for @your-login once a token is stored, and No token saved before that. Paste a token into the Personal access token field; the placeholder shows the two accepted formats, ghp_... or github_pat_.... Then:
- Test checks the token against GitHub without saving it, and reports that the token works but isn't saved yet.
- Save checks the token, stores it, and reports Checked and saved. The sidebar and toolbar refresh straight away, with no restart needed.
- Clear token, in the Stored token row, removes Daintree's copy after a confirmation. It only appears when a token is saved.
Tokens are stored locally in Daintree's settings, in plain text, keyed by provider in a forge credentials map rather than under a GitHub-specific key. Nothing is sent to Daintree. See Security & Privacy for the full storage model.
Importing the GitHub CLI's token
If the gh CLI is installed, the Get a token row offers Import from GitHub CLI. Click it and Daintree asks gh for the token it holds for github.com, checks it with GitHub, and shows a confirmation titled Import token for @your-login? before anything is saved. Reading that token can raise an OS keychain prompt, which is why Daintree never reads it until you click.
The confirmation lists the token's scopes, calls out any scopes beyond what Daintree uses (the copy keeps them all), warns when repo or read:org is missing, and notes when the import replaces a token you saved earlier. Import token saves Daintree's own plain-text copy; later changes to gh's login do not follow it. If gh isn't signed in, the row says to run gh auth login and try again.
Required scopes
The same row's Create token on GitHub button opens GitHub's token page with the right scopes preselected. A classic personal access token needs:
repo: access repository data (issues, PRs, statuses, and private repositories)read:org: read organization membership; organization access can also depend on token approval and SSO policy
For a fine-grained token, select the intended owner and repositories, then grant permissions for the features you use. Reading and writing issues requires Issues permission; PRs and reviews require Pull requests; repository content and merge operations can require Contents; status data may require Commit statuses, and individual check runs require Checks. Choose read access for browsing and write access only for operations you intend to perform. Metadata access alone does not grant access to private issue or PR data. Consult GitHub’s endpoint permission reference for each operation.
A successful token test verifies the token, not every repository permission or organization policy. Fine-grained tokens may need organization approval, and organizations can impose expiration limits. Follow GitHub’s token management guidance when selecting repositories, expiration and organization access.
This token authenticates Daintree’s forge API requests. Git fetch, pull and push use your Git transport credentials, such as an SSH key or credential helper. A working forge connection does not prove that Git can push to the remote.
GitLab provider
GitLab connects with a personal access token for one GitLab instance: gitlab.com by default, or your own server.
- Open Settings > Code forge and switch to GitLab.
- For a self-hosted server, set Instance URL to its base URL, including any port or path prefix. Leave it at
https://gitlab.comotherwise. - Click Create token on GitLab. It opens your instance's access-token page with the token named Daintree and the
apiscope preselected.read_apiis enough if you only want to read. - Paste the token (the default GitLab prefix is
glpat-) into Personal access token, then Test or Save. The Status row then reads Token saved for followed by the instance's host.
GitLab documents read_api for read access and api for read and write access. Instance policies can control token lifetimes and prefixes. See GitLab's token scopes and personal access token guidance.
Validation reports what went wrong in specific terms: the instance rejected the token (401), the token lacks API access because it has neither api nor read_api, the host couldn't be reached, or the host didn't answer like a GitLab instance.
A GitLab token is tied to the instance it was checked against, and Daintree never sends it to another host. Changing Instance URL while a token is saved doesn't switch anything on its own: the next Save or Test asks Switch to the new host first, and confirming removes the saved token, because it only works on the old instance.
gitlab.com and a few well-known public instances match by hostname. For a project whose remote points anywhere else, set Forge provider to GitLab under Project settings > Code forge. The routing list under General confirms the result.Token resilience and rate limits
When the connection to the forge fails, the integration degrades rather than breaking.
When a stored token stops working, a callout drops from the issues count in the toolbar. Its title names the problem: GitHub token expired for a revoked or expired token, GitHub token is missing permissions for an under-scoped one, or GitHub token needs SSO authorization when an organization's SSO blocks it (GitLab tokens get the same callout under GitLab's name). Reconnect to GitHub takes you to the provider's section of Settings > Code forge, and an SSO block adds Open reauthorization page. You can dismiss the callout; it returns only if a different token fails. A project with no token at all gets no callout: the counts' tooltips invite you to configure one instead.
Saving or clearing a credential re-checks the provider's token health right away, so the callout clears as soon as the provider accepts the new token.
Inside the GitHub issues and pull requests panel, a token error shows its own message with a button into settings, and the panel keeps showing the last results it fetched in the meantime. See When the forge is unreachable.
For transient network errors, the toolbar's polling retries in the background with backoff: the first failure retries after 30 seconds, doubling toward a two-minute ceiling. Retrying wouldn't help a rate limit, so that is waited out against its reset time instead.