waka-cli
A command-line client for the WakaTime API, built on the
waka crate. It covers every documented endpoint:
coding statistics, summaries, durations, heartbeats, goals, insights, leaderboards,
organizations, and the write operations.
Installation
Authentication
Get your API key from wakatime.com/api-key and provide
it via a flag, an environment variable, or a .env file in the working directory:
# flag
# environment
# .env file
OAuth 2.0 access tokens are supported via --bearer-token / WAKATIME_BEARER_TOKEN.
Environment variables
| Variable | Flag | Description |
|---|---|---|
WAKATIME_API_KEY |
--api-key |
API key, sent as HTTP Basic auth |
WAKATIME_BEARER_TOKEN |
--bearer-token |
OAuth 2.0 access token, sent as Bearer auth |
WAKATIME_USER |
--user |
The user to query; defaults to current |
WAKATIME_BASE_URL |
--base-url |
Override the API base URL |
WAKATIME_TIMEOUT |
--timeout |
Request timeout in seconds |
Usage
# Your coding stats for the last week
# Daily summaries for a date range
# Today's activity, as shown in editor status bars
# All projects, across all pages
# Send a heartbeat
# Log an external duration, e.g. a meeting
# Replace custom rules from a JSON file (or stdin)
# Request a data dump export
Run waka-cli --help for the full list of subcommands, and
waka-cli <command> --help for the options of each command.
Shell completions
Generate completions for your shell with the completions subcommand
(supported: bash, zsh, fish, elvish, powershell):
# bash
# zsh
# fish
JSON output
Every command supports --json, which prints the raw API response as
pretty-printed JSON to stdout instead of the human-readable rendering:
|
License
Licensed under the European Union Public Licence (EUPL), Version 1.2.