Giter VIP home page Giter VIP logo

air-quality-cli's Introduction

Air Quality Index CLI

Go Report Card License: Apache-2.0 Latest GitHub release

Get Air Quality index for your City.

Contents

Installation

curl -f https://raw.githubusercontent.com/yankeexe/air-quality-cli/master/install.sh | sudo sh

Manual Installation

Download the latest release.

Using Docker ๐Ÿณ

docker pull ghcr.io/yankeexe/air-quality-cli:latest

Verify signature of the image: requires cosign.

COSIGN_EXPERIMENTAL=true cosign verify ghcr.io/yankeexe/air-quality-cli:latest
$ 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:

$ 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 (keyless).

  • Download checksum and sig file for verification.

    wget https://github.com/yankeexe/air-quality-cli/releases/download/v0.0.7/checksums.txt
    
    wget https://github.com/yankeexe/air-quality-cli/releases/download/v0.0.7/checksums.txt.sig
  • Verify the signature

    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

    sha256sum --ignore-missing -c checksums.txt

Usage

Initialization

One time setup to initialize the CLI using API token.

Get your API Token!

$ air init

Search for air quality based on country or city name

$ 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
$ air search Nepal
Demo demo of air quality cli search

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.

$ 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 demo of air quality cli search

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

$ air add kathmandu
Demo demo of air quality cli add stations

Show air quality from all your saved locations

$ 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 demo of air quality cli show

Remove saved city from your config

You can remove any saved stations/city from your config if you no longer need its information.

$ air remove
Demo demo of air quality cli remove

Contributing

For guidance on setting up a development environment and how to make a contribution to air-quality-cli, see the contributing guidelines.

air-quality-cli's People

Contributors

yankeexe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

air-quality-cli's Issues

Add `remove` command to remove stations from the `stations` config file.

Remove Stations added on ~/.aqi/stations config dictionary.

Need to update the flow of add command to include the station name to the config file.
Store uid along with station_name as a Tuple for the search query key.

Example:

{"kathmandu": [(11, "Basantapur, Kathmandu")]}

When delete is invoked, grab the name from config file and show it as a menu using simple-term-menu and delete that station accordingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.