Skip to content

nilesh-padiyar/crypto-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Tracker CLI 🚀

A lightweight and fast CLI tool to fetch real-time cryptocurrency prices directly from your terminal.

Built with TypeScript using the CoinGecko public API — no API key required.


✨ Features

  • 📈 Real-time cryptocurrency prices
  • ⚡ Fast and minimal CLI output
  • 🔒 Input validation & error handling
  • 🧠 Strong typing with TypeScript
  • 🌍 Supports multiple fiat & crypto currencies
  • 🔓 No API key required

📦 Installation

Install globally via npm:

npm install -g @nilesh-padiyar/crypto-tracker

Before installing, make sure you have

  • Node.js (v14 or higher recommended)
  • npm (comes with Node.js)

⚡ Usage

crypto <coin> <currency>

Examples

crypto bitcoin usd
crypto ethereum inr
crypto dogecoin usd

Example Output

BITCOIN price: 46662 USD

💱 Supported Currencies

Supports all currencies available from the CoinGecko API.
To see the full list of supported currencies, run:

crypto --currencies

🧠 How It Works

  • Fetches live price data from the CoinGecko API
  • Validates user input
  • Displays clean output in the terminal

Notes on Rate-Limiting

CoinGecko public API allows up to 50 requests per minute per IP.

  • If you hit the limit, the CLI will automatically retry with exponential backoff.
  • Example warning:
⚠ 429 Rate limit hit, retrying in 1000ms...
⚠ 429 Rate limit hit, retrying in 2000ms...
⚠ 429 Rate limit hit, retrying in 4000ms...
✖ Something went wrong
  • This ensures users understand their usage limits while preventing the CLI from failing silently.
  • Cached and fallback currencies help reduce unnecessary API calls.

🛠️ Development Setup

If you want to work on the project locally:

git clone https://github.com/nilesh-padiyar/crypto-tracker.git
cd crypto-tracker
npm install
npm run build

Run locally:

node dist/index.js bitcoin usd

🔗 Using Locally (Optional)

npm link
crypto bitcoin usd

⚙️ CLI Configuration

Make sure your package.json includes:

"bin": {
  "crypto": "dist/index.js"
}

And your entry file starts with:

#!/usr/bin/env node

🔄 Updating

npm update -g @nilesh-padiyar/crypto-tracker

🧪 Tech Stack

  • Node.js
  • TypeScript
  • Async/Await
  • CoinGecko Public API

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Please keep commits clean and meaningful.


📜 License

MIT — free to use, modify, and distribute


🙌 Author

Nilesh Padiyar


About

CLI based Crypto Tracker built with CoinGecko Public API

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors