feat(minder): add glab minder command via binarymgr (linux)

What this does

Adds a top-level glab minder command that downloads and runs the GitLab Endpoint Agent Platform binary (agent-client, from the endpoint-agent-platform project) through glab's existing binarymgr framework, forwarding all arguments to it.

It mirrors the existing glab orbit binarymgr consumer: glab downloads, checksum-verifies, atomically installs, schedules update checks, and runs the managed binary. The glab-owned --install, --update, and --yes flags and the update subcommand are handled by glab; every other argument passes through verbatim to the binary.

Linux only.

Command name: glab minder (renamed from the earlier glab agent to avoid collision with glab cluster agent and GitLab Duo Agent). The managed binary stays agent-client, and glab minder <cmd> runs agent-client agent <cmd>.

Experimental. The command is tagged (EXPERIMENTAL) and shows the standard text.ExperimentalString disclaimer in its help, mirroring glab orbit — the binary is pre-1.0, unsigned, and Linux-only.

How it works

  • Source: the public project security-products/endpoint-agent-platform (project 87908878), generic package agent-client, assets agent-client-linux-amd64 / agent-client-linux-arm64 (raw static ELF, no extraction). The download is anonymous — no token required.
  • Linux-only enforcement: the Spec sets SupportedOS: ["linux"]. binarymgr.detectPlatform checks runtime.GOOS against that list and returns ErrUnsupportedPlatform on any other OS before downloading or running anything; agentNormalizeArch is a second guard that also rejects non-linux. On macOS/Windows the command fails fast with a clear "unsupported platform" message. (The execute_windows.go file exists only so the package compiles on Windows — the platform gate rejects the OS before it could run.)
  • agent subcommand prefix: the downloaded binary's feature tree lives under agent-client agent ... (install, hook, version, uninstall, verify, evaluate, auth). The executor prepends the literal agent arg, so glab minder version runs agent-client agent version.
  • No credential injection: glab does not inject auth env into the binary. The client authenticates itself via glab minder auth login (it ships its own auth subcommand), matching glab duo cli. The executors pass os.Environ() through unchanged.
  • No new module dependency: glab does not import the endpoint-agent-platform Go module — it only downloads the binary at runtime.

Changes

Area Change
internal/binarymgr/binaries/agent.go New AgentCLI() Spec (linux-only, raw binary)
internal/binarymgr/passthrough.go New shared helper — Flags, SplitFlags, HelpOnly, NewRunner
internal/commands/orbit/orbit.go Rewired to the shared helper (dropped its duplicated copy, ~68 lines)
internal/commands/agent/ New command: agent.go, unix/windows executors, update subcommand
internal/config/schema.go New minder_cli_* config keys (mirror orbit_cli_*)
internal/commands/root.go Register glab minder
docs/source/**, README.md Regenerated via make gen-docs

De-duplication: the pass-through flag-splitting logic (Flags, SplitFlags, HelpOnly, NewRunner) is extracted into internal/binarymgr/passthrough.go and shared by both agent and orbit instead of being copied per command (addresses the review's code-duplication finding; orbit keeps its own executor wiring). glab duo cli still has its own inline split and is intentionally left untouched here to keep this MR focused; a follow-up can migrate it onto the shared helper.

Naming

The user-facing display name is "GitLab Endpoint Agent Platform" (not "security client"): the platform serves both security and governance use cases, and the neutral name avoids confusion with GitLab Duo Agent. The command (glab minder), config keys (minder_cli_*), and package name (agent-client) are unchanged.

Tests

  • Spec: AssetName, NormalizeArch (linux amd64/arm64 + unsupported-platform errors), InstalledName.
  • Command: flag splitting, agent-prefix prepend, validate() mutual-exclusion errors, runHelp() installed-vs-missing branches.
  • go build ./..., go test, go vet, and the repo comment-overlap gate all pass. orbit tests still pass after the refactor.

Verified end-to-end (Linux)

Built glab from this branch and ran it in a Linux container against the live public registry:

  • glab minder --install --yes → downloaded agent-client v0.0.15, checksum verified, installed.
  • glab minder version → v0.0.15 (confirms the agent-prefix pass-through).
  • glab minder help / glab minder hook --help → binary's own command tree, forwarded correctly.
  • glab minder update --yes → "already using the latest compatible version".
  • A darwin build refused with "unsupported platform: operating system darwin (supported: [linux])".

Review notes

  • The binary is not signed yet (Linux is unaffected by signing; signing is tracked separately). This command is gated to Linux for now.
  • Supersedes the earlier direct-import approach in !4113 (closed) (which linked the endpoint-agent-platform module into glab); this binarymgr approach keeps the private module out of glab entirely.

Related: gitlab-org/gitlab#627904. The public generic package it downloads is published by endpoint-agent-platform!29 (merged).

Edited by Mher Tolpin

Merge request reports

Loading
Loading