glab-cluster-agent-get-token(1)

glab-cluster-agent-get-token1

Create a personal access token for a gitlab agent for kubernetes.

Usage

glab cluster agent get-token [flags]

Overview

The token has the k8s_proxy scope and is valid until the end of the current day.

You might receive an email from your GitLab instance that a new personal access token has been created.

Options

-a, --agent=0
The numerical Agent ID to connect to.

-c, --cache-mode="force-keyring"
Mode to use for caching the token. Allowed values: keyring-filesystem-fallback, force-keyring, force-filesystem, no.

--check-revoked[=false]
Check if a cached token is revoked. This requires an API call to GitLab which adds latency every time a cached token is accessed.

--jq=""
Filter JSON output with a jq expression.

--token-expiry-duration=24h0m0s
Duration for how long the generated tokens should be valid for. Minimum is 1 day and the effective expiry is always at the end of the day, the time is ignored.

Options inherited from parent commands

-h, --help[=false]
Show help for this command.

-R, --repo=""
Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.

Examples

# Get a token for agent 123
glab cluster agent get-token --agent 123

Releases

2 releases since Debian 13 (Trixie); the text changed 1 time.

  1. 13
  2. Arch

From glab 1.126.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.