glab-variable-import(1)

glab-variable-import1

Import variables from a json file or standard input.

Usage

glab variable import [flags]

Overview

The inverse of glab variable export. Reads a JSON array of variable objects, in the same shape export --output json emits.

The command:

•

Reads from standard input, or from a file with --input-file.

•

Imports into the current project by default. Use --group to import into a group instead.

•

Stops with an error if a variable already exists. Pass --skip-existing to skip those and continue.

Hidden variables' values aren't included in export output, so re-importing one is skipped with a warning. Set its value again with glab variable set --hidden.

Options

-g, --group=""
Select a group or subgroup. Ignored if a repository argument is set.

-i, --input-file=""
Read the variables JSON from this file instead of standard input.

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

--skip-existing[=false]
Skip variables that already exist instead of failing.

Options inherited from parent commands

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

Examples

# Pipe an export straight into an import, to restore the same project
glab variable export | glab variable import
# Import variables from a saved file instead of standard input
glab variable import --input-file variables.json
# Import into a group instead of the current project
glab variable export --group gitlab-org | glab variable import --group gitlab-org
# Skip variables that already exist instead of failing
glab variable import --input-file variables.json --skip-existing

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