shelmet (via) This looks like a pleasant ergonomic alternative to Python's subprocess module, plus a whole bunch of other useful utilities. Lets you do things like this:
sh.cmd("ps", "aux").pipe("grep", "-i", check=False).run("search term")
I like the way it uses context managers as well: with sh.environ({"KEY1": "val1"})
sets new environment variables for the duration of the block, with sh.cd("path/to/dir")
temporarily changes the working directory and with sh.atomicfile("file.txt") as fp
lets you write to a temporary file that will be atomically renamed when the block finishes.
Recent articles
- Image segmentation using Gemini 2.5 - 18th April 2025
- GPT-4.1: Three new million token input models from OpenAI, including their cheapest model yet - 14th April 2025
- CaMeL offers a promising new direction for mitigating prompt injection attacks - 11th April 2025