Git Accounts

Git accounts belong to the user identified by the controller. The local operator reuses existing accounts; server users have private Git connections and can browse or check out only the repositories available to them. Sharing an LLM subscription does not share a Git token. Installing gh or glab, signing in to the provider and granting a session Git/network access are separate steps. See server implementation and shared LLM accounts (source access required).

Open Git Accounts in TUI or web (#/git-accounts). This section is separate from AI provider Accounts. Press a or select Add Git account; arrows and Enter choose the provider.

The web Repositories dialog has a Connect Git account button that opens this section. If the console has no connected accounts, it explains this explicitly. A successful ./devctl github import also registers that explicitly selected GitHub identity for controller repository browsing, using its existing gh authorization without another sign-in. ./devctl web start migrates older explicit imports once; unrelated local accounts are never imported. A deliberate disconnect is not undone on the next web start. If the controller or saved gh authorization is unavailable, host/session credentials remain unchanged and registration can be retried. Accounts whose installed provider does not support browsing get a separate message and can still be used with a repository URL.

For ./devctl github import LOGIN@github.com --host 'user:password@server.example', the inline password authenticates the SSH destination only; the GitHub credential still comes from the selected saved gh profile. The destination is sanitized to user@server.example before logging or saving import state. A temporary private SSH_ASKPASS helper supplies the password while preserving stdin for the credential archive. The server must allow password authentication and have a trusted host key. Without an inline password, SSH uses prepared key authentication with BatchMode=yes. An inline password can remain in shell history and the initial process arguments. The Git Accounts hostname field itself accepts a DNS hostname with an optional HTTPS port; enter HTTPS Git usernames and tokens/passwords in their separate fields.

GitLab tokens need read_api for account/group/project browsing and read_repository for clone/fetch (write_repository for push). Native glab API write operations, including merge request changes, can require the broader api scope. A link to the selected server's token settings is shown in the form. Device authorization for GitLab requires an OAuth application registered on that installation; this version uses personal access tokens. References: GitLab OAuth, token scopes.

Managed GitLab account import supports an HTTPS DNS hostname with an optional port and a trusted certificate. HTTPS server URLs are accepted by setup and Git provider settings; URL subfolders, credentials, query strings and fragments are rejected. SSH repository URLs remain supported by the existing host SSH setup; this section does not import SSH private keys or implement a generic SSH authentication browser.

Setup and Git CLI selection

The fresh installer asks which Git providers you use with the same checkbox control as AI agent selection. Choose GitHub, GitLab, both, or neither. GitLab then offers GitLab.com or a custom HTTPS server URL, including a custom port. For unattended setup, use --git-providers github,gitlab --gitlab-host https://git.example.com:8443. Selected CLIs apply at the next container start or image rebuild; existing processes keep running. GitLab uses the official glab release through the common verified binary installer. GitLab-only managed images omit the GitHub CLI package from the unchanged apt lock.

Open Select Git providers / GitLab server in Git Accounts to change the same owner-scoped preference from the native or browser interface. CLI and MCP callers can read or update the same GET/PUT /v1/preferences/git operator operation. For example:

./devctl git selection show
./devctl git selection save '[{"provider":"gitlab","hostname":"git.example.com:8443"}]'
./devctl git accounts
./devctl git owners ACCOUNT_ID
./devctl git repos ACCOUNT_ID group/subgroup

A server administrator can explicitly authorize a selected exact GitLab hostname and port on a private network using Authorize this exact GitLab host on a private network. Fresh administrator setup records this choice for a custom GitLab URL. Tenant users cannot grant private network access by submitting a hostname or token. The optional administrator environment setting DEVCTL_GITLAB_PRIVATE_HOSTS lists exact approved hostnames and optional ports. Approval never authorizes redirects, other hosts or another port; DNS answers are pinned to the TLS connection. Existing process and Project network policies still apply.

This administrator approval covers the controller's GitLab API destination. It does not add a hostname to Project Network settings or create a private workspace route. Restricted workspaces reach only approved public hosts on ports 80/443. A public custom GitLab host on 443 needs its Project Network hostname grant; private addresses and custom ports such as 8443 cannot use that gateway. Account verification and installed credentials do not prove container reachability.

To import a saved local GitLab PAT, select --import gitlab and optionally --gitlab-account LOGIN. Only the selected server/login is read, after metadata verification; unrelated glab profiles and environment tokens are ignored. Older glab versions without structured status output need an update or the token form. Saved OAuth logins are not copied as PATs: their access tokens need native refresh state. Continue using the official CLI OAuth flow locally or provide a PAT to the controller. On a local machine with existing network access to this server, the official interactive login is:

glab auth login --hostname git.example.com:8443 --git-protocol https

The official CLI also offers --web and --device; self-managed OAuth requires an application configured for that instance. See GitLab authentication and CLI login. Native glab merge request commands require the selected PAT and an already permitted network path. The controller's managed GitHub review publication and bulk organization import are not GitLab merge request/group workflows; those capabilities are explicitly unsupported in the GitLab provider metadata.

Select an account to browse repositories, import it to an online host, or disconnect it from the controller. Import waits for the host's acknowledgement; choose the resulting Git CLI account profile when launching a session. Existing sessions are not restarted or silently granted another account. Creating a Project through the account browser performs its checkout on the selected host first. Reconnecting/updating a token requires reimport to each desired host.

Tokens are masked in the form, encrypted in the controller database, excluded from public snapshots and queued command payloads, and delivered only through the authenticated channel to explicitly selected hosts. API requests stay on the configured HTTPS origin and do not follow redirects. Git's credential helper returns the selected credential only for its exact HTTPS hostname. Host files use directory mode 0700 and file mode 0600. Existing GitHub profile identifiers and endpoints remain compatible.

Disconnect removes the controller's token after an explicit confirmation. Already imported host/session credentials remain; the confirmation explains this. Remove those profiles separately or revoke the token at its provider to invalidate all copies.

Hosting selection in the web console uses a native, mobile-friendly dialog with locally bundled logos for Hetzner Cloud, DigitalOcean, Vultr, Akamai/Linode and Hostman. Arrows, Enter, clicks and taps choose the provider. Native TUI keeps its text picker. Selection does not create a billable VPS; naming and the existing provisioning confirmation follow.

Provider packages

In server-user mode the controller scopes Git accounts and repository browsing to the authenticated user. A selected private account supplies a runtime-only credential helper for that user's exact HTTPS repository host; an operator's imported host profile is never a tenant fallback. Stop/delete, disable and disconnect remove runtime credential material. The operator import workflow above remains available in single-operator mode. Server identity and private checkout.

GitHub, GitLab and generic Git adapters are optional packages. The account picker uses installed provider manifests; URLs, device-flow parsing and repository API mapping live in the package. Account storage, encryption, host imports and polling remain in the controller. Removing an adapter preserves saved accounts/history, but operations that need that adapter report unavailable until it is reinstalled. See provider packages for installation and environment overrides.