Wakapi Sync
Scanned@cosformula
npx machina-cli add skill @cosformula/wakapi-sync-skill --openclawwakapi-sync
Daily Wakapi (WakaTime-compatible) summary → local CSV files.
What it does
- Fetches today stats from Wakapi and appends/updates CSVs:
daily-total.csv(1 row/day)daily-top-projects.csv(N rows/day)daily-top-languages.csv(N rows/day)
Requirements
- Node.js 18+
Configuration (env vars)
WAKAPI_URL(required)- Example:
https://wakapi.example.com
- Example:
WAKAPI_API_KEY(required)- Your Wakapi API key.
WAKAPI_OUT_DIR(required)- Output directory for CSVs.
- Example:
~/wakapi-data
Optional:
WAKAPI_TOP_N_PROJECTS(default:10)WAKAPI_TOP_N_LANGUAGES(default:10)
Auth:
- Uses
Authorization: Basic base64(<api_key>)(matches our current Wakapi setup).
Usage
Run:
node scripts/wakapi-daily-summary.mjs
Output CSV schemas
daily-total.csv
Columns:
date(YYYY-MM-DD)total_secondstotal_hoursprojects_countlanguages_count
daily-top-projects.csv
Columns:
daterankprojectsecondshourspercent
daily-top-languages.csv
Columns:
dateranklanguagesecondshourspercent
Overview
Wakapi Sync fetches today’s Wakapi stats and appends/updates three local CSV files: daily-total.csv, daily-top-projects.csv, and daily-top-languages.csv. This enables offline analysis and local dashboards with WakaTime-compatible data. It relies on the environment variables WAKAPI_URL, WAKAPI_API_KEY, and WAKAPI_OUT_DIR to operate.
How This Skill Works
The tool requests today’s activity from the Wakapi API using the Authorization header with your API key, then writes or updates the three CSVs in the configured output directory. It honors WAKAPI_TOP_N_PROJECTS and WAKAPI_TOP_N_LANGUAGES to control how many rows are written.
When to Use It
- You want a daily offline record of Wakapi activity for personal analytics.
- You need to populate local dashboards with Wakapi data.
- You want to audit daily contributions by project and language.
- You want to archive a consistent day-by-day activity log locally.
- You’re preparing data for a local BI workflow or reporting.
Quick Start
- Step 1: Install Node.js 18+ and verify node --version.
- Step 2: Set required env vars: WAKAPI_URL, WAKAPI_API_KEY, WAKAPI_OUT_DIR (optional: WAKAPI_TOP_N_PROJECTS, WAKAPI_TOP_N_LANGUAGES).
- Step 3: Run the script: node scripts/wakapi-daily-summary.mjs
Best Practices
- Ensure all required environment variables are set before first run.
- Verify the WAKAPI_OUT_DIR exists and is writable by the process.
- Schedule runs after midnight to capture the full day in local time.
- Use WAKAPI_TOP_N_PROJECTS and WAKAPI_TOP_N_LANGUAGES to limit data volume.
- Store and rotate the Wakapi API key securely; avoid hard-coding keys.
Example Use Cases
- A solo developer tracks daily totals and top languages for self-improvement.
- A small team compares daily top projects to gauge focus shifts.
- A local BI workflow ingests daily-top-projects for visualization in dashboards.
- An offline archive maintains a CSV-based activity log for compliance.
- A sprint recap uses daily totals to summarize work distribution.