IronSledDocs
How-Tos

Create a GitLab Personal Access Token

How to create a GitLab Personal Access Token (PAT) for IronSled — recommended scopes (read_user, read_repository, read_api, write_repository, api), setting an expiration, copying the token before it disappears, and persisting GITLAB_TOKEN in your shell so Git over HTTPS and the GitLab API authenticate as you.

A GitLab Personal Access Token (PAT) authenticates you to the GitLab API and to Git over HTTP on IronSled. Once Two-Factor Authentication (2FA) is enabled on your account, a PAT is the only accepted password — IronSled GitLab connections use HTTPS with a PAT, not SSH. Create a PAT once, give it the scopes you need, and store it in your shell so Git and the API can use it automatically.

Create the Token

Create a PAT from your GitLab profile:

  1. Open Preferences → Access Tokens → Add new token.
  2. Give the token a name that identifies where you use it.
  3. Set an expiration date — an administrator sets the maximum lifetime allowed.
  4. Select the scopes you need (see Recommended Scopes below).
  5. Click Generate token and copy the value immediately — GitLab shows the token only once and you cannot retrieve it afterward.

If you lose the token value, you cannot recover it — create a new token and revoke the old one.

Scopes control what a Personal Access Token is allowed to do. A typical developer token enables the following:

ScopePurpose
read_userRead-only access to your profile via the /user API endpoint.
read_repositoryRead-only access to repositories over Git-over-HTTP / the Repository Files API.
read_apiRead access to the API, including groups, projects, the container registry, and the package registry.
write_repositoryRead-write access to repositories over Git-over-HTTP (needed to push).
apiComplete read-write API access (groups, projects, container registry, dependency proxy, package registry).

Leave self_rotate, ai_features, create_runner, manage_runner, and k8s_proxy unchecked unless you specifically need them. Grant the narrowest set of scopes that lets you do your work.

Persist the Token in Your Shell

Add the token to your shell profile (~/.bashrc or ~/.zshrc) so it persists across sessions:

export GITLAB_TOKEN="your-pat-value"
export GITLAB_USERNAME="first.last"   # Match your GitLab username

Reload your shell so the change takes effect:

source ~/.zshrc   # or: source ~/.bashrc

With GITLAB_TOKEN set, you can clone and push over HTTPS and call the GitLab API without re-entering the token each time. Treat the token like a password: never commit it to Git, paste it into a chat, or share it. If it is ever exposed, revoke it under Preferences → Access Tokens and generate a new one.

Edit

On this page