Getting Started
This guide walks through the core workflow: installing a Python version, creating a project, syncing dependencies, and running code.
Install Pyra
Section titled “Install Pyra”Pyra ships as a single binary.
curl -fsSL https://tlo3.com/pyra-install.sh | shThe install script downloads the correct GitHub Release archive, verifies the
published checksum, and installs pyra onto your PATH.
If you need a specific release, set PYRA_VERSION:
curl -fsSL https://tlo3.com/pyra-install.sh | env PYRA_VERSION=0.1.0 shVerify the installation:
pyra --versionUpdate Pyra later:
pyra self updateInstall a Python version
Section titled “Install a Python version”Pyra manages Python installations from python-build-standalone. Installed Pythons are stored centrally and shared across projects.
Search for available versions:
pyra python search 3.13Install one:
pyra python install 3.13List installed versions:
pyra python listInitialize a project
Section titled “Initialize a project”Create a new Python project in the current directory:
pyra init --python 3.13This creates:
pyproject.toml— project metadata and dependency declarationspylock.toml— resolved dependency state (initially empty)
The --python flag pins a managed Python version in [tool.pyra].python.
Pin a Python version
Section titled “Pin a Python version”If you already have a pyproject.toml, pin a managed Python version:
pyra use 3.13This writes the version to [tool.pyra].python and refreshes the centralized environment to use the selected interpreter.
A pinned Python version is required before pyra sync will run.
Add dependencies
Section titled “Add dependencies”Add packages to your project:
pyra add requestspyra add pytest --group devEach add edits pyproject.toml and runs the full sync pipeline — resolve, lock, reconcile.
Sync the environment
Section titled “Sync the environment”Sync reconciles the centralized environment from pyproject.toml and pylock.toml:
pyra syncThe sync pipeline:
- Reads dependency inputs from
pyproject.toml - Checks whether
pylock.tomlis fresh - Resolves and rewrites the lock if stale or missing
- Reconciles the environment exactly from the lock
Sync is idempotent. Running it twice with no changes is a no-op.
Reproducibility modes
Section titled “Reproducibility modes”pyra sync --lockedpyra sync --frozenBoth modes fail if the lock is missing or stale, which is useful for CI where you want to catch drift.
Run code
Section titled “Run code”Execute scripts and commands through the synchronized environment:
pyra run main.pypyra run servepyra run ensures the environment is synchronized before execution. Child exit codes are propagated.
Check project health
Section titled “Check project health”Run diagnostics without changing any state:
pyra doctorDoctor reports actionable findings about interpreter state, lock freshness, and environment drift.
Next steps
Section titled “Next steps”- Commands Reference — full command documentation
- Sync Model — how the dependency pipeline works
- Dependency Selection — groups, extras, and selection flags
- Python Management — version management in detail