Documentation

Everything you need to know about rx-pro, the blazing-fast Python package manager.

Installation

rx-pro can be installed in several ways depending on your preference:

Quick Install (Recommended)

bash
curl -sSf https://raw.githubusercontent.com/get-rx/rx-pro/main/install.sh | bash

From PyPI

bash
pip install rx-pro

From Cargo

bash
cargo install pro-cli

Pre-built Binaries

Download pre-built binaries from GitHub Releases:

Platform Download
Linux (x86_64) rx-x86_64-unknown-linux-gnu.tar.gz
Linux (ARM64) rx-aarch64-unknown-linux-gnu.tar.gz
macOS (Intel) rx-x86_64-apple-darwin.tar.gz
macOS (Apple Silicon) rx-aarch64-apple-darwin.tar.gz
Windows (x86_64) rx-x86_64-pc-windows-msvc.zip

Quick Start

Get up and running with rx-pro in under a minute:

bash
# Create a new project rx init my-project cd my-project # Add dependencies rx add requests numpy pandas rx add flask@2.3.0 # Pin to specific version # Add dev dependencies rx add --dev pytest black ruff # Install everything rx sync # Run your code rx run python main.py

Project Setup

rx-pro uses the standard pyproject.toml file for configuration. When you run rx init, a new project is created with the following structure:

Project Structure
my-project/ ├── pyproject.toml # Project configuration ├── rx.lock # Lockfile (auto-generated) ├── .venv/ # Virtual environment ├── src/ │ └── my_project/ │ └── __init__.py └── tests/ └── test_main.py

Dependencies

Dependencies are specified in pyproject.toml under the [project.dependencies] section:

pyproject.toml
[project] name = "my-project" version = "1.0.0" requires-python = ">=3.8" dependencies = [ "requests>=2.28", "numpy>=1.24", "pandas>=2.0", ] [project.optional-dependencies] dev = [ "pytest>=7.0", "black>=23.0", "ruff>=0.1", ]

Lockfile

rx-pro generates a rx.lock file that pins exact versions of all dependencies for reproducible builds. This file should be committed to version control.

Tip: The lockfile is cross-platform compatible. The same lockfile works on Linux, macOS, and Windows.

Virtual Environments

rx-pro automatically manages virtual environments. By default, it creates a .venv directory in your project root. Use rx run to execute commands within the virtual environment.

rx init

Initialize a new Python project.

bash
rx init [project-name] rx init --lib # Create a library project rx init --app # Create an application project

rx add

Add dependencies to your project.

bash
rx add requests # Add latest version rx add requests@2.31.0 # Add specific version rx add "requests>=2.28,<3.0" # Add with constraints rx add --dev pytest # Add as dev dependency rx add --group test pytest # Add to specific group

rx remove

Remove dependencies from your project.

bash
rx remove requests rx remove --dev pytest

rx sync

Install all dependencies from the lockfile.

bash
rx sync # Install all dependencies rx sync --no-dev # Skip dev dependencies rx sync --frozen # Fail if lockfile is outdated

rx update

Update dependencies to their latest compatible versions.

bash
rx update # Update all dependencies rx update requests # Update specific package rx update requests@2.32.0 # Update to specific version

rx run

Run a command in the virtual environment.

bash
rx run python main.py rx run pytest rx run python -c "import numpy; print(numpy.__version__)"

rx build

Build distribution packages (wheel and sdist).

bash
rx build # Build wheel and sdist rx build --wheel # Build only wheel rx build --sdist # Build only sdist

rx publish

Publish your package to PyPI or a private registry.

bash
rx publish # Publish to PyPI rx publish --repository testpypi # Publish to TestPyPI

rx audit

Scan dependencies for security vulnerabilities.

bash
rx audit # Scan for vulnerabilities rx audit --fix # Auto-fix vulnerabilities

Security: rx-pro checks against the OSV database and PyPI advisory database for known vulnerabilities.

rx tool

Run Python tools in ephemeral environments without installing them in your project.

bash
rx tool black . # Run black formatter rx tool ruff check . # Run ruff linter rx tool httpie GET https://api.github.com

pyproject.toml Configuration

Complete example of rx-pro configuration:

pyproject.toml
[project] name = "my-project" version = "1.0.0" description = "My awesome project" requires-python = ">=3.8" dependencies = [ "requests>=2.28", "numpy>=1.24", ] [project.optional-dependencies] dev = ["pytest>=7.0", "black>=23.0"] [project.scripts] myapp = "my_project:main" [tool.rx] python-version = "3.11" [tool.rx.scripts] test = "pytest -v tests/" lint = "ruff check ." format = "black ."

Scripts

Define custom scripts in [tool.rx.scripts]:

pyproject.toml
[tool.rx.scripts] test = "pytest -v tests/" lint = "ruff check ." format = "black ." dev = "python -m uvicorn main:app --reload"

Run scripts with rx run <script>:

bash
rx run test rx run lint

Private Registries

Configure private package registries:

pyproject.toml
[[tool.rx.registries]] name = "private" url = "https://pypi.mycompany.com/simple/" username = "${PYPI_USER}" password = "${PYPI_PASS}"

Workspaces (Monorepo)

Manage multiple packages in a single repository:

bash
# Initialize workspace rx workspace init # Add projects rx workspace add packages/core rx workspace add packages/api rx workspace add packages/cli # Unified operations rx workspace sync # Install all dependencies rx workspace lock # Single lockfile rx run --affected test # Test only changed packages

WebAssembly Plugins

Extend rx-pro with sandboxed WebAssembly plugins:

pyproject.toml
[tool.rx.plugins] license-checker = "~/.rx/plugins/license-checker.wasm" custom-resolver = { path = "./plugins/resolver.wasm" }
bash
rx plugin add license-checker https://example.com/license-checker.wasm rx plugin run pre-build

Docker Integration

Generate optimized Dockerfiles for your Python projects:

bash
rx docker generate # Generate Dockerfile rx docker build --tag myapp:latest
pyproject.toml
[tool.rx.docker] base_image = "python:3.11-slim" apt_packages = ["curl", "git"] expose = [8000] cmd = ["python", "-m", "myapp"] multi_stage = true

Task Runner

Define complex task workflows with dependencies:

pyproject.toml
[tool.rx.tasks] test = { cmd = "pytest -v", depends_on = ["lint"] } lint = { cmd = "ruff check ." } format = { cmd = "black .", parallel = true } ci = { depends_on = ["test", "format"] }
bash
rx task ci # Runs lint -> test and format in parallel rx task test # Runs lint first, then test

Need help? Open an issue or start a discussion.