Getting Started
This guide will help you set up glpkg tools for your project.
Prerequisites
- Node.js 14.0.0 or higher
- npm or yarn
- GitLab account with access to package registry
Installation
Install the glpkg tools globally:
npm install -g @glpkg/installer @glpkg/publisher @glpkg/config
Or install them as dev dependencies in your project:
npm install -D @glpkg/installer @glpkg/publisher @glpkg/config
GitLab Token Setup
1. Create a Personal Access Token
- Go to GitLab → Settings → Access Tokens
- Create a new token with the following scopes:
api- Full API accessread_registry- Read package registrywrite_registry- Write package registry (for publishing)
- Copy the generated token
2. Configure the Token
gitlab-config save YOUR_GITLAB_TOKEN
This securely stores the token in ~/.config/gitlab-config/token with restricted permissions (0600).
For CI/CD Pipelines
In CI/CD environments, use the GITLAB_AUTH_TOKEN environment variable:
# GitLab CI example
variables:
GITLAB_AUTH_TOKEN: $CI_JOB_TOKEN
Verify Setup
Test your configuration:
# Check if token is configured
gitlab-config check
# Show token (masked)
gitlab-config get
# Dry run a publish to verify setup
gitlab-publish --dry-run
Project Structure
A typical project using glpkg might have:
your-project/
├── .gitlab-packages.json # Registry configuration (auto-generated)
├── package.json
└── src/
Next Steps
- Learn how to install packages from GitLab
- Learn how to publish packages to GitLab
- Learn about configuration management