glab(1) glab(1)

glab-variable-import - Import variables from a JSON file or standard input.

glab variable import [flags]

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.

-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.

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

# 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

glab-variable(1)

Jul 2026 Auto generated by spf13/cobra