{"id":51292539,"url":"https://github.com/nermalcat69/macstats","last_synced_at":"2026-06-30T11:32:19.171Z","repository":{"id":366218189,"uuid":"1257728701","full_name":"nermalcat69/macstats","owner":"nermalcat69","description":"macos stats daemon(hardware efficient \u0026 minimal)","archived":false,"fork":false,"pushed_at":"2026-06-03T17:34:09.000Z","size":123,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T20:27:45.744Z","etag":null,"topics":["daemon","macos","stats"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nermalcat69.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-03T00:41:03.000Z","updated_at":"2026-06-14T13:45:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nermalcat69/macstats","commit_stats":null,"previous_names":["nermalcat69/macstats"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nermalcat69/macstats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nermalcat69%2Fmacstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nermalcat69%2Fmacstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nermalcat69%2Fmacstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nermalcat69%2Fmacstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nermalcat69","download_url":"https://codeload.github.com/nermalcat69/macstats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nermalcat69%2Fmacstats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34965642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daemon","macos","stats"],"created_at":"2026-06-30T11:32:19.060Z","updated_at":"2026-06-30T11:32:19.148Z","avatar_url":"https://github.com/nermalcat69.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MacStats\n\nPersonal productivity analytics for your Mac — counts keystrokes, clicks, scroll, and battery health entirely locally.\n\n## Screenshot\n\n\u003c!-- screenshot placeholder --\u003e\n\n## Features\n\n- Keystroke, left/right click, and scroll tracking\n- Real-time WPM with 60 s sliding window and burst/repeat filtering\n- Battery health, charge %, and cycle count via IOKit (sampled every 5 min)\n- Activity sessions with idle detection (60 s threshold)\n- Achievements unlocked by lifetime usage milestones\n- All data stored locally in SQLite (`~/Library/Application Support/MacStats/macstats.db`)\n- SvelteKit web dashboard embedded in the binary — no separate server needed\n- CLI for quick stats without opening a browser\n\n## Requirements\n\n- macOS 13 Ventura or later\n- [Rust](https://rustup.rs) (stable)\n- [Node.js](https://nodejs.org) 18+ (to build the dashboard)\n\n## Install\n\n```sh\n# 1. Build the dashboard\ncd dashboard\nnpm install\nnpm run build\ncd ..\n\n# 2. Build the binary\ncargo build --release\n\n# 3. Install daemon + launchd agent (run once)\n~/.local/bin/macstats install   # or: ./target/release/macstats install\n```\n\n`install` copies the binary into `~/.local/bin/MacStats.app`, writes a launchd plist, and starts the daemon. Make sure `~/.local/bin` is on your `PATH`.\n\n## Permissions\n\nMacStats needs two permissions under **System Settings → Privacy \u0026 Security**:\n\n| Permission | Why |\n|---|---|\n| **Accessibility** | Required by the AX API to register a trusted process |\n| **Input Monitoring** | rdev uses `kCGEventTapOptionListenOnly`; on Sonoma+ this requires a separate TCC grant. Without it the tap starts silently but no events arrive. |\n\nmacOS remembers permissions by bundle ID (`com.graycup.macstats`), so you only need to grant them once — even after rebuilding.\n\nAfter granting both, run:\n\n```sh\nmacstats daemon restart\nmacstats accessibility   # confirms both are active\n```\n\n## Usage\n\n```sh\nmacstats               # today's overview (default)\nmacstats today         # same as above\nmacstats keyboard      # lifetime + today keystroke counts\nmacstats typing        # WPM stats\nmacstats mouse         # click and scroll counts\nmacstats battery       # battery health and charge\nmacstats uptime        # reboots, sleeps, wakes\nmacstats sessions      # recent activity sessions\nmacstats achievements  # unlocked milestones\nmacstats export json   # dump all data as JSON\nmacstats export csv    # daily history as CSV\n\nmacstats daemon start | stop | restart | status\nmacstats accessibility   # check/request permissions\n```\n\n## Dashboard\n\n```\nopen http://localhost:8421\n```\n\nThe dashboard is served by the daemon on port 8421. It is embedded directly in the binary so there is nothing extra to run.\n\n## Updating\n\n```sh\ncargo build --release\nmacstats install\n```\n\n`install` replaces the binary inside the bundle and restarts the daemon.\n\n## Architecture\n\nThe `macstats` binary doubles as CLI and daemon (`macstats serve`). The daemon runs the rdev event tap on the main thread (required for the macOS CFRunLoop) and spawns a tokio runtime on a background thread for the Axum API server, per-minute aggregation, battery sampling, and system event watching. Metrics are flushed to SQLite every minute and rolled up from minute → hourly → daily → monthly on a schedule. The SvelteKit frontend is compiled to static files and embedded at build time via `include_dir!`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnermalcat69%2Fmacstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnermalcat69%2Fmacstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnermalcat69%2Fmacstats/lists"}