Metadata-Version: 2.4
Name: gitlab-generic
Version: 1.0.0
Summary: GitLab Generic Package Registry tools
Project-URL: Repository, https://gitlab.com/cyberassessmentlabs/public/tools/gitlab-generic
Project-URL: Documentation, https://cyberassessmentlabs.gitlab.io/public/docs/gitlab-generic/latest
Author: Cyber Assessment Labs
License-Expression: MIT
License-File: LICENSE
Keywords: generic,gitlab,packages,registry
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# gitlab-generic

A command-line tool for managing files in GitLab's Generic Package Registry.

GitLab provides a built-in Generic Package Registry for hosting arbitrary files (tarballs, binaries, zips, etc.), but the web UI for browsing and managing packages is limited. gitlab-generic gives you a fast, readable CLI for listing packages, inspecting versions, and downloading or uploading files — all via the GitLab REST API.

## Features

- **List packages** — see all packages at a glance, with version counts and latest stable version
- **Show versions** — view all versions for one or more packages, with file details and pre-release filtering
- **Download** — fetch files from the registry by package name and version
- **Upload** — publish files with auto-detected or explicit package name and version
- **Delete** — remove a package version from the registry
- **Multiple output formats** — coloured tables (default), `--plain` for scripting, or `--json` for machine-readable output

Zero external dependencies — uses only the Python 3.12+ standard library.

## Installation

```bash
pip install gitlab-generic
```

## Configuration

Create a config file at `~/.config/gitlab-generic/config.json`:

```json
{
  "url": "https://gitlab.com",
  "project": "my-group/my-project",
  "token": "glpat-xxxxxxxxxxxx"
}
```

Or pass these as CLI flags (`--url`, `--project`, `--token`) on each command.

## Usage

```bash
# List all packages in the registry
gitlab-generic list

# Show versions for a package (stable only by default)
gitlab-generic show my-package

# Show all versions including pre-releases
gitlab-generic show my-package --all

# Plain output for scripting
gitlab-generic show my-package --plain

# Download the latest stable version's files
gitlab-generic download my-package

# Download a specific version
gitlab-generic download my-package==1.2.3

# Download all versions of a package
gitlab-generic download my-package --all

# Upload files (name and version auto-detected from filenames)
gitlab-generic upload calrep-0.29.0-*.tar.gz

# Upload with explicit name and version
gitlab-generic upload dist/app.tar.gz --name my-package --version 1.0.0

# Delete a specific version
gitlab-generic delete my-package==1.0.0
```

## Development

```bash
make dev        # Create dev environment
make check      # Run ruff + pyright
make format     # Auto-fix and format code
make build      # Build wheel + docs
make docs       # Build HTML documentation
```

## Licence

MIT License — Copyright (c) 2026 Cyber Assessment Labs
