Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yankeexe/air-quality-cli
Get Air Quality Index for your city/country 😷
https://github.com/yankeexe/air-quality-cli
air-quality cli commandline go go-cli golang golang-application
Last synced: about 2 months ago
JSON representation
Get Air Quality Index for your city/country 😷
- Host: GitHub
- URL: https://github.com/yankeexe/air-quality-cli
- Owner: yankeexe
- License: apache-2.0
- Created: 2021-01-08T18:10:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-02T03:26:26.000Z (almost 2 years ago)
- Last Synced: 2024-07-10T12:03:59.165Z (2 months ago)
- Topics: air-quality, cli, commandline, go, go-cli, golang, golang-application
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 44
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Air Quality Index CLI
[![Go Report Card](https://goreportcard.com/badge/github.com/yankeexe/air-quality-cli)](https://goreportcard.com/report/github.com/yankeexe/air-quality-cli)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache-yellow.svg)](https://opensource.org/licenses/Apache-2.0)
![Latest GitHub release](https://img.shields.io/github/release/yankeexe/air-quality-cli)Get Air Quality index for your City.
## Contents
- [Air Quality Index CLI](#air-quality-index-cli)
- [Installation](#installation)
- [Manual Installation](#manual-installation)
- [Using Docker :whale:](#using-docker-whale)
- [Verification of artifacts](#verification-of-artifacts)
- [Usage](#usage)
- [Initialization](#initialization)
- [Search for air quality based on country or city name](#search-for-air-quality-based-on-country-or-city-name)
- [Save your city to config for quick view.](#save-your-city-to-config-for-quick-view)
- [Remove saved city from your config](#remove-saved-city-from-your-config)
- [Contributing](#contributing)## Installation
```bash
curl -f https://raw.githubusercontent.com/yankeexe/air-quality-cli/master/install.sh | sudo sh
```### Manual Installation
Download the [latest release](https://github.com/yankeexe/air-quality-cli/releases).### Using Docker :whale:
```bash
docker pull ghcr.io/yankeexe/air-quality-cli:latest
```Verify signature of the image: requires [cosign](https://docs.sigstore.dev/cosign/installation/).
```bash
COSIGN_EXPERIMENTAL=true cosign verify ghcr.io/yankeexe/air-quality-cli:latest
``````bash
$ docker run --rm -it -v ${HOME}/.air:/home/cli/.air ghcr.io/yankeexe/air-quality-cli:latest search Nepal
```
For convenience you can add alias of the command to your shell config:
```bash
$ echo "alias air='docker run --rm -it -v ${HOME}/.air:/home/cli/.air ghcr.io/yankeexe/air-quality-cli:latest'" >> ~/.bashrc
$ source ~/.bashrc$ echo "alias air='docker run --rm -it -v ${HOME}/.air:/home/cli/.air ghcr.io/yankeexe/air-quality-cli:latest'">> ~/.zshrc
$ source ~/.zshrc# Use alias to invoke air-quality-cli
$ air search Singapore
```### Verification of artifacts
All artifacts are checksummed and the checksum file is signed with [cosign](https://github.com/sigstore/cosign#installation) (keyless).
* Download checksum and sig file for verification.
```bash
wget https://github.com/yankeexe/air-quality-cli/releases/download/v0.0.7/checksums.txtwget https://github.com/yankeexe/air-quality-cli/releases/download/v0.0.7/checksums.txt.sig
```
* Verify the signature```bash
COSIGN_EXPERIMENTAL=1 cosign verify-blob --signature checksums.txt.sig checksums.txt
```
If the signature is valid, verify the SHA256 match with the downloaded binary.* Verify Downloaded Binary
Store downloaded binary on the same dir as `checksums.txt`
```bash
sha256sum --ignore-missing -c checksums.txt
```## Usage
### Initialization
One time setup to initialize the CLI using API token.> [Get your API Token!](https://aqicn.org/data-platform/token/#/)
```bash
$ air init
```### Search for air quality based on country or city name
```bash
$ air search kathmandu# by default, stations whose data is not avaiable is hidden.
# use --all or -a to show stations even if there's no data.$ air search kathmandu --all
``````bash
$ air search Nepal
```> Demo
>**Fuzzy search the stations from your query.**
Alternative to viewing all the stations as table, you can also fuzzy search the stations returned from your query.
Use `-f` or `--fuzzy` flag to initiage fuzzy searching.
```bash
$ air search kathmandu -f# by default, stations whose data is not avaiable is hidden.
# use --all or -a to show stations even if there's no data.
$ air search kathmandu -fa
```> Demo
>### Save your city to config for quick view.
You can save stations from a number of locations to quickly view air quality there.
**Save the location**
```bash
$ air add kathmandu
```> Demo
>**Show air quality from all your saved locations**
```bash
$ air show# by default, stations whose data is not avaiable is hidden.
# use --all or -a to show stations even if there's no data.$ air show --all
```> Demo
>### Remove saved city from your config
You can remove any saved stations/city from your config if you no longer need its information.
```bash
$ air remove
```> Demo
>## Contributing
For guidance on setting up a development environment and how to make a contribution to `air-quality-cli`, see the [contributing guidelines](https://github.com/yankeexe/air-quality-cli/blob/master/CONTRIBUTING.md).