Quick Start

Under Construction

Launch PySH and run your first Python automation commands.

Launch PySH

Launch PySH

$ pysh

PySH 0.8.2 | Python 3.13.5 | GPL-2.0-only

System: Debian GNU/Linux 13 | Kernel 6.12.90

Type 'exit' or press Ctrl+D to quit.

Interactive shell commands

In the PySH shell, standard system commands work as expected. You can run ls, cd, cat, and any program on your PATH directly.

Basic shell commands

$ ls -la

total 48 drwxr-xr-x ...


$ cd /tmp && pwd

/tmp

Python mode — #py

Type #py to enter the Python Command Execution Layer. You get a full Python 3 REPL with access to the file system, environment, and any installed packages.

Python mode

$ #py

PySH Python Command Execution Layer

Python 3.13.5


$ from pathlib import Path

$ list(Path(".").iterdir())

[PosixPath('scripts'), PosixPath('.env'), ...]

Exit Python mode

Press Ctrl+D or type exit() to return to the PySH shell from Python mode.

File operations with pathlib

Note: In PySH, pathlib is the standard way to interact with the file system in Python mode. There is no need to import os for most tasks.
pathlib file operations

$ from pathlib import Path

$ p = Path("/var/log")

$ [f.name for f in p.iterdir() if f.suffix == ".log"]

['syslog', 'auth.log', 'kern.log']

Exiting PySH

Type exit at the PySH prompt or press Ctrl+D.