https://github.com/freedomben/squoosh-cli
https://github.com/freedomben/squoosh-cli
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/freedomben/squoosh-cli
- Owner: FreedomBen
- Created: 2021-02-22T20:03:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T20:27:43.000Z (over 5 years ago)
- Last Synced: 2025-02-16T14:59:13.250Z (over 1 year ago)
- Language: Shell
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Squoosh-cli
Wraps the [squoosh](https://github.com/GoogleChromeLabs/squoosh) CLI into an OCI image for easy using. I put a bash function in the `~/.bashrc` file called `squoosh-cli` so I don't even have to know I'm using a container:
```bash
squoosh-cli ()
{
podman run \
--rm \
--volume "$(pwd):/squoosh:Z" \
quay.io/freedomben/squoosh:latest \
"$@"
}
```
Now to run squoosh, I just use it like normal:
```
$ squoosh-cli --output-dir outputdir/ --mozjpeg '{}' profile-enh.png
```
If you don't pass args it will print out the `squoosh-cli` help menu (`--help`). This is useful if you forget the args.
Note that I'm using rootless `podman`, so the `root` user in the container ends up being the user I invoked it with.
If you are going to use this let me know and I'll try to maintain it in a way that supports others. Right now it's just me so I'm not putting effort into that.
Thank you to Google for building this super helpful tool and releasing it open source!