---
name: "glab-variable-import"
section: "1"
platform: "linux"
package: "glab"
version: "1.126.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/glab-variable-import"
---

# glab-variable-import(1)

Import variables from a JSON file or standard input.

## NAME

glab-variable-import - 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
```

## SEE ALSO

**[glab-variable(1)](/glab-variable/1.md)**
