Documentation
¶
Overview ¶
Package glabcli provides access to the local GitLab CLI (glab) for authentication and lightweight command execution — the GitLab counterpart of ghcli, standing in for a signed-in person on a single-user server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI resolves a GitLab token and the signed-in login from the local glab CLI for one GitLab instance, caching both. Unlike gh, glab keeps a credential per host, so the host is part of every question asked of it.
func New ¶
New returns a CLI for the GitLab instance at host ("gitlab.com" when empty), backed by `glab config get token` and `glab api user`.
func (*CLI) Login ¶
Login returns the username glab is signed in as on the host, cached for the lifetime of the CLI value (it is read on every API request in local mode, and the glab identity does not change under a running server). The host is passed explicitly: `glab api` would otherwise default to gitlab.com or to the instance of the current git directory, which need not be the board's.