Sign inSign up

sbx/glab-kit

Verified Publisher

By Docker, Inc

Updated 22 days ago

Installs the GitLab CLI (glab) with proxy-injected personal access token auth for gitlab.com, so ...

Sandbox Kit
0

468

sbx/glab-kit repository overview

Digest

sha256:6d86b834b94f…

Size

2 Bytes

Schema

v2

Pushed

22 days ago

Specificationspec.yaml

MIXIN
REQUIRES SECRETS

Installs the GitLab CLI (glab) with proxy-injected personal access token auth for gitlab.com, so agents can work with GitLab projects the way gh works with GitHub.


Credentials
NameServiceRequiredDescription
GITLAB_TOKENgitlabRequiredGitLab personal access token (api scope). Stored on the host; the sandbox only sees a placeholder and the proxy injects the real value on requests to gitlab.com.

Network Egress

gitlab.com:443

Apply this mixin to a sandbox

sbx run <agent> --kit docker.io/sbx/glab-kit:latest

Make sure you have docker sbx installed

Run the following command to install sbx on your machine.

macOS
brew install docker/tap/sbx
Windows
winget install Docker.sbx
Learn more about docker sbx

glab — GitLab CLI

A mixin kit that installs the GitLab CLI (glab) and wires up personal access token (PAT) authentication for gitlab.com through the sandbox proxy. Pairs with any base agent (claude, codex, gemini, …).

GitLab is not one of sbx's built-in auto-sign-on services (GitHub is), so out of the box glab inside a sandbox has no credentials and sbx secret set -g gitlab alone has no effect — nothing binds it. This kit closes that gap: it declares a gitlab credential and injects it into outbound gitlab.com requests at the proxy, so the token is stored on the host and never lands inside the sandbox. The container only ever sees a proxy-managed placeholder in GITLAB_TOKEN.

Usage

Store your GitLab PAT (needs the api scope) once on the host:

sbx secret set gitlab

Then create a sandbox with the kit:

sbx run --kit "git+https://github.com/docker/sbx-kits-contrib.git#dir=glab" claude

Verify inside the sandbox:

glab auth status
glab api user

How auth works

  • The kit declares a gitlab credential with proxyManaged: true. Inside the container, GITLAB_TOKEN is set to a sentinel value, which is enough for glab to consider itself logged in.
  • On any request to gitlab.com, the sandbox proxy replaces the Authorization header with Bearer <your-real-PAT>. The real token never enters the sandbox filesystem or environment.
  • Git-over-HTTPS push credentials are not wired up by this kit — git sends Basic auth, which the kit does not rewrite. Use glab api, or public read-only clones. (Native GitLab sign-on, including git, is on the sbx roadmap.)

Self-managed GitLab

The kit's spec targets gitlab.com. For a self-managed instance (e.g. gitlab.example.com), add on the host:

sbx secret set-custom --host gitlab.example.com --env GITLAB_TOKEN --value <your-PAT>
sbx policy allow network "gitlab.example.com:443"

and inside the sandbox (or a project kit):

export GITLAB_HOST=gitlab.example.com

Note sbx secret set-custom is experimental; flags may change.

Why the install is pinned

The install hook downloads a specific glab release tarball and verifies its SHA256 against a checksum recorded in this spec (same pattern as the trivy kit) rather than piping an install script to a shell. To bump the version, update GLAB_VERSION and both per-arch checksums from the release's checksums.txt.

Cleanup

sbx secret rm -g --service gitlab