# cg-coin

CLI tool to fetch comprehensive cryptocurrency data from CoinGecko API.

## Features

- Market data (price, market cap, volume, ATH/ATL)
- Developer metrics (GitHub commits, stars, forks)
- Social sentiment (Twitter followers, Reddit subscribers)
- Exchange tickers (optional)
- 50+ pre-mapped symbols with auto-resolution

## Installation

```bash
cargo install cg-coin
```

Or build from source:

```bash
cargo build --release -p cg-coin
```

## Usage

```bash
# Basic usage - fetch Bitcoin data
cg-coin BTC
cg-coin bitcoin

# Save to file
cg-coin ETH -O ethereum.json

# Compact JSON output
cg-coin BTC -f compact

# Skip developer/social data (faster)
cg-coin BTC --developer false --community false

# Include exchange tickers
cg-coin BTC --tickers

# List all supported symbols
cg-coin --list

# Verbose logging
cg-coin BTC -v
```

## Output

Returns comprehensive JSON including:

```json
{
  "id": "bitcoin",
  "symbol": "btc",
  "name": "Bitcoin",
  "market_data": {
    "current_price": { "usd": 67500.0 },
    "market_cap": { "usd": 1330000000000 },
    "total_volume": { "usd": 25000000000 },
    "ath": { "usd": 73750.0 },
    "atl": { "usd": 67.81 },
    "price_change_percentage_24h": 2.5,
    "price_change_percentage_7d": 5.2
  },
  "developer_data": {
    "commit_count_4_weeks": 125,
    "forks": 36000,
    "stars": 75000
  },
  "community_data": {
    "twitter_followers": 6500000,
    "reddit_subscribers": 5800000
  }
}
```

## Options

| Option | Description |
|--------|-------------|
| `-O, --output-file` | Save output to file |
| `-f, --format` | Output format: `json` (pretty) or `compact` |
| `--tickers` | Include exchange ticker data |
| `--developer` | Include GitHub metrics (default: true) |
| `--community` | Include social data (default: true) |
| `--list` | List all supported symbols |
| `-v, --verbose` | Enable debug logging |

## Rate Limiting

Uses CoinGecko free tier (10 req/min). The client automatically:
- Throttles requests to stay under limit
- Retries on 429 with exponential backoff

## License

MIT
