waka-pi1.0.3
WakaTime plugin for Pi and Oh-My-Pi coding agents
Built for omp
The author tagged this package oh-my-pi.
Reports 0
No reports yet.
Readme
WakaTime for Pi & Oh-My-Pi
Track AI-assisted coding activity, file modifications, sessions, and token metrics from Pi and Oh-My-Pi with WakaTime.
Installation
In Oh-My-Pi (omp)
Install via the Oh-My-Pi Marketplace or directly from npm:
# Option A: Via Oh-My-Pi Marketplace
omp plugin marketplace add mbayue/waka-pi
omp plugin install waka-pi
# Option B: Directly from npm
omp install waka-pi
# Option C: Directly from GitHub repository
omp plugin install github:mbayue/waka-pi
# Or link a local working directory for development
omp plugin link /path/to/waka-pi
Alternatively, add waka-pi to your .omp/settings.json:
{
"extensions": [
"waka-pi"
]
}
Or run a single test session using the -e flag:
omp -e /path/to/waka-pi
In Pi (pi)
Install directly via the pi CLI:
# From npm
pi install npm:waka-pi
# Directly from GitHub repository
pi install git:github.com/mbayue/waka-pi
Alternatively, add waka-pi to your ~/.pi/agent/settings.json or project .pi/settings.json:
{
"extensions": [
"waka-pi"
]
}
API Key Configuration
Add your WakaTime API key to ~/.wakatime.cfg (or $WAKATIME_HOME/.wakatime.cfg):
[settings]
api_key = your-api-key
The plugin automatically manages and downloads wakatime-cli into ~/.wakatime/. No global npm install or manual binary setup is required.
What is tracked
Like the official Claude Code, OpenCode, and Codex CLI plugins, this extension delegates session parsing, metrics computation, and delivery to the official wakatime-cli.
- File modifications: Creation, edits, and updates from tool executions (
write,edit,apply_patch,str_replace,multi_edit,insert). - Real-time file heartbeats: Emits direct file-write heartbeats labeled with category
"ai coding", pinpointing the exact project file and programming language. - Transcript activity sync: Uses
wakatime-cli --sync-ai-activityto parse session transcripts for duration, turns, and token changes without transmitting private prompt contents. - Sequential command queue: Sync operations are queued and coalesced to avoid concurrent child process collisions or SQLite/Bolt database locking on local offline queues.
- Offline resilience: Network drops are handled gracefully by
wakatime-cli, which queues heartbeats locally in~/.wakatime/offline_heartbeats.bdband flushes them when connectivity resumes.
Slash Commands & Diagnostic CLI
Inside an Active Session
Use the /wakatime slash command in your agent TUI:
/wakatime status— Displays runtime engine (Pi vs OMP), CLI version, configured paths, API key status, and today's tracked coding time./wakatime today— Displays today's total tracked coding time directly in the chat./wakatime sync— Manually triggers an immediate background activity sync./wakatime update(or/wakatime install) — Downloads or updateswakatime-cli./wakatime log— Views the last 20 lines of~/.wakatime/waka-pi.log.
From Terminal (CLI)
Run diagnostic or maintenance tasks directly from your terminal using npx:
# Check status, configuration, and today's tracked coding time
npx waka-pi --status
# View today's tracked coding time directly
npx waka-pi --today
# Trigger an immediate sync for a specific workspace
npx waka-pi --sync /path/to/project
# Download or update wakatime-cli binary
npx waka-pi --install
(During local development, you can also run node ./bin/waka-pi.js --status)
Configuration and Troubleshooting
Standard ~/.wakatime.cfg settings are respected:
- Debug logging: Add
debug = trueunder[settings]in~/.wakatime.cfg. - Proxy: Set
proxy = https://user:pass@proxy.corp:8080. - Self-signed certificates: Set
no_ssl_verify = trueunder[settings]. - Alternate home directory: Set the
WAKATIME_HOMEenvironment variable to use an alternate root containing.wakatime.cfgand.wakatime/.
Log Locations:
- Plugin logs:
~/.wakatime/waka-pi.log - CLI logs:
~/.wakatime/wakatime.log
Development
# Install development dependencies
bun install
# or: npm install
# Build TypeScript to ./dist
bun run build
# or: npm run build
# Run unit tests
bun test
# or: npm test
License
MIT
[!NOTE]
waka-piis an independent community open-source project and is not affiliated with, endorsed by, or sponsored by WakaTime LLC. WakaTime is a registered trademark of WakaTime LLC.