Skip to content

GitLab

Use GitLab's Generic Package Registry to host multiple artifacts in a single project.

Authentication

You need a GitLab personal access token with the required scopes before configuring the registry.

OperationScope
Downloadread_api
Publishapi
bash
grekt config registry set @myteam

See Authentication.

Configuration

Create .grekt/config.yaml in your project:

yaml
registries:
  "@myteam":
    type: gitlab
    project: myteam/artifacts

For self-hosted GitLab:

yaml
registries:
  "@company":
    type: gitlab
    host: gitlab.company.com
    project: platform/shared-artifacts

Fields

FieldRequiredDescription
typeYesMust be gitlab
projectYesGitLab project path or ID (e.g., group/project or 1413)
hostNoGitLab host (default: gitlab.com)
tokenNoAccess token (prefer grekt config registry set)
prefixNoPackage name prefix for monorepo organization (immutable after first publish)

Usage

bash
# Install
grekt add @myteam/agent-tools
grekt add @myteam/agent-tools@2.0.0

# List versions
grekt versions @myteam/agent-tools

# Get info
grekt info @myteam/agent-tools

Publishing

To publish artifacts to a GitLab registry, see Publishing. grekt routes to the correct registry based on the scope in your artifact's name.

Multiple registries

yaml
registries:
  "@frontend":
    type: gitlab
    project: frontend/artifacts
  "@backend":
    type: gitlab
    project: backend/artifacts
    host: gitlab.internal.com

Each scope resolves to its own GitLab project:

bash
grekt add @frontend/components  # → frontend/artifacts
grekt add @backend/api-tools    # → backend/artifacts

Monorepo organization

Use prefix to organize multiple scopes within a single GitLab project:

yaml
registries:
  "@sesame-frontend":
    type: gitlab
    project: sesame/artifacts
    prefix: frontend
  "@sesame-backend":
    type: gitlab
    project: sesame/artifacts
    prefix: backend

This creates packages with the prefix in the registry:

ArtifactPackage name in GitLab
@sesame-frontend/utilsfrontend-utils
@sesame-backend/apibackend-api

Both scopes share the same GitLab project while avoiding naming collisions.

Immutable after first publish

Once you publish with or without a prefix, you cannot change it. Adding, removing, or modifying the prefix will cause grekt to look for different package names in the registry.

If you need to change the prefix, you must rename the packages in your registry manually.

How it works

grekt uses GitLab's Generic Package Registry:

https://gitlab.com/api/v4/projects/:id/packages/generic/:name/:version/artifact.tar.gz

Versions are immutable once published.


Source mode

Alternatively, use a GitLab repository directly as an artifact (one artifact per repo).

bash
# gitlab.com
grekt add gitlab:owner/repo
grekt add gitlab:owner/repo#v1.0.0

# Self-hosted
grekt add gitlab:gitlab.company.com/owner/repo

For private repositories:

bash
grekt config token set gitlab.company.com

Limitations

Source mode only supports one artifact per repository. No version listing, no deprecation, no grekt info.