glab(1)
π 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-existingand it'll skip those and keep going πββοΈ
β οΈ okay important one: hidden variables' values aren't included inexportoutput, so if you try to re-import a hidden one, it gets skipped with a warning. To set its value again you gotta doglab 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 eitherOWNER/REPOorGROUP/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
glab-variable(1)β go read the parent, iykyk π
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
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms