{"library":"sarge","title":"Sarge","description":"Sarge is a Python library that wraps the standard `subprocess` module, providing enhanced cross-platform functionality for running shell commands and pipelines. It simplifies common tasks such as command chaining, robust output capture, and secure command formatting to prevent shell injection, aiming to make interactions with external programs easier than direct `subprocess` usage. The current stable version is 0.1.8, released recently in 2026, and the project actively maintains its documentation.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install sarge"],"cli":null},"imports":["from sarge import run","from sarge import capture_stdout","from sarge import Pipeline","from sarge import Command","from sarge import Capture","from sarge import shell_format"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import sarge\n\n# Run a simple command and get its output\np = sarge.run('echo \"Hello from Sarge!\"', stdout=sarge.Capture())\nprint(p.stdout.text.strip())\n\n# Run a command pipeline\np = sarge.run('ls -l | grep .py', stdout=sarge.Capture())\nprint(p.stdout.text)\n\n# Check return codes\np = sarge.run('false || echo success', stdout=sarge.Capture())\nprint(f\"Return code: {p.returncode}\")\nprint(f\"Output: {p.stdout.text.strip()}\")","lang":"python","description":"This quickstart demonstrates how to use `sarge.run` to execute single commands and pipelines, capture output, and inspect return codes. The `Capture()` object is used to collect stdout for later access.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}