glab-variable-import - Man Page
Import variables from a JSON file or standard input.
Synopsis
glab variable import [flags]
Description
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.
Example
# 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