Upm
⠕ Universal Package Manager - Python, Node.js, Ruby, Emacs Lisp.
Install / Use
/learn @replit/UpmREADME
UPM
UPM is the Universal Package Manager. It allows you to manage packages for any (supported) programming language through the same interface following the principle of least astonishment. At Repl.it, we use UPM to provide deep package manager integration for many different programming languages using the same infrastructure.
UPM does not implement package management itself. Instead, it runs a package manager for you. The value added is:
- you don't have to figure out whether to use Pip or Pipenv or Poetry to manage your Python packages or wade into the Cabal-versus-Stack holy war in Haskell-land
- you don't have to puzzle out why
pip search flaskdoesn't return Flask in the search results - you don't have to debug Bundler silently dropping your command-line options if you don't specify them in the right (undocumented) order
- you don't have to think about why the developers of NPM and Yarn
decided to implement two completely different and mutually
incompatible behaviors for
list --depth=0, neither of which is exactly what you want - you don't have to investigate what format the Yarn lockfile is in (turns out: almost YAML, but not quite)
- et cetera (I could go on all day)
In other words, UPM eliminates the need to remember a huge collection of language-specific package manager quirks and weirdness, and adds a few nifty extra features like dependency guessing and machine-parseable specfile and lockfile listing.
Supported languages
- Core:
upm add,upm remove,upm lock,upm install,upm list - Index:
upm search,upm info - Guess:
upm guess
| | core | index | guess | |-----------------------|------|-------|-------| | python-python3-uv | yes | yes | yes | | python-python3-pip | yes | yes | yes | | python-python3-poetry | yes | yes | yes | | nodejs-yarn | yes | yes | yes | | nodejs-pnpm | yes | yes | yes | | nodejs-npm | yes | yes | yes | | ruby-bundler | yes | yes | | | elisp-cask | yes | yes | yes | | dart-pub.dev | yes | yes | | | rlang | yes | yes | | | java | yes | yes | | | rust | yes | yes | | | dotnet | yes | yes | | | php | yes | yes | |
Installation
You have many options. UPM is a single binary with no dependencies, so you can install it anywhere. Tarballs are available on the releases page. Read on for instructions on installing via a package manager.
macOS
Available on Homebrew in a custom tap.
$ brew install replit/tap/upm
Debian-based Linux
.deb packages are available on the releases page.
RPM-based Linux
.rpm packages are available on the releases page.
Arch Linux
Soon to be available on the Arch User
Repository. Right now, you can clone this
repository and install with makepkg using the PKGBUILD in
packaging/aur.
Windows
Available on Scoop in the main bucket.
$ scoop install upm
Snappy
Soon to be available on the Snap Store. Right now, .snap packages are available on the releases page.
Docker
You can try out UPM right away in a Docker image based on Ubuntu that has all the supported languages and package managers already installed.
$ docker run -it --rm replco/upm
Additional tags are also available. replco/upm:full is the same as
the above, while replco/upm:light just has the UPM binary installed
to /usr/local/bin and none of the languages or package managers
installed. If you want to run a specific tagged release, rather than
the latest development snapshot, use e.g. replco/upm:1.0,
replco/upm:1.0-full, or replco/upm:1.0-light.
Quick start
Let's create a new Python project:
$ mkdir ~/python
$ cd ~/python
We'll start by adding Flask as a dependency. UPM will handle setting up the project for us:
$ upm -l python add flask
--> python3 -m poetry init --no-interaction
This command will guide you through creating your pyproject.toml config.
--> python3 -m poetry add flask
Creating virtualenv python-py3.7 in /root/.cache/pypoetry/virtualenvs
Using version ^1.1 for flask
Updating dependencies
Resolving dependencies... (0.6s)
Writing lock file
Package operations: 6 installs, 0 updates, 0 removals
- Installing markupsafe (1.1.1)
- Installing click (7.0)
- Installing itsdangerous (1.1.0)
- Installing jinja2 (2.10.1)
- Installing werkzeug (0.15.4)
- Installing flask (1.1.1)
UPM operates on a specfile and lockfile for each project. The
specfile says what your project's dependencies are in a human-readable
format, while the lockfile specifies exact versions for everything,
including transitive dependencies. For Python, the specfile is
pyproject.toml and the lockfile is poetry.lock:
$ ls
poetry.lock pyproject.toml
We don't have to read them ourselves, because UPM can handle that. Notice that UPM is now aware that our project uses Python, because of the files that were created:
$ upm list
name spec
----- ----
flask ^1.1
$ upm list -a
name version
------------ -------
click 7.0
flask 1.1.1
itsdangerous 1.1.0
jinja2 2.10.1
markupsafe 1.1.1
werkzeug 0.15.4
Let's search for another dependency to add:
$ upm search nose
--> python3 -c '<secret sauce>' nose
Name Description Version
----------------- ---------------------------------------------------------------------- -------
nose nose extends unittest to make testing easier 1.3.7
nose-detecthttp A nose plugin to detect tests making http calls. 1.1.0
nose-picker nose plugin that picks a subset of your unit tests 0.5.5
nose-progressive A testrunner with a progress bar and smarter tracebacks 1.5.2
nose-unittest UNKNOWN 0.1.1
nose-blockage Raise errors when communicating outside of tests 0.1.2
nose-watcher A nose plugin to watch for changes within the local directory. 0.1.3
nose-bisect A Nose plugin which allows bisection of test failures. 0.1.0
nose-printlog Print log to console in nose tests 0.2.0
nose-json A JSON report plugin for Nose. 0.2.4
nose-faulthandler Nose plugin. Activates faulthandler module for test runs. 0.1
nose-knows 0.2
nose-pagerduty PagerDuty alert plugin for nose 0.2.0
nose-logpertest Logging nose plugin to create log per test 0.0.1
nose-bleed A progressive coverage plugin for Nose. 0.5.1
nose-numpyseterr Nose plugin to set how floating-point errors are handled by numpy 0.1
nose-skipreq nose plugin that will skip Google API RequestError exceptions. 2.0
nose-selecttests Specify whitelist of keywords for tests to be run by nose 0.5
nose-pacman A testrunner with a pacman progress bar 0.1.0
nose-switch Add special switches in code, based on options set when running tests. 0.1.5
We can get more information about a package like this:
$ upm info nose
--> python3 -c '<secret sauce>' nose
Name: nose
Description: nose extends unittest to make testing easier
Version: 1.3.7
Homepage: http://readthedocs.org/docs/nose/
Author: Jason Pellerin <jpellerin+nose@gmail.com>
License: GNU LGPL
For piping into other programs, the search and info commands can
also output JSON:
$ upm info nose --format=json | jq
--> python3 -c '<secret sauce>' nose
{
"name": "nose",
"description": "nose extends unittest to make testing easier",
"version": "1.3.7",
"homepageURL": "http://readthedocs.org/docs/nose/",
"author": "Jason Pellerin <jpellerin+nose@gmail.com>",
"license": "GNU LGPL"
}
UPM can also look at your project's source code and guess what packages need to be installed. We use this on Repl.it to help developers get started faster. To see it in action, we'll need some source code:
$ git clone https://github.com/replit/play.git ~/play
$ cd ~/play
$ upm add --guess
--> python3 -c '<secret sauce>' '<secret sauce>'
--> python3 -m poetry init --no-interaction
This command will guide you through creating your pyproject.toml config.
--> python3 -m poetry add pygame pymunk setuptools
Creating virtualenv play-py3.7 in /root/.cache/pypoetry/virtualenvs
Using version ^1.9 for pygame
Using versi
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
