{"id":15055514,"url":"https://github.com/temando/gitlab-ci-variables-cli","last_synced_at":"2025-04-10T03:53:10.848Z","repository":{"id":57152512,"uuid":"100571932","full_name":"temando/gitlab-ci-variables-cli","owner":"temando","description":"CLI tool to allow setting bulk project variables on Gitlab CI","archived":false,"fork":false,"pushed_at":"2023-06-02T17:58:37.000Z","size":157,"stargazers_count":40,"open_issues_count":4,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T03:53:03.457Z","etag":null,"topics":["gitlab","gitlab-ci"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/temando.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T06:57:58.000Z","updated_at":"2024-02-27T07:55:08.000Z","dependencies_parsed_at":"2024-12-04T05:42:49.057Z","dependency_job_id":null,"html_url":"https://github.com/temando/gitlab-ci-variables-cli","commit_stats":{"total_commits":37,"total_committers":5,"mean_commits":7.4,"dds":0.5135135135135135,"last_synced_commit":"96e33a76f81ef7019159c476b4bc8ec79ca89255"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fgitlab-ci-variables-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fgitlab-ci-variables-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fgitlab-ci-variables-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fgitlab-ci-variables-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temando","download_url":"https://codeload.github.com/temando/gitlab-ci-variables-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154998,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab","gitlab-ci"],"created_at":"2024-09-24T21:43:35.177Z","updated_at":"2025-04-10T03:53:10.829Z","avatar_url":"https://github.com/temando.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gitlab CI Variables Setter CLI\n\n[![NPM](https://img.shields.io/npm/v/gitlab-ci-variables-cli.svg)](https://npmjs.org/packages/gitlab-ci-variables-cli/)\n[![Travis CI](https://img.shields.io/travis/temando/gitlab-ci-variables-cli.svg)](https://travis-ci.org/temando/gitlab-ci-variables-cli)\n[![MIT License](https://img.shields.io/github/license/temando/gitlab-ci-variables-cli.svg)](https://en.wikipedia.org/wiki/MIT_License)\n\nCLI tool to allow setting/getting pipeline variables on Gitlab CI.\n\nSupports Gitlab API v4, available since Gitlab 9.0.\n\n## Installation\n\nInstall the tool globally for ease of use, by running the following command\n\n```sh\n$ npm install -g gitlab-ci-variables-cli\n```\n\n## Usage\n\n### Set one variable (`glci set`)\n\nRun the following command, where:\n\n- `gitlab-token` is your Gitlab personal access token\n- `gitlab-project-url` is your project url on gitlab, e.g. https://gitlab.com/gitlab-org/gitlab-ce\n- `key` is the variable you want to set\n- `value` is the value of the variable you want to set\n\n```sh\n$ glci set --token \u003cgitlab-token\u003e --url \u003cgitlab-project-url\u003e --key \u003ckey\u003e --value \u003cvalue\u003e\nSet \u003ckey\u003e = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variable on Gitlab CI.\n```\n\n### Set several variables (`glci setAll`)\n\nPut all required variable key/values on a properties file named `gitlab.env.yml`, e.g:\n\n```yml\nAWS_CREDENTIALS: |\n    [canary]\n    aws_access_key_id = AKIA1234\n    aws_secret_access_key = verySecretKey\nNPM_INSTALL_TOKEN: 123456789\n```\n\n\u003e Note that the value for `AWS_CREDENTIALS` is a multi line string (with spaces and no tabs).\n\nRun the following command from the directory that contains the properties file.\n\n```sh\n$ glci setAll --token \u003cgitlab-token\u003e --url \u003cgitlab-project-url\u003e\nSet AWS_CREDENTIALS = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nSet NPM_INSTALL_TOKEN = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variables on Gitlab CI.\n```\n\n- `gitlab-token` is your Gitlab personal access token\n- `gitlab-project-url` is your project url on gitlab, e.g. https://gitlab.com/gitlab-org/gitlab-ce\n\n### Get all variables (`glci getAll`)\n\nDownload all variable key/value pairs to a properties file.\n\nRun the following command:\n```sh\n$ glci getAll --token \u003cgitlab-token\u003e --url \u003cgitlab-project-url\u003e --output result.yml\nDownloaded variables from Gitlab CI.\nSaved variables to result.yml\n```\n\n- `gitlab-token` is your Gitlab personal access token\n- `gitlab-project-url` is your project url on gitlab, e.g. https://gitlab.com/gitlab-org/gitlab-ce\n\n\u003e Note that if you do not specify `output`, then the properties file will be saved to `gitlab.env.yml` in the current directory.\n\n#### For all usages\n\n##### `--do-not-force`\n\nBy default, existing variables on Gitlab CI will be overridden. If you wish to ignore existing variables, add a `--do-not-force` option, e.g:\n\n```sh\n$ glci setAll --token \u003cgitlab-token\u003e --url \u003cgitlab-project-url\u003e --do-not-force\nSkipping AWS_CREDENTIALS, already set for gitlab-org/gitlab-ce.\nSkipping NPM_INSTALL_TOKEN, already set for gitlab-org/gitlab-ce.\nCompleted setting variables on Gitlab CI.\n```\n\n##### `--url`\n\nIf your working directory is a git repository of your project, the `--url` option can be omitted, e.g:\n\n```sh\n$ glci set --token \u003cgitlab-token\u003e --key \u003ckey\u003e --value \u003cvalue\u003e\nNo URL specified, using git remote `origin`.\nSet \u003ckey\u003e = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variable on Gitlab CI.\n```\n\n\u003e Omitting `--url` will derive the URL from the remote named `origin`.\n\n##### `--token`\n\nThis project supports `.gitlabrc` files using [rc](https://www.npmjs.com/package/rc).\nIf `--token` is not specified, this project can use a `.gitlabrc`, e.g:\n\n```ini\ntoken = this-is-my-gitlab-token\n```\n\n```sh\n$ glci setAll --url \u003cgitlab-project-url\u003e\nUsing token from .gitlabrc.\nSet AWS_CREDENTIALS = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nSet NPM_INSTALL_TOKEN = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variables on Gitlab CI.\n```\n\nAlternatively, you can also set a GITLAB_TOKEN environment variable:\n\n```sh\n$ export GITLAB_TOKEN=this-is-my-gitlab-token\n$ glci set --url \u003cgitlab-project-url\u003e --key \u003ckey\u003e --value \u003cvalue\u003e\nUsing token from environment variable GITLAB_TOKEN.\nSet \u003ckey\u003e = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variable on Gitlab CI.\n```\n\n---\n\nEssentially, if your project is a git repository, and you have a `.gitlabrc` file or a GITLAB_TOKEN env variable,\n this tool can be invoked simply as:\n\n```sh\n$ glci setAll\nUsing token from .gitlabrc.\nNo URL specified, using git remote `origin`.\nSet AWS_CREDENTIALS = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nSet NPM_INSTALL_TOKEN = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variables on Gitlab CI.\n```\n```sh\n$ glci set --key \u003ckey\u003e --value \u003cvalue\u003e\nUsing token from environment variable GITLAB_TOKEN.\nNo URL specified, using git remote `origin`.\nSet \u003ckey\u003e = \u003cvalue\u003e for gitlab-org/gitlab-ce.\nCompleted setting variable on Gitlab CI.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fgitlab-ci-variables-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemando%2Fgitlab-ci-variables-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fgitlab-ci-variables-cli/lists"}