Skip to main content
Version: 0.15 (glpkg CLI)

Your first publish

glpkg publish publishes the package in the current directory to the package registry of the GitLab project that the current Git repository belongs to.

Before you start​

  • A saved token with the api scope (Authentication).

  • git and the GitLab CLI glab installed. glpkg runs glab api projects/:id to find the project of the current repository.

  • The repository exists on GitLab and is the origin of your checkout. glpkg does not create projects. To create one, use glpkg repo create:

    glpkg repo create your-org/utils --path .
  • A scoped package name in package.json, for example @your-org/utils.

  • A clean working tree. Commit or stash your changes first (or pass --force).

1. Dry run​

glpkg publish --dry-run

This detects the project, applies any version bump, and runs npm publish --dry-run. Your manifest files are restored afterwards, so a dry run leaves the working tree unchanged.

2. Publish​

glpkg publish                 # publish the version in package.json
glpkg publish --bump patch # 1.2.3 → 1.2.4, then publish

After a successful publish, glpkg by default:

  1. Commits package.json with the message chore: release v<version>.
  2. Tags the commit v<version>.
  3. Runs git push and git push --tags.

To skip the Git steps:

glpkg publish --bump patch --git-tag false --push false

3. Install it elsewhere​

glpkg install @your-org/utils --group your-org

Pre-release channels​

glpkg publish beta --bump minor   # 1.2.3 → 1.3.0-beta.0, dist-tag "beta"
glpkg publish dev # 1.2.3 → 1.2.3-dev.<timestamp>, dist-tag "dev"

See glpkg publish for all options.