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.
| Operation | Scope |
|---|---|
| Download | read_api |
| Publish | api |
grekt config registry set @myteamSee Authentication.
Configuration
Create .grekt/config.yaml in your project:
registries:
"@myteam":
type: gitlab
project: myteam/artifactsFor self-hosted GitLab:
registries:
"@company":
type: gitlab
host: gitlab.company.com
project: platform/shared-artifactsFields
| Field | Required | Description |
|---|---|---|
type | Yes | Must be gitlab |
project | Yes | GitLab project path or ID (e.g., group/project or 1413) |
host | No | GitLab host (default: gitlab.com) |
token | No | Access token (prefer grekt config registry set) |
prefix | No | Package name prefix for monorepo organization (immutable after first publish) |
Usage
# 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-toolsPublishing
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
registries:
"@frontend":
type: gitlab
project: frontend/artifacts
"@backend":
type: gitlab
project: backend/artifacts
host: gitlab.internal.comEach scope resolves to its own GitLab project:
grekt add @frontend/components # → frontend/artifacts
grekt add @backend/api-tools # → backend/artifactsMonorepo organization
Use prefix to organize multiple scopes within a single GitLab project:
registries:
"@sesame-frontend":
type: gitlab
project: sesame/artifacts
prefix: frontend
"@sesame-backend":
type: gitlab
project: sesame/artifacts
prefix: backendThis creates packages with the prefix in the registry:
| Artifact | Package name in GitLab |
|---|---|
@sesame-frontend/utils | frontend-utils |
@sesame-backend/api | backend-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.gzVersions are immutable once published.
Source mode
Alternatively, use a GitLab repository directly as an artifact (one artifact per repo).
# gitlab.com
grekt add gitlab:owner/repo
grekt add gitlab:owner/repo#v1.0.0
# Self-hosted
grekt add gitlab:gitlab.company.com/owner/repoFor private repositories:
grekt config token set gitlab.company.comLimitations
Source mode only supports one artifact per repository. No version listing, no deprecation, no grekt info.
Related
- Overview - Registries overview
- GitHub - GitHub source
- Authentication - Full auth guide