A tool to scan GitLab groups and subgroups, list all repositories, detect monorepos, and fetch the latest tags or releases.
npx gitlab-repo-inspector [mode] [options]- Scans GitLab groups and subgroups recursively
- Fetches repository metadata including descriptions and latest tags
- Supports both GitLab.com and self-hosted GitLab instances
The tool automatically detects and analyzes monorepo structures:
pnpm Workspaces:
- Reads
pnpm-workspace.yamlto discover workspace packages - Extracts package information from
package.jsonfiles - Supports workspace patterns like
packages/*
Maven Projects:
- Parses
pom.xmlfiles to discover multi-module projects - Recursively analyzes nested modules
- Extracts artifact information and descriptions
Create a gitlab-repo-inspector.config.ts file to customize default settings:
import { defineConfig } from 'gitlab-repo-inspector'
export default defineConfig({
cwd: process.cwd(),
registry: 'https://gitlab.com',
apiVersion: 'v4',
projectType: 'pnpm',
token: 'access-token',
perPage: 500,
group: 'gitlab-group',
subgroups: true,
archived: false,
monorepo: true,
preRelease: false,
ignoreGroups: ['legacy'],
ignoreRepos: ['decrypted-repo'],
ignorePackages: ['internal-packages'],
ignorePatterns: ['playground', 'examples/*'],
json: 'gitlab-repo-inspector.json',
merge: false
})Configuration Options:
cwd: Current working directoryregistry: GitLab instance URLapiVersion: API version (default: 'v4')projectType: Project type ('pnpm' or 'maven')token: GitLab access tokenperPage: Number of repositories per page (default: 500)group: Default group to scansubgroups: Include subgroups in scan (default: true)archived: Include archived repositories (default: false)monorepo: Enable monorepo detection (default: true)preRelease: Include pre-release versions (default: true)ignoreGroups: Array of group names to ignoreignoreRepos: Array of repository names to ignoreignorePackages: Array of package names to ignoreignorePatterns: Array of monorepo patterns to ignorejson: Output JSON file name (default: 'gitlab-repo-inspector.json')merge: Merge with existing JSON file (default: false)
The tool requires a GitLab access token with appropriate permissions:
- Go to GitLab → Settings → Access Tokens
- Create a token with
read_repositoryandread_apiscopes - Provide the token via:
--tokencommand line option- Configuration file
- Interactive prompt (if not provided)
MIT License © jinghaihan
