{"id":48469462,"url":"https://github.com/gramanoid/focuslens","last_synced_at":"2026-04-07T06:01:39.408Z","repository":{"id":349545757,"uuid":"1201931374","full_name":"gramanoid/focuslens","owner":"gramanoid","description":"A native macOS menu bar app that silently captures your screen, classifies activity with a local vision model, and visualizes work patterns — all on-device, no cloud.","archived":false,"fork":false,"pushed_at":"2026-04-06T14:11:00.000Z","size":1280,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T14:35:11.074Z","etag":null,"topics":["activity-tracker","llama-cpp","macos","menu-bar-app","on-device-ai","privacy","productivity","screen-capture","swift","swiftui"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gramanoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-05T11:08:33.000Z","updated_at":"2026-04-06T14:25:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gramanoid/focuslens","commit_stats":null,"previous_names":["gramanoid/focuslens"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gramanoid/focuslens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gramanoid%2Ffocuslens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gramanoid%2Ffocuslens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gramanoid%2Ffocuslens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gramanoid%2Ffocuslens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gramanoid","download_url":"https://codeload.github.com/gramanoid/focuslens/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gramanoid%2Ffocuslens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31501903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["activity-tracker","llama-cpp","macos","menu-bar-app","on-device-ai","privacy","productivity","screen-capture","swift","swiftui"],"created_at":"2026-04-07T06:01:39.058Z","updated_at":"2026-04-07T06:01:39.403Z","avatar_url":"https://github.com/gramanoid.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FocusLens\n\nA native macOS menu bar app that silently captures your screen and keystrokes, classifies your activity with a local vision model, and visualizes your work patterns — all without sending a single byte off your Mac.\n\n## What It Does\n\nFocusLens takes periodic screenshots, records what you type, sends both to a local `llama.cpp` vision server running on your machine, and builds a searchable timeline of what you were working on. Think of it as a private activity journal powered by on-device AI — with three layers of signal for maximum accuracy.\n\n### Three Layers of Tracking\n\n| Layer | What It Captures | How It Helps |\n| --- | --- | --- |\n| **Screenshots** | Periodic screen captures at configurable intervals | Visual context — what's on screen |\n| **OCR + Vision** | Local vision model classifies app, category, and task | Structured activity data |\n| **Keystrokes** | Actual characters typed, grouped by app | Ground truth — what you wrote, coded, or sent |\n\nA screenshot of Slack is ambiguous. A screenshot of Slack + \"typed 'let's push the deadline to Friday'\" gives the model definitive context.\n\n### Features\n\n- **Menu bar app** — lives in your menu bar, no Dock icon, no distractions\n- **Local-only AI** — all inference runs on your Mac via `llama-server`\n- **Keystroke tracking** — records typed text per-app, injects into classification prompt for richer analysis\n- **Auto model management** — pick from 4 recommended models, FocusLens downloads and starts the server for you\n- **Activity timeline** — scrollable card-based view with app icons, task descriptions, and confidence scores\n- **Insights dashboard** — category breakdown, hourly heatmap, focus score trends, context switch tracking\n- **AI analysis** — ask your local model to analyze your productivity patterns with keystroke context\n- **CSV / JSON / Markdown export** — get your data out in any format\n- **Privacy-first** — screenshots can be auto-deleted, keystrokes stored locally, password fields auto-skipped\n\n## Requirements\n\n- macOS 13.0+\n- [llama.cpp](https://github.com/ggerganov/llama.cpp) (`brew install llama.cpp`)\n- Xcode or Swift 5.9+ toolchain (to build)\n\n## Quick Start\n\n```bash\n# Install dependencies\nbrew install llama.cpp xcodegen\n\n# Clone and build\ngit clone https://github.com/gramanoid/focuslens.git\ncd focuslens\nxcodegen generate\nopen FocusLens.xcodeproj\n```\n\nOr build directly with SwiftPM:\n\n```bash\nswift build\n```\n\n## First Launch\n\n1. **Grant Screen Recording** — macOS will prompt you, or use the in-app setup flow\n2. **Grant Accessibility** (optional) — enables keystroke tracking for richer classification\n3. **Select a model** — open Preferences and pick from the recommended models:\n\n| Model | Size | Best For |\n| --- | --- | --- |\n| **Qwen2-VL 2B** | ~1.7 GB | Lightweight daily use, great OCR |\n| Moondream 2 | ~1.7 GB | Fast app detection |\n| LLaVA 1.5 7B | ~4 GB | Detailed task descriptions |\n| LLaVA 1.6 Mistral 7B | ~4.5 GB | Highest accuracy |\n\n3. **FocusLens downloads the model and starts the server automatically** — no Terminal commands needed\n4. **Your first capture happens** within the configured interval (default: 1 minute)\n\n## Architecture\n\n```\nFocusLens/\n├── App/          # AppState, app lifecycle\n├── AI/           # LlamaCppClient, ModelDefinition, ModelDownloadManager, ServerProcessManager\n├── Capture/      # Screen capture + keystroke monitoring\n├── Storage/      # SQLite via GRDB (sessions, keystrokes, analyses)\n├── UI/           # SwiftUI views, design tokens (DS enum)\n│   └── ActivityExplorer/\n│       ├── TimelineTab/    # Card timeline + Gantt view\n│       ├── InsightsTab/    # Charts, heatmap, focus score\n│       └── AIAnalysisTab/  # Streaming LLM analysis\n└── Utils/        # Image helpers, app icon resolver\n```\n\n## Design System\n\nAll UI values are centralized in `FocusLens/UI/DesignTokens.swift`:\n\n- **`DS.Radius`** — 4-step corner radius scale (sm/md/lg/xl)\n- **`DS.Surface`** — semantic dark-surface opacity hierarchy (inset/card/raised/overlay)\n- **`DS.Accent`** — emerald primary (#10B981), warning, caution, processing\n- **`DS.Spacing`** — 4pt base grid\n- **`DS.Emphasis`** — accent tint opacity scale (subtle/medium/strong)\n- **`DS.Motion`** — animation duration tokens with `motionSafe()` modifier for reduced-motion support\n\n## Storage\n\nAll data stays local:\n\n- **Database**: `~/Library/Application Support/FocusLens/focuslens.sqlite`\n- **Screenshots**: `~/Library/Application Support/FocusLens/screenshots/` (configurable)\n\nScreenshots are saved as `YYYY-MM-DD_HH-mm-ss_AppName.png`.\n\n## Privacy\n\n- All inference runs on localhost via `llama-server` — no cloud APIs\n- No telemetry, no analytics, no network calls beyond `localhost`\n- Screenshots are optional and can be auto-deleted after classification\n- Keystroke data is stored locally in the same SQLite database — never leaves your Mac\n- Password fields are automatically skipped (macOS secure input returns nil to global monitors)\n- Keystroke tracking is optional and can be toggled off in Preferences\n- Communication apps that block screen capture (Telegram, WhatsApp) are detected and handled gracefully\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgramanoid%2Ffocuslens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgramanoid%2Ffocuslens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgramanoid%2Ffocuslens/lists"}