Giter Site home page Giter Site logo

cedricblondeau / presto-card-cli Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 1.69 MB

A CLI tool for checking your PRESTO card balance. ๐Ÿš‹

Home Page: https://blog.cedricblondeau.com/2017/12/23/check-your-presto-card-balance-in-a-terminal-using-presto-card-cli/

License: GNU Affero General Public License v3.0

JavaScript 100.00%
presto-card terminal cli ttc toronto

presto-card-cli's Introduction

presto-card-cli Build Status

forthebadge forthebadge

A CLI tool for checking your Presto card balance.

demo gif

I wrote about this tool on my blog: https://blog.cedricblondeau.com/2017/12/23/check-your-presto-card-balance-in-a-terminal-using-presto-card-cli/

Install

yarn global add presto-card-cli

Requires NodeJS 8+.

Usage

The tool requires the user to set up credentials before accessing the balance.

# Set credentials
presto-card set-credentials
 ? Enter a Presto account username: <username>
 ? Enter the password for this Presto account: <password>

# Print balance for a given user, username is a required argument
presto-card balance <username>

How does it work?

Password management

This tool uses node-keytar to store credentials. On macOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.

Get the balance

This tool uses presto-card-js as a back end.

Common issues

SyntaxError: Unexpected token error

This may happen when using an old version of NodeJS. This tool requires NodeJS 8+.

Error: Module version mismatch. Expected 48, got 59. or equivalent

This may happen if presto-card-cli has been installed with a different version of NodeJS than the current one. Re-installing may help.

FAQ

Q: I have only one card. Can I set up a default account?

Not at this time. But you can set up an alias. For example: alias pb='presto-card balance supercat'

Q: What if I don't have a Presto account? Can I use this tool with a Presto card number?

Not at this time.

License

GNU Affero General Public License v3.0

presto-card-cli's People

Contributors

cedricblondeau avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.