{"id":25845328,"url":"https://github.com/vib795/flaunt-github","last_synced_at":"2026-04-12T01:40:50.081Z","repository":{"id":276864108,"uuid":"930500083","full_name":"vib795/flaunt-github","owner":"vib795","description":"VS Code extension that transforms every file save into a digital milestone, capturing your coding journey like a living GitHub contribution chart. ","archived":false,"fork":false,"pushed_at":"2025-05-15T01:29:28.000Z","size":242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-27T00:36:29.159Z","etag":null,"topics":["github","microsoft","nodejs","npm","tracking","typescript","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/vib795.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}},"created_at":"2025-02-10T18:24:22.000Z","updated_at":"2025-05-15T00:06:43.000Z","dependencies_parsed_at":"2025-02-10T21:33:47.796Z","dependency_job_id":"64e9976e-2aa9-4160-85d4-aaedd3be600a","html_url":"https://github.com/vib795/flaunt-github","commit_stats":null,"previous_names":["vib795/flaunt-github"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/vib795/flaunt-github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vib795%2Fflaunt-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vib795%2Fflaunt-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vib795%2Fflaunt-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vib795%2Fflaunt-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vib795","download_url":"https://codeload.github.com/vib795/flaunt-github/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vib795%2Fflaunt-github/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259546413,"owners_count":22874560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["github","microsoft","nodejs","npm","tracking","typescript","vscode","vscode-extension"],"created_at":"2025-03-01T08:18:32.797Z","updated_at":"2026-04-12T01:40:50.067Z","avatar_url":"https://github.com/vib795.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flaunt GitHub\n\n**Flaunt GitHub** is a Visual Studio Code / Cursor extension that quietly:\n\n- Tracks your coding activity (saves, autosave snapshots, and workspace diffs)\n- Writes human-readable summaries to `coding_summary.txt`\n- Periodically commits and pushes those summaries to a private GitHub repository\n\nIf you keep autosave on and never press \u003ckbd\u003eCtrl+S\u003c/kbd\u003e/\u003ckbd\u003eCmd+S\u003c/kbd\u003e, it still captures your work and ships meaningful summary commits.\n\n---\n\n## 🔍 At a Glance\n\n- 🧠 **Edit-aware \u0026 autosave-friendly** – works even if you never manually save\n- 🔐 **Secure GitHub auth** – uses VS Code’s GitHub authentication and Secret Storage\n- 📁 **Automatic repo management** – ensures a `code-tracking` repo exists and is kept in sync\n- 🧾 **Rolling coding journal** – appends timestamped entries to `coding_summary.txt`\n- 📊 **Built-in metrics** – language usage, session durations, and diff stats\n- ✅ **Clean Git behavior** – only commits \u0026 pushes when there are real changes\n\n---\n\n## 🆕 What’s New in v2.1.2\n**Version: 2.1.2**\nDowngraded `vscode` to `^1.90.0` to make it compatible with a wider range of VS Code versions.\n\n**Version: 2.1.1**\n\nThis release focuses on **reliability and completeness of tracking**, especially in tricky autosave and “modified but not dirty” scenarios:\n\n- ✅ **Workspace diff fallback (smarter tracking):**\n  - At the end of each interval, if:\n    - No manual saves were seen, **and**\n    - No dirty documents are present, **but**\n    - The workspace Git diff (vs `HEAD`) shows changes,\n  - The extension logs a synthetic entry:\n    ```text\n    [timestamp]: Workspace diff snapshot (+X/−Y)\n    ```\n  - This guarantees that intervals with real Git changes still yield a summary commit, even if our usual signals didn’t fire.\n\n- 🔁 **Refined interval logic:**\n  - Priority order per interval:\n    1. Log **manual saves**.\n    2. Log **auto-snapshots** for dirty docs and auto-save them.\n    3. If still no activity, log **workspace diff snapshot** (when needed).\n    4. Only then commit \u0026 push when there is something to record.\n\n- 🧹 **No-op intervals are truly no-op:**\n  - If the tracking repo has no changes for that interval:\n    - No commit.\n    - No push.\n    - A log entry explains that nothing happened.\n\n---\n\n## 🧩 v2.x History (Context)\n\n### v2.1.0\n\n- Switched to **VS Code’s GitHub authentication** as the primary mechanism:\n  - Uses `vscode.authentication.getSession('github', ['read:user', 'repo'], { createIfNone: true })`.\n  - Token and username are stored securely in **Secret Storage**.\n- **Backup auth path**:\n  - If configured, `codeTracking.githubToken` and `codeTracking.githubUsername` in `settings.json` are used once and then cached in Secret Storage.\n\n### v2.0.1\n\n- Only creates commits when the tracking repo actually changed.\n- Only pushes when a commit occurred (no more push calls on completely clean intervals).\n- Minor logging and internal cleanups.\n\n### v2.0.0\n\n- Introduced **autosave-friendly tracking** and **edit-based auto snapshots**:\n  - If there were edits but no manual saves, the extension auto-saves and logs:\n    ```text\n    [timestamp]: Auto-snapshot path/to/file.ts\n    ```\n- Extended **metrics** (language counts, session durations) via the **Show Code Tracking Metrics** command.\n\n---\n\n## ⚙️ How It Works\n\n### 1. Repository Management\n\nOn activation (per VS Code / Cursor window with a workspace):\n\n1. Resolves GitHub credentials (see “Authentication” below).\n2. Ensures a private `code-tracking` repo exists in your GitHub account:\n   - If missing, it creates it (`private`, `auto_init: true`).\n3. Clones that repo into the extension’s global storage directory, e.g.:\n\n  ```text\n  \u003cglobalStorage\u003e/utkarshsingh.flaunt-github/code-tracking\n  ```\n\n4. Configures the remote with an authenticated URL so it can push commits.\n\n---\n\n### 2. Authentication Strategy\n\nFlaunt GitHub resolves credentials in this order:\n\n1. **Secret Storage (preferred)**\n\n   * If `codeTracking.githubToken` and `codeTracking.githubUsername` were previously stored in Secret Storage, those are used.\n\n2. **Backup: Settings (`settings.json`)**\n\n   * If `codeTracking.githubToken` and `codeTracking.githubUsername` are present:\n\n     * They are used for the session.\n     * They are then persisted into Secret Storage for future activations.\n\n3. **VS Code GitHub Auth Provider (auto-login)**\n\n   * If nothing is available, the extension calls:\n\n     ```ts\n     vscode.authentication.getSession('github', ['read:user', 'repo'], { createIfNone: true });\n     ```\n   * VS Code shows the standard “Sign in with GitHub” UI.\n   * The returned access token and username are stored in Secret Storage.\n\n\u003e 💡 **Recommendation:**\n\u003e Let VS Code handle GitHub sign-in and Secret Storage. Only use `codeTracking.githubToken` as a fallback if you can’t use the built-in auth flow.\n\n---\n\n### 3. Activity Tracking Lifecycle\n\nThe extension builds up a text buffer (`codingSummary`) during each interval.\n\n#### a) Manual Saves\n\nFor every `file://` document save (not triggered by the extension itself):\n\n```text\n[timestamp]: Saved relative/path/to/file.ts\n```\n\n* Recorded into `codingSummary`.\n* Used to increment per-language save counts.\n\nAutosave controlled by VS Code still triggers the same save events; the extension just ignores saves that it knows it initiated itself.\n\n#### b) Auto Snapshots (Unsaved Edits)\n\nAt the end of each interval:\n\n* If **no manual save** was detected:\n\n  * The extension looks for **dirty documents** (`isDirty === true`) with `file://` URIs.\n  * If found:\n\n    * It logs one `Auto-snapshot ...` line per file:\n\n      ```text\n      [timestamp]: Auto-snapshot src/extension.ts\n      ```\n    * Calls `vscode.workspace.saveAll(false)` while marking that it’s in an auto-save cycle (to avoid double-logging the save events).\n    * Tracks language usage for these docs as well.\n\n#### c) Workspace Diff Fallback (v2.1.1)\n\nIf, after (a) and (b):\n\n* `codingSummary` is still empty, **and**\n* A Git diff exists between your workspace and `HEAD`:\n\nThen the extension logs a snapshot based on `git diff --stat`/`diffSummary()` output:\n\n```text\n[timestamp]: Workspace diff snapshot (+X/−Y)\n```\n\nThis ensures commits are created for real Git changes even if:\n\n* The files weren’t open in the editor,\n* No dirty docs were visible,\n* Or some edge case bypassed file events.\n\n---\n\n### 4. Commit \u0026 Push Lifecycle\n\nAt the end of an interval:\n\n1. **Skip no-op intervals**\n\n   * If `codingSummary` is still empty:\n\n     * Logs: `No coding summary recorded this interval; skipping commit/push.`\n     * Returns early – no commit, no push.\n\n2. **Fetch \u0026 Merge**\n\n   * In the tracking repo:\n\n     ```bash\n     git fetch\n     git merge origin/main --strategy-option=theirs\n     ```\n   * Keeps the repo in sync across multiple machines, favoring remote changes for conflicts.\n\n3. **Write Summary \u0026 Stage**\n\n   * Appends `codingSummary` to `coding_summary.txt`.\n   * Stages it:\n\n     ```bash\n     git add coding_summary.txt\n     ```\n\n4. **Commit Only If Needed**\n\n   * If the repo has no staged changes after this step:\n\n     * Logs that there’s nothing to commit.\n     * Skips the commit and push.\n\n5. **Commit \u0026 Push (when there are changes)**\n\n   * Creates a commit with a message like:\n\n     ```text\n     [FlauntGithub] (+12/−3) Coding activity summary - 11/30/2025, 12:07:44 PM\n     ```\n   * Pushes to `origin/main`.\n\n6. **Milestones**\n\n   * Every 10 commits, you get a small in-editor celebration message.\n\n---\n\n## 🧮 Metrics \u0026 Reporting\n\nThe command **“Show Code Tracking Metrics”** prints a report to the `FlauntGitHubLog` output channel, including:\n\n* **Language Save Counts**\n  Aggregate counts of saves (and snapshots) per `languageId`.\n\n* **Session Durations**\n  Per-file active session time, derived from `onDidOpenTextDocument` / `onDidCloseTextDocument`, formatted like `1h 12m 5s`.\n\n* **Diff Summary (Tracking Repo)**\n  Uncommitted `+added/−removed` lines for the tracking repo (`coding_summary.txt`).\n\n* **Optional Workspace Diff**\n  Overall added/removed lines for your current workspace repo (if applicable).\n\n---\n\n## ⏱ Status Bar\n\nA status bar item shows a live countdown:\n\n```text\nNext commit in 4m 59s\n```\n\nThis resets each interval and gives you a quick sense for when the next summary commit will happen.\n\n---\n\n## ⚙️ Configuration\n\nConfigure via the UI or in `settings.json`.\n\n### Core Settings\n\n```jsonc\n{\n  // Interval in minutes between automatic commits (default: 30)\n  \"codeTracking.commitInterval\": 30,\n\n  // Optional: prefix for commit messages\n  \"codeTracking.commitMessagePrefix\": \"[FlauntGithub] \",\n\n  // Optional: timezone for timestamps in logs and commit messages\n  // Defaults to your system timezone if omitted\n  \"codeTracking.timeZone\": \"America/Chicago\",\n\n  // Optional: track file open events (default: false)\n  \"codeTracking.trackFileOpens\": false\n}\n```\n\n### Backup Auth Settings (Optional)\n\nUsed only as a fallback if Secret Storage is empty and no GitHub auth session exists:\n\n```jsonc\n{\n  // Optional: GitHub username (e.g., \"vib795\")\n  \"codeTracking.githubUsername\": \"your-github-username\",\n\n  // Optional: GitHub PAT with \"repo\" scope\n  \"codeTracking.githubToken\": \"ghp_your_token_here\"\n}\n```\n\n\u003e 🔐 **Security tip:** Prefer VS Code’s GitHub sign-in flow + Secret Storage.\n\u003e Use PATs in settings only if necessary.\n\n---\n\n## 🧭 Usage\n\n1. **Install the Extension**\n\n   * Install the generated `.vsix` in VS Code / Cursor.\n\n2. **Open a Workspace**\n\n   * The extension activates only when a folder/workspace is open.\n\n3. **Authenticate Once**\n\n   * If needed, VS Code prompts you to sign in with GitHub.\n   * On first run, the extension ensures your `code-tracking` repo exists and clones it.\n\n4. **Code Normally**\n\n   * With or without autosave enabled:\n\n     * Manual saves produce `Saved ...` entries.\n     * Unsaved edits can produce `Auto-snapshot ...` entries.\n     * Workspace-level diff can produce `Workspace diff snapshot ...` entries.\n\n5. **Let the Timer Do Its Thing**\n\n   * Watch the status bar timer.\n   * At each interval, a commit \u0026 push happens when there’s real tracked activity.\n\n6. **Manual Commit (Optional)**\n\n   * Run **Start Code Tracking** from the Command Palette to force an immediate summary commit \u0026 push (if any activity has been logged).\n\n7. **Inspect Metrics**\n\n   * Run **Show Code Tracking Metrics** to see language counts, sessions, and diffs in `FlauntGitHubLog`.\n\n---\n\n## 🔧 Requirements\n\n* **VS Code / Cursor:** v1.106.0 or later (aligned with `engines.vscode`).\n* **Git:** Installed and available on your system `PATH`.\n* **GitHub Account:** With permission to create and push to a private repo.\n* Network access to `github.com`.\n\n---\n\n## 📝 Changelog\n\n### v2.1.1\n\n* Added a **workspace diff fallback**:\n\n  * If no saves and no dirty docs are observed, but Git diff shows changes, a `Workspace diff snapshot` entry is logged so the interval still produces a meaningful commit.\n* Tightened commit/push behavior around these snapshots so every commit corresponds to actual repo changes.\n\n### v2.1.0\n\n* Switched to **VS Code GitHub auth** as the primary credential source.\n* Added **Secret Storage** integration.\n* Kept `codeTracking.githubToken` and `codeTracking.githubUsername` as optional backup paths.\n\n### v2.0.1\n\n* Ensured **no commit** and **no push** on completely clean intervals.\n* Adjusted logging and internal logic for clarity.\n\n### v2.0.0\n\n* Introduced **autosave-friendly tracking** and **edit-based auto snapshots**.\n* Exposed extended metrics via **Show Code Tracking Metrics**.\n\n---\n\n**Flaunt your progress. Flaunt GitHub.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvib795%2Fflaunt-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvib795%2Fflaunt-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvib795%2Fflaunt-github/lists"}