Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csabapalfi/gps
Google PageSpeed Score CLI
https://github.com/csabapalfi/gps
google-pagespeed google-pagespeed-insights pagespeed slack
Last synced: 12 days ago
JSON representation
Google PageSpeed Score CLI
- Host: GitHub
- URL: https://github.com/csabapalfi/gps
- Owner: csabapalfi
- Created: 2017-04-06T22:41:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T11:43:18.000Z (almost 7 years ago)
- Last Synced: 2025-01-13T15:55:36.034Z (24 days ago)
- Topics: google-pagespeed, google-pagespeed-insights, pagespeed, slack
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google PageSpeed Score CLI
Check **G**oogle **P**ageSpeed **S**cores from the command line.
The idea is to run this from your CI/CD periodically and/or after deployments (and post the output message to Slack by piping it to slackcat)
I built a node version of this for one of my clients but want to have a lighter single-binary version.
## installation
Grab the [latest release from Github](https://github.com/csabapalfi/gps/releases/latest).
## basic usage
```sh
gps "http://example.com"
```
This should output something like this:
```
📱 99 ✅ 🖥 99 ✅ http://example.com
```
If you want to post to Slack then check out [slackcat](https://github.com/csabapalfi/slackcat):
```sh
gps "http://example.com" | slackcat -tee -token=$SLACK_TOKEN -channel=$YOUR_CHANNEL
```## defining thresholds
You can define thresholds to check your score using the `mobile` and `desktop` flags:
```sh
gps -mobile 100 -desktop 90 "http://example.com"
```
Scores above the threshold get a green tick, scores below get a red X:
```
📱 99 ❌ 🖥 99 ✅ http://example.com
```## verbose output
To log PageSpeed API responses just pass the `-v` flag:
```sh
gps -v "http://example.com"
```
```
HTTP/2.0 200 OK
...
{
"kind": "pagespeedonline#result",
"id": "http://example.com",
"responseCode": 200,
...
HTTP/2.0 200 OK
...
{
"kind": "pagespeedonline#result",
"id": "http://example.com",
"responseCode": 200,
...
📱 99 ✅ 🖥 99 ✅ http://example.com
```