Skip to main content
Version: 0.15 (glpkg CLI)

Migrating from the gitlab-* CLIs

The separate packages @glpkg/installer, @glpkg/publisher and @glpkg/config (commands gitlab-install, gitlab-publish, gitlab-config) are replaced by one CLI, glpkg, from @glpkg/cli. The old packages are deprecated and no longer maintained.

1. Swap the packages​

npm uninstall -g @glpkg/installer @glpkg/publisher @glpkg/config
npm install -g @glpkg/cli
glpkg --version

If you had them as dev dependencies, remove them from package.json as well.

2. Save your token again​

glpkg uses its own token file.

glpkg config save <token>
BeforeNow
~/.config/gitlab-config/token~/.config/glpkg/token
GITLAB_AUTH_TOKENGITLAB_TOKEN

Delete the old token file when you are done: rm ~/.config/gitlab-config/token.

3. Record your package sources​

The old installer guessed the registry from the package scope. glpkg requires an explicit source for every package, recorded in glpkg.lock.json:

glpkg lock init                                    # what has no source yet
glpkg lock set @your-org/a @your-org/b --group your-org
glpkg lock set react typescript --external
glpkg install
git add glpkg.lock.json && git commit -m "Record package sources"

Then delete the old files:

  • .gitlab-packages.json (glpkg does not read it)
  • any project .npmrc lines that point a scope at GitLab or set _authToken. glpkg never needs a project .npmrc.

Command map​

gitlab-* CLIsglpkg
gitlab-config save <token>glpkg config save <token>
gitlab-config get / check / removeglpkg config get / check / remove
gitlab-install add @org/pkgglpkg install @org/pkg --group <group> (first time; later from the lock)
gitlab-install add @org/pkg -Dglpkg install @org/pkg -D --group <group>
gitlab-install add @org/cli -gglpkg install -g @org/cli --group <group>
gitlab-install update [pkgs]glpkg install <pkg>@latest (sources from the lock), or glpkg install for the whole project
gitlab-publishglpkg publish
gitlab-publish --bump patchglpkg publish --bump patch
gitlab-publish dev / betaglpkg publish dev / beta
gitlab-publish --dry-runglpkg publish --dry-run
gitlab-publish --git-tag false --push falseglpkg publish --git-tag false --push false

What else changed​

  • Install sources are explicit. No guessing from the scope; a group that does not host a package is an error, not a fallback to npmjs. See Package sources.
  • No .npmrc changes. The old tools edited and restored your .npmrc. glpkg uses a temporary npm config file instead.
  • More ecosystems. PyPI, Go, NuGet and generic packages: guide.
  • Repositories and registry. glpkg repo and glpkg registry are new.
  • CI. Set GITLAB_TOKEN instead of GITLAB_AUTH_TOKEN; see GitLab CI.

The old documentation stays available as the legacy docs.