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>
| Before | Now |
|---|---|
~/.config/gitlab-config/token | ~/.config/glpkg/token |
GITLAB_AUTH_TOKEN | GITLAB_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
.npmrclines that point a scope at GitLab or set_authToken. glpkg never needs a project.npmrc.
Command map
| gitlab-* CLIs | glpkg |
|---|---|
gitlab-config save <token> | glpkg config save <token> |
gitlab-config get / check / remove | glpkg config get / check / remove |
gitlab-install add @org/pkg | glpkg install @org/pkg --group <group> (first time; later from the lock) |
gitlab-install add @org/pkg -D | glpkg install @org/pkg -D --group <group> |
gitlab-install add @org/cli -g | glpkg 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-publish | glpkg publish |
gitlab-publish --bump patch | glpkg publish --bump patch |
gitlab-publish dev / beta | glpkg publish dev / beta |
gitlab-publish --dry-run | glpkg publish --dry-run |
gitlab-publish --git-tag false --push false | glpkg 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
.npmrcchanges. 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 repoandglpkg registryare new. - CI. Set
GITLAB_TOKENinstead ofGITLAB_AUTH_TOKEN; see GitLab CI.
The old documentation stays available as the legacy docs.