Skip to content

andatoshiki/wakafetch

Repository files navigation

Wakafetch

Showcase

A command-line tool to fetch and display your coding stats from WakaTime or Wakapi in your terminal, without opening or refreshing the web dashboard.

Original author: sahaj-b. Current maintainer: andatoshiki.

1: Features

  • Quick stats: Summary of coding activity for configurable time ranges (--range or --days).
  • Deep dive: --full shows languages, projects, editors, operating systems, and more.
  • Daily breakdown: --daily shows a day-by-day table.
  • Activity heatmap: --heatmap shows a GitHub-style heatmap; default window is backend-aware (WakaTime: last 7 days, Wakapi: last 12 months). Use --range (e.g. 7d, 30d, 6m, 1y) or a year (e.g. 2024).
  • WakaTime and Wakapi: Works with the official WakaTime API and Wakapi, including self-hosted instances. Backend is auto-detected from api_url; today/yesterday and heatmap defaults differ per backend.
  • Zero-config: Reads API key from ~/.wakatime.cfg; override with --api-key if needed.

2: Installation

2.1: One-liner (curl)

Install the latest release (macOS, Linux):

curl -fsSL https://raw.githubusercontent.com/andatoshiki/wakafetch/master/scripts/install.sh | sh

Installs to /usr/local/bin if writable, otherwise ~/.local/bin. Override with INSTALL_DIR or pin a version with VERSION:

curl -fsSL https://raw.githubusercontent.com/andatoshiki/wakafetch/master/scripts/install.sh | INSTALL_DIR=~/bin sh
curl -fsSL https://raw.githubusercontent.com/andatoshiki/wakafetch/master/scripts/install.sh | VERSION=v2.1.1 sh

2.2: From source

git clone https://github.com/andatoshiki/wakafetch.git
cd wakafetch
go build
./wakafetch --help

2.3: With Go install

Installs the binary to $GOPATH/bin or $GOBIN:

go install github.com/andatoshiki/wakafetch@latest

3: Configuration

wakafetch reads ~/.wakatime.cfg. Put your API key and optional API URL there (e.g. from your WakaTime or Wakapi settings):

[settings]
api_key = your-api-key
api_url = https://wakatime.com/api

For Wakapi or a self-hosted instance, set api_url to your instance (e.g. https://wakapi.dev/api or https://your-server/api). The tool normalizes non–WakaTime URLs to the compat API path.

If you use the WakaTime editor extension, this config is usually already present.

3.1: WakaTime vs Wakapi behavior

wakafetch detects the backend from api_url (WakaTime when the URL contains wakatime.com, otherwise Wakapi) and adjusts behavior:

Behavior WakaTime (official) Wakapi (official / self-hosted)
Default heatmap (-H) Last 7 days Last 12 months
Today / yesterday range Uses Summary API (stats endpoint does not support these ranges) Uses Stats API (today, yesterday supported)
Stats range identifiers last_7_days, last_30_days, last_6_months, last_year, all_time Same plus today, yesterday; also accepts 7_days, 30_days, last_12_months, any, etc.

You can always override with --range (e.g. wakafetch -H --range 1y for a 12‑month heatmap on WakaTime).

4: Usage

Default view (today):

wakafetch

Full list of options:

wakafetch --help

Options:

Flag Description
-r, --range Range: today, yesterday, 7d, 30d, 6m, 1y, all, or a year (e.g. 2024). Default: today
-d, --days Number of days (overrides --range)
-f, --full Full statistics
-D, --daily Daily breakdown table
-H, --heatmap Activity heatmap; default window: WakaTime = last 7 days, Wakapi = last 12 months. Override with --range (7d, 30d, 6m, 1y, or year)
-k, --api-key Override API key from config
-t, --timeout Request timeout in seconds (default: 10)
-u, --update Check for updates and show install command if newer version exists
-j, --json Output JSON
-h, --help Help

Warning

Historic data and --range: The official WakaTime API and hosted Wakapi typically require a Pro/Premium plan to return summary or historic data for longer time ranges. Using --range (e.g. 1y, 6m, or a past year) may result in errors or empty results on free tiers. Self-hosted Wakapi has no such limit and returns full historic data.

Note

Free plan limits: Wakapi official free plan supports up to one year of instant API-based retrieval. WakaTime free plan supports up to 7 days only.

5: Examples

  • Today (default): wakafetch
  • Last 7 days: wakafetch --range 7d
  • Last 30 days: wakafetch --range 30d
  • Full stats for the last year: wakafetch -r 1y -f
  • Last 100 days: wakafetch --days 100
  • Daily breakdown for 2 weeks: wakafetch --days 14 --daily
  • Heatmap (default: last 7 days on WakaTime, last 12 months on Wakapi): wakafetch -H
  • Heatmap for last 7 days: wakafetch -H --range 7d
  • Heatmap for last 30 days: wakafetch -H --range 30d
  • Heatmap for last 12 months: wakafetch -H --range 1y
  • Heatmap for a specific year: wakafetch -H --range 2024
  • Check for updates: wakafetch --update

6: License

MIT. See LICENSE.

About

A command-line tool to fetch and display your coding stats from WakaTime or Wakapi in your terminal, without opening or refreshing the web dashboard, and yes, it's more convenient!

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors