I’ve just released a new version of Grabit Clipit, my little command line app for saving full-text copies of webpages.
TL;DR
- Clipit is now a proper library on PyPI (
pip install clipit) with a small, stable import surface. - The CLI is a uv tool: run
uvx clipit URLor install once withuv tool install clipit.
Clipit is now a library
For starters, I’ve refactored the code out of that ~500 lines Python script and into a nicer, cleaner, better structure that will allow me to make changes faster. That nicer, cleaner, better structure is now available on PyPI so you can just pip install clipit and use it to power your own apps as well.
Incidentally, this is why I’ve had to rename Grabit to Clipit: there was already a grabit package on PyPI, and I didn’t want to confuse people by releasing a package named grabit-md, or grabit-lib, or stuff like that. Better to start from a clean slate.
Running Clipit as an uv tool
The second big&important change has been updating the way Clipit is run. Instead of having to download a script somewhere on your machine and then doing uv run ~/scripts-or-something/grabit.py [OPTIONS] url, now you can just uvx clipit [OPTIONS] url and you’re good to go.
Or, if you’re into user-experience, run uv tool install clipit once, and then you get access to a clipit script which allows you to run commands like clipit [OPTIONS] url all day long.
To tell you the truth, I had expected this change to be more difficult. Instead, pretty much all that I needed to do (after extracting the library code) was extracting the CLI logic in grabit.py to a dedicated cli.py script, and adding a [project.scripts] section in pyproject.toml with clipit = "clipit.cli:main", which lets uv know that uv tool run clipit should call the main method in cli.py.
Try it now
# install a script shim (recommended)
uv tool install clipit
clipit https://example.com/article
# or an one-off run
uvx clipit https://example.com/article