sincecutoff.com
← all changes

glab adds a variable import command

Introduced 2026-07-21 · score 0.97

HOW TO USE IT

When importing project or group CI/CD variables, provide a JSON array in the shape emitted by `glab variable export --output json`; use `--input-file` for a file or pipe JSON on standard input. By default, import targets the current project and errors if a variable already exists; use `--skip-existing` to continue past existing variables.

glab variable import --input-file variables.json
glab variable import --input-file variables.json --skip-existing
glab variable export --group <group> | glab variable import --group <group>

WHY THIS HELPS

Import variables for a repository using glab.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.109.0
  • --input-file <file>: Read JSON from this file instead of standard input.
  • --group <group>: Select a group or subgroup; ignored if a repository argument is set.
  • --repo <repository>: Select another repository using OWNER/REPO, GROUP/NAMESPACE/REPO, a full URL, or a Git URL.
  • --skip-existing: Skip existing variables instead of stopping with an error.
  • Prerequisite: Provide a JSON array of variable objects in the same shape as `glab variable export --output json`; input may come from standard input or `--input-file`.
  • Prerequisite: Install glab and authenticate with GitLab; the CLI getting-started docs list these setup steps.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card