PYRS logo PYRS

CLI and Environment Reference

Edit this page

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
pyrsStart interactive REPL (or read from stdin when piped).
pyrs path/to/script.pyRun a Python source file.
pyrs path/to/module.pycRun a CPython bytecode file.
pyrs -c "code"Execute inline source passed on the command line.
pyrs -m package.moduleResolve and run a library module as a script.

Supported CLI Flags

Flag Behavior
-h, --helpPrint command-line usage help.
-V, --versionPrint interpreter version.
--ast path.pyPrint parsed AST for a source file.
--bytecode path.pyPrint bytecode disassembly for a source file.
-S, --no-siteDisable automatic site import at startup.
-m <module>Run a library module as a script using CPython-shaped module mode.
-W option, -WoptionConfigure warning filters.
-X no_debug_rangesDisable traceback caret range debug metadata.
-X tracemalloc, -X tracemalloc=<N>Enable tracemalloc startup configuration.
-I, -E, -u, -BAccepted CPython compatibility flags; currently no-op except that -I and -E suppress PYTHONWARNINGS ingest.

Environment Variables

Variable Purpose
PYRS_CPYTHON_LIBSet explicit CPython stdlib root; PYRS keeps stdlib imports isolated to that tree and borrows host lib-dynload only when needed.
XDG_DATA_HOMEChanges where installer-managed stdlib bundles are discovered (${XDG_DATA_HOME}/pyrs/stdlib/3.14.3/Lib).
PYRS_REPL_THEMESet REPL theme mode: auto, dark, or light.
PYTHONWARNINGSStartup warning filters consumed by warning configuration.
PYTHONPATHAdditional module search entries appended during startup path setup.
PYTHONHOMEFallback CPython stdlib root when no managed or explicit stdlib root is selected.
VIRTUAL_ENVDetected virtualenv site-packages entries are appended when present.
COLORFGBGUsed for auto light/dark terminal color tuning in CLI output and REPL theming.