langpkg
Manages one language-ecosystem package per declaration via pip, npm, or gem — distinct from the OS-level package module. Idempotent: re-applying an unchanged declaration reports no change.
Category: Files & VCS
States
| State | Meaning |
|---|---|
present | The package is installed. With version set, exactly that version must be installed; otherwise any installed version satisfies. |
absent | The package is not installed; an installed package is removed. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Package name (npm scoped names like @types/node are accepted). |
manager | string | yes | Language toolchain: pip, npm, or gem. No cross-ecosystem auto-detect. |
version | string | Strict-equality version pin (state present only). Unset means any installed version satisfies. Invalid with absent. |
Examples
Pin a Python package version
langpkg:
gunicorn-pin:
state: present
name: gunicorn
manager: pip
version: "21.2.0"Install a global npm tool, remove a gem
langpkg:
pm2:
state: present
name: pm2
manager: npm
old-bundler:
state: absent
name: bundler
manager: gemNotes
- Module maturity: experimental.
- Installs are system-wide / global only (
pip install,npm install -g,gem install). - Version matching is strict-equality; semver ranges and constraints are out of scope.
- Out of scope: per-user / per-project installs, lockfile-driven installs, PEP-668
--break-system-packages, manager-option pass-through, and additional ecosystems (cargo, composer, mvn/gradle, go install).