Command-line and environment reference for PYRS.
This page captures current CLI and startup-environment behavior for PYRS. It should stay aligned
with src/cli/mod.rs and related runtime wiring.
Invocation Modes
| Command | Behavior |
pyrs | Start interactive REPL (or read from stdin when piped). |
pyrs path/to/script.py | Run a Python source file. |
pyrs path/to/module.pyc | Run a CPython bytecode file. |
pyrs -c "code" | Execute inline source passed on the command line. |
pyrs -m package.module | Resolve and run a library module as a script. |
Supported CLI Flags
| Flag | Behavior |
-h, --help | Print command-line usage help. |
-V, --version | Print interpreter version. |
--ast path.py | Print parsed AST for a source file. |
--bytecode path.py | Print bytecode disassembly for a source file. |
-S, --no-site | Disable automatic site import at startup. |
-m <module> | Run a library module as a script using CPython-shaped module mode. |
-W option, -Woption | Configure warning filters. |
-X no_debug_ranges | Disable traceback caret range debug metadata. |
-X tracemalloc, -X tracemalloc=<N> | Enable tracemalloc startup configuration. |
-I, -E, -u, -B | Accepted CPython compatibility flags; currently no-op except that -I and -E suppress PYTHONWARNINGS ingest. |
Environment Variables
| Variable | Purpose |
PYRS_CPYTHON_LIB | Set explicit CPython stdlib root; PYRS keeps stdlib imports isolated to that tree and borrows host lib-dynload only when needed. |
XDG_DATA_HOME | Changes where installer-managed stdlib bundles are discovered (${XDG_DATA_HOME}/pyrs/stdlib/3.14.3/Lib). |
PYRS_REPL_THEME | Set REPL theme mode: auto, dark, or light. |
PYTHONWARNINGS | Startup warning filters consumed by warning configuration. |
PYTHONPATH | Additional module search entries appended during startup path setup. |
PYTHONHOME | Fallback CPython stdlib root when no managed or explicit stdlib root is selected. |
VIRTUAL_ENV | Detected virtualenv site-packages entries are appended when present. |
COLORFGBG | Used for auto light/dark terminal color tuning in CLI output and REPL theming. |