Monkeytype Tracker
Track your Monkeytype typing statistics and get personalized improvement tips.
Pre-Flight Check (ALWAYS DO THIS FIRST)
Before running ANY command, check if setup is complete:
Security Priority:
- Environment variable (most secure):
MONKEYTYPE_APE_KEY - Config file fallback:
~/.openclaw/workspace/config/monkeytype.json
# Check environment variable first
ape_key = os.getenv('MONKEYTYPE_APE_KEY')
if not ape_key:
# Check config exists and has valid key
config_path = Path.home() / ".openclaw" / "workspace" / "config" / "monkeytype.json"
If no env var AND no config: โ Run Setup Flow (Step 1) If apeKey exists but API returns 471 "inactive": โ Tell user to activate the key (checkbox) If apeKey works: โ Proceed with command
Setup Flow (3 Steps)
Step 1: Get ApeKey
Send this message:
Hey! ๐ I see you want to track your Monkeytype stats. I'll need your API key to get started.
**๐ How to get it:**
1. Go to monkeytype.com โ **Account Settings** (click your profile icon)
2. Select **"Ape Keys"** from the left sidebar
3. Click **"Generate new key"**
4. โ ๏ธ **Activate it:** Check the checkbox next to your new key (keys are inactive by default!)
5. Copy the key and send it to me
Once you share the key, I'll ask about automation preferences ๐ค
---
๐ **Prefer to add it manually?** No problem!
**Option 1: Environment Variable (Recommended - Most Secure)**
Set in your system:
- Windows (PowerShell): `$env:MONKEYTYPE_APE_KEY="YOUR_KEY_HERE"`
- Linux/Mac: `export MONKEYTYPE_APE_KEY="YOUR_KEY_HERE"`
**Option 2: Config File**
Create this file: `~/.openclaw/workspace/config/monkeytype.json`
With this content:
{
"apeKey": "YOUR_KEY_HERE"
}
Then just say "monkeytype stats" and I'll take it from there!
After receiving key:
- Save to
~/.openclaw/workspace/config/monkeytype.json:
{
"apeKey": "USER_KEY_HERE",
"automations": {
"dailyReport": false,
"weeklyReport": false,
"reportTime": "20:00"
}
}
- Test the key immediately by running
python scripts/monkeytype_stats.py stats - If 471 error โ Key is inactive, ask user to check the checkbox
- If success โ Proceed to Step 2
Step 2: Verify & Ask Automation Preferences
After key verification succeeds, send:
Got it! Key saved and verified โ
**๐ Quick Overview:**
โข {tests} tests completed ({hours} hrs)
โข ๐ PB: {pb_15}WPM (15s) | {pb_30}WPM (30s) | {pb_60}WPM (60s)
โข ๐ฅ Current streak: {streak} days
Now, would you like automated reports?
**Options:**
1๏ธโฃ **Daily report** โ Summary of the day's practice
2๏ธโฃ **Weekly report** โ Week-over-week comparison + tips
3๏ธโฃ **Both**
4๏ธโฃ **None** โ On-demand only
โฐ What time should I send reports? (default: 8pm)
Step 3: Finalize Setup
After user chooses options:
- Update config with preferences
- Create cron jobs if automations enabled:
- Daily:
0 {hour} * * *with namemonkeytype-daily-report - Weekly:
0 {hour} * * 0with namemonkeytype-weekly-report
- Daily:
- Send completion message:
๐ **You're all set!**
**โ
Config saved:**
โข Weekly report: {status}
โข Daily report: {status}
**๐ก Try these anytime:**
โข "show my typing stats"
โข "how's my typing progress"
โข "compare my typing this week"
โข "monkeytype leaderboard"
Happy typing! May your WPM be ever higher ๐โจ๏ธ
Error Handling
| Error | User Message |
|---|---|
| No config file | "Looks like Monkeytype isn't set up yet. Let me help you get started! ๐" โ Start Setup Flow |
| No apeKey in config | Same as above |
| API 471 "inactive" | "Your API key is inactive. Go to Monkeytype โ Account Settings โ Ape Keys and check the checkbox next to your key to activate it โ " |
| API 401 "unauthorized" | "Your API key seems invalid. Let's set up a new one." โ Start Setup Flow |
| API rate limit | "Hit the API rate limit. Try again in a minute โณ" |
| Network error | "Couldn't reach Monkeytype servers. Check your connection and try again." |
Commands
Fetch Stats
Triggers: "show my monkeytype stats", "how's my typing", "typing stats"
- Pre-flight check (see above)
- Run:
python scripts/monkeytype_stats.py stats - Format output nicely with emojis
Recent History & Analysis
Triggers: "analyze my recent typing", "how have I been typing lately"
- Pre-flight check
- Run:
python scripts/monkeytype_stats.py history --limit 50 - Analyze output and provide 2-3 improvement tips
Progress Comparison
Triggers: "compare my typing progress", "am I improving"
- Pre-flight check
- Run:
python scripts/monkeytype_stats.py compare
Leaderboard Lookup
Triggers: "monkeytype leaderboard", "where do I rank"
- Pre-flight check
- Run:
python scripts/monkeytype_stats.py leaderboard [--mode time] [--mode2 60]
Improvement Tips Logic
After fetching stats, analyze and provide tips based on:
| Issue | Tip |
|---|---|
| StdDev > 15 | "Focus on consistency โ slow down and aim for 95%+ accuracy every test" |
| Accuracy < 95% | "Accuracy builds speed. Slow down until you hit 95%+ consistently" |
| 60s << 30s PB | "Stamina gap detected. Practice longer tests to build endurance" |
| Low test count | "More practice = faster progress. Aim for 5-10 tests daily" |
| Streak broken | "Consistency matters! Try to type a bit every day" |
API Notes
- Base URL:
https://api.monkeytype.com - Auth header:
Authorization: ApeKey {key} - Rate limits: 30 req/min global, 30/day for results endpoint
- Cache results locally when possible
Files
~/.openclaw/workspace/config/monkeytype.json: User configscripts/monkeytype_stats.py: Main stats fetcher script