LinuxCommandLibrary

haxelib

Manage Haxe libraries

TLDR

Search for a Haxe library

$ haxelib search [keyword]
copy

Install a Haxe library
$ haxelib install [libname]
copy

Install a specific version of a Haxe library
$ haxelib install [libname] [version]
copy

Upgrade all installed Haxe libraries
$ haxelib upgrade
copy

Install the development version of a library from a Git repository
$ haxelib git [libname] [git_url]
copy

Uninstall a Haxe library
$ haxelib remove [libname]
copy

Print a tree of locally installed Haxe libraries
$ haxelib list
copy

SYNOPSIS

haxelib command [options] [arguments]

PARAMETERS

help [command]
    Display usage information, or help for specific command

install lib [version]
    Download and install library from repository

uninstall lib
    Remove an installed library

list [-r|--required]
    List installed libraries, optionally with dependencies

remove lib
    Remove library from repository (alias for uninstall)

search keyword [-r]
    Search libraries by keyword, -r for remote repo

info lib
    Show detailed info on library (version, tags, etc.)

path lib
    Print absolute path to installed library

dev lib [path] [--always] [--global]
    Set library to development version from local path

git lib url [branch]
    Install library from Git repository

hg lib url [branch]
    Install library from Mercurial repository

svn lib url [revision]
    Install library from Subversion repository

run lib [args...]
    Execute main class provided by library

test lib
    Run library tests

newrepo [path]
    Initialize a new local library repository

version
    Print haxelib version

config [var]
    Print or set configuration variables

clone lib url [version] [dest]
    Clone library source from VCS

upgrade [libs...]
    Update listed or all libraries

outdated
    List libraries with newer versions available

repair
    Repair repository integrity

user [name]
    Get or set current Haxe user

set dir value
    Set repository directory

lock project.hxml
    Lock dependencies for project

unlock project.hxml
    Unlock project dependencies

DESCRIPTION

Haxelib is the official command-line package manager for the Haxe programming language, enabling developers to discover, install, update, and manage libraries across Haxe's multi-target compilation ecosystem (web, desktop, mobile, servers). It maintains a local repository of Haxe libraries (.haxelib files), handles dependencies, and supports integration with version control systems like Git, Mercurial, and SVN for development versions.

Users interact via subcommands to search the central repository at lib.haxe.org, install libraries by name or URL, list installed packages with dependency trees, remove or upgrade them, and query paths for compiler use (e.g., -lib flag in haxe). Haxelib also allows running library-provided executables, setting development modes, creating custom repositories, and configuring global settings. It tracks library metadata like versions, authors, and licenses, essential for reproducible builds and project portability.

Installed with the Haxe Toolkit, haxelib simplifies dependency resolution, avoiding manual downloads, and supports project-specific locks for stable CI/CD pipelines. It's lightweight, cross-platform, and crucial for Haxe workflows.

CAVEATS

Requires Haxe installation; default repo at https://lib.haxe.org. Custom repos need newrepo. Version conflicts possible without dev or locks. Not for binary deps.

DEFAULT LOCATION

Repo usually at ~/.haxelib or haxelib config to check.

COMPILER INTEGRATION

Use -lib libname in haxe to include libraries automatically.

HISTORY

Introduced in Haxe 2.0 (2006) by Nicolas Cannasse. Evolved with Haxe 3+ for VCS support, dependency resolution, and project locks. Central to Haxe 4.x ecosystem, with ongoing updates via Haxe releases.

SEE ALSO

haxe(1)

Copied to clipboard