glab(1)

πŸ“¦
version 1.128.0 Β· 3 versions
, in arch rolling

πŸ’… glab-variable-import β€” the glow-up guide

okay bestie so you're holding the manual page for glab-variable-import, which lives in the glab(1) family of man pages. Think of it as the ✨reverse✨ of exporting β€” you're putting your variables back in. Let's get into it πŸŽ€


πŸ¦‹ NAME

glab-variable-import β€” literally the command that imports variables from a JSON file or from standard input. That's it, that's the vibe πŸ’–


✨ SYNOPSIS

glab variable import [flags]

short, sweet, iconic πŸ‘‘


🌸 DESCRIPTION

So it's the inverse of glab variable export, right? It reads a JSON array of variable objects β€” and ngl, it's the exact same shape that export --output json emits, so you can round-trip that data no problem 🫢

Here's what the command actually does, step by step:

  • It reads from standard input, or from a file if you pass --input-file πŸ“₯
  • By default it imports into the current project. Wanna go into a group instead? Use --group β€” easy πŸ’…
  • If a variable already exists, it stops with an error. Not ideal? Pass --skip-existing and it'll skip those and keep going πŸƒβ€β™€οΈ
⚠️ okay important one: hidden variables' values aren't included in export output, so if you try to re-import a hidden one, it gets skipped with a warning. To set its value again you gotta do glab variable set --hidden 😭 no cap, that's just how it is.

πŸŽ€ OPTIONS

  • -g, --group="" β€” pick a group or subgroup to target. Heads up: this is 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, go off πŸ”₯
  • --skip-existing[=false] β€” skip variables that already exist instead of straight-up failing πŸ’€

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS

  • -h, --help[=false] β€” show help for this command. the classic 🫢

⭐ 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

the pipe-into-pipe one is so satisfying, main character energy fr fr 🌈


🧚 SEE ALSO


and that's the whole page, bestie ✨ this beauty was auto generated by spf13/cobra and dated Nov 2026 β€” that's the source/version and date energy right there, stamped on the glab(1) footer. now go import those variables, slay πŸ’…πŸ’–

πŸ“¦ where this page comes from