Feature Request: Exporting ci/cd variables for a project or group

Problem to solve

  • Editing a lot of ci/cd variables for a project or group is cumbersome.
  • As a CLI user I want to export all (or paginated subset) ci/cd variables to the json format.
  • The output can be used to transform the json with tools like "jg" to a local ini file or just used as is, for local development.
  • The ouput can be stored locally and editeted in batch.
  • The next feature would be importing :)

Proposal

  • Create an "export" subcommand in the "variable" namespace
  • Allow pagination with cli options.
  • Just print indented json to the stdout, allow for handling the output yourself, pipeing it etc.

Further details

Proposed UI:

glab variable ex --help

Export project or group variables

USAGE
  glab variable export [flags]

ALIASES
  ex

FLAGS
  -g, --group string   Select a group/subgroup. This option is ignored if a repo argument is set.
  -p, --page int       Page number (default 1)
  -P, --per-page int   Number of items to list per page (default 100)

INHERITED FLAGS
      --help              Show help for command
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO or `GROUP/NAMESPACE/REPO` format or full URL or git URL

EXAMPLES
  glab variable export
  glab variable export --per-page 1000 --page 1

Links / references

Edited by madflow