Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chainguard-dev/melange/llms.txt

Use this file to discover all available pages before exploring further.

melange is a declarative APK package builder. You describe your package in a YAML configuration file and melange handles fetching sources, running the build pipeline, linting the output, and assembling the final .apk artifact. The CLI is organized into focused subcommands — each does one thing well and composes cleanly with the others.

Global flag

Every melange command inherits the --log-level flag from the root command:
melange --log-level debug build package.yaml
FlagDefaultDescription
--log-levelINFOLog verbosity: debug, info, warn, or error

All commands

build

Build an APK package from a YAML pipeline configuration file. The primary melange workflow.

test

Run a dedicated test pipeline against a built package inside a sandboxed environment.

lint

Lint an existing .apk file against a configurable set of quality and correctness checks.

keygen

Generate an RSA key pair (.rsa / .rsa.pub) used to sign packages and indexes.

sign

Sign individual .apk package files on disk with an RSA private key.

sign-index

Sign an APKINDEX.tar.gz repository index file.

index

Create or update an APKINDEX.tar.gz repository index from a collection of APK files.

bump

Update the version (and reset epoch) in a melange YAML file to a new upstream release.

query

Extract arbitrary fields from a melange YAML using Go template syntax — useful in CI scripts.

convert

Auto-generate melange YAML from Alpine APKBUILD files, Ruby gems, or Python PyPI packages.

compile

Compile a YAML configuration file without executing the build runner.

scan

Scan an existing APK file and regenerate its .PKGINFO metadata.

source

Manage source code: extract sources (get) or generate patches from modified source (pop).

update-cache

Pre-populate the melange source artifact cache from a YAML config.

package-version

Print the full name-version-rEPOCH string for a package config (shorthand for query).

license-check

Gather and check licensing data for a melange source, source tree, or APK file.

version

Print the melange binary version. Use --json for machine-readable output.

completion

Generate shell completion scripts for bash, zsh, fish, or PowerShell.

initramfs

Build a base initramfs image used by the QEMU runner for cross-architecture builds.

Quick-start workflow

The typical end-to-end package publishing flow uses four commands:
# 1. Generate a signing key (one-time setup)
melange keygen local-melange.rsa

# 2. Build the package
melange build package.yaml --signing-key local-melange.rsa --arch x86_64,aarch64

# 3. Create the repository index
melange index -o packages/x86_64/APKINDEX.tar.gz packages/x86_64/*.apk

# 4. Sign the index
melange sign-index --signing-key local-melange.rsa packages/x86_64/APKINDEX.tar.gz

Getting help

Every subcommand accepts -h / --help to print its usage:
melange --help
melange build --help
melange convert --help

Build docs developers (and LLMs) love