Skip to content
archived Visibility internal Owner erik@uvilo.com Approver _ Created _ Updated _

Git Status Spec

Command: /git-status [repo_path] [--commits N]

Purpose

Generate a git status dashboard displayed via an iframe artifact pointing to a hosted Astro page. The data is passed in the URL hash — no private data touches the server.

Usage

  • /git-status → defaults to /workspace/erik/uvilo-os, 0 recent commits
  • /git-status /workspace/erik/other-repo → any git checkout on the volume
  • /git-status --commits 5 or /git-status -c 5 → show 5 recent commits
  • /git-status --commits 0 or /git-status -c 0 → skip recent commits section entirely (default)

Architecture

LibreChat artifact (text/html)
  └── <iframe> → https://os.uvilo.com/artifacts/git-status?bypass_params#BASE64_DATA
                    └── Standalone Astro page (vanilla JS, CSS variables)
                          └── Reads hash → decodes base64 → parses JSON → renders dashboard

Security model:

  • The hosted page is an empty shell — zero data on the server
  • All private data (commits, branches, files) lives only in the URL fragment (#hash)
  • The hash is never sent to the server in HTTP requests
  • Vercel Deployment Protection is bypassed via automation token (stored in .secrets)
  • Content-Security-Policy: frame-ancestors * is set for /artifacts/* routes

Data Gathering

Run these calls in parallel where possible:

  1. git_status → branch name, list of uncommitted files (staged + unstaged + untracked)
  2. git_log (max_count=N, default 0; if 0 still fetch max_count=1 for HEAD commit) → recent commit history
  3. git_branch (branch_type=“local”) → list of local branches
  4. git_fetch → ensure remote refs are up to date

Then sequentially:

  1. git_diff (target=origin/<branch>..HEAD) → committed but unpushed changes
    • If this fails (no remote tracking branch), note “no remote tracking branch”

Deriving URLs

GitHub:

  • Branch: https://github.com/ErikDakoda/uvilo-os/tree/<branch>
  • For other repos: parse the remote URL or ask the user

GitHub Diff:

  • If branch != dev: https://github.com/ErikDakoda/uvilo-os/compare/dev...<branch>
  • If branch == dev: https://github.com/ErikDakoda/uvilo-os/commit/<HEAD_sha>
  • Store as links.githubDiff

Vercel Preview (uvilo-os only):

  • Call getDeployments with teamId="uvilo", limit=5
  • Find the most recent deployment whose meta.githubCommitRef matches the current branch
  • Use the branch alias from deployment meta for the preview URL
  • Include the Vercel Inspector link from inspectorUrl
  • Skip this section entirely for non-uvilo-os repos

Vercel Bypass Token

Read from /workspace/librechat/.secrets:

{
  "vercel": {
    "protection_bypass": "TOKEN"
  }
}

Rendering

Step 1: Build STATUS_DATA

const STATUS_DATA = {
  repo: "uvilo-os",
  branch: "work/erik/feature-branch",
  isClean: true,
  upToDateWithRemote: true,
  headCommit: {
    sha: "abc1234",
    message: "commit message",
    date: "2026-03-13 02:43 UTC",
  },
  localBranches: ["main", "dev", "work/erik/..."],
  uncommittedFiles: [
    // { path: "src/foo.ts", status: "modified" }
    // Empty array if clean
  ],
  unpushedCommits: [
    // { sha: "abc1234", message: "...", date: "HH:MM" }
    // Empty array if synced
  ],
  recentCommits: [
    // { sha: "abc1234", message: "...", date: "HH:MM" }
    // Empty array or omit entirely if --commits 0 (default)
    // Section is hidden when empty
  ],
  // Links — all optional, omit keys if not available
  links: {
    github: "https://github.com/...",
    githubDiff: "https://github.com/.../compare/dev...branch",  // diff URL
    preview: "https://...",              // uvilo-os only
    vercelInspector: "https://...",      // uvilo-os only
  },
  // Deployment — optional, omit entirely for non-Vercel repos
  deployment: {
    state: "READY",        // READY | BUILDING | ERROR | QUEUED
    commitSha: "abc1234",
    commitMessage: "...",
    createdAt: "2026-03-13 02:43 UTC",
  },
};

Step 2: Output artifact

Output a text/html artifact with identifier git-status-dashboard:

<!DOCTYPE html>
<html><head>
<style>*{margin:0;padding:0}html,body,iframe{width:100%;height:100vh;overflow:hidden}</style>
</head><body>
<iframe id="f" style="border:none;width:100%;height:100vh"></iframe>
<script>
var d = STATUS_DATA_JSON_HERE;
var h = btoa(unescape(encodeURIComponent(JSON.stringify(d))));
var b = "BYPASS_TOKEN_HERE";
document.getElementById("f").src =
  "https://os.uvilo.com/artifacts/git-status?x-vercel-protection-bypass=" + b +
  "&x-vercel-set-bypass-cookie=samesitenone#" + h;
</script>
</body></html>

Replace STATUS_DATA_JSON_HERE with the actual JSON object (not stringified — raw JS object literal). Replace BYPASS_TOKEN_HERE with the token from .secrets.

Important: The artifact type must be text/html, not application/vnd.react. The identifier must always be git-status-dashboard so it updates in place.

Dark Mode

The hosted Astro page uses CSS custom properties with a [data-theme="dark"] selector. Theme detection is via prefers-color-scheme media query with a manual three-way toggle (Light / System / Dark). Since this is our own page (not a CodeSandbox artifact), CSS variables work properly — no inline style workarounds needed.

Hosted Page

Location: .internal/src/pages/artifacts/git-status.astro Route: https://os.uvilo.com/artifacts/git-status

The page is a standalone Astro page (no Starlight layout). It uses:

  • Vanilla JavaScript (no React/framework dependency)
  • Inline SVG icons (Lucide paths)
  • CSS custom properties for theming
  • is:inline script to avoid module bundling (onclick handlers need global scope)

Deployment Notes

  • The page must be merged to dev branch and deployed to os.uvilo.com before the iframe approach works from artifacts
  • Vercel header override in .internal/vercel.json sets Content-Security-Policy: frame-ancestors * for /artifacts/* routes
  • The Vercel bypass token in the URL allows the iframe to load through Deployment Protection