Skip to content

Jackeyhate9/local-ai-ops-desktop

Repository files navigation

Local AI Ops Desktop

Local AI Ops Desktop is a Windows-first desktop tool for people who run AI open-source projects locally. It scans folders for Git repositories, imports projects into SQLite, checks upstream status, analyzes update risk, performs safer git pull --ff-only updates with backups, and supports rollback.

Local AI Ops Desktop dashboard

Tech Stack

  • Tauri v2
  • React + TypeScript + Vite
  • Rust Tauri commands
  • SQLite via rusqlite
  • Windows EXE / MSI / NSIS packaging through Tauri

Windows Setup From Zero

Install these tools first:

  1. Install Git for Windows: https://git-scm.com/download/win
  2. Install Node.js 20 or newer: https://nodejs.org/
  3. Install Rust stable with rustup: https://rustup.rs/
  4. Install Microsoft Visual Studio Build Tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/
  5. In Visual Studio Build Tools, select Desktop development with C++ and include MSVC plus a Windows SDK.
  6. Install or repair WebView2 Evergreen Runtime: https://developer.microsoft.com/microsoft-edge/webview2/
  7. Restart PowerShell after installing Git, Node or Rust so PATH is refreshed.

Install dependencies. This uses local project node_modules and does not install npm packages globally:

cd C:\path\to\local-ai-ops-desktop
npm install

Run the Windows environment diagnostic:

powershell -ExecutionPolicy Bypass -File scripts/check_env.ps1

The diagnostic checks node, npm, git, rustc, cargo, WebView2, Visual Studio Build Tools, npm install --dry-run, frontend build, and cargo check.

Local Run

Run the web UI only:

npm run dev

Run the full Tauri desktop app:

npm run tauri:dev

Equivalent npm script aliases:

npm run check:env
npm run mcp:smoke
npm run smoke:windows
npm run screenshot

Build Windows EXE / Installer

npm install
npm run check:env
npm run tauri:build

Tauri writes the Windows bundles under:

src-tauri\target\release\bundle\

The default Tauri config builds an NSIS setup EXE. MSI packaging needs WiX; if GitHub WiX downloads are unstable, keep NSIS as the reliable installer target or preinstall/cache WiX before adding msi back to src-tauri/tauri.conf.json.

Smoke Test

npm run smoke

Windows smoke with local dependency install and frontend preflight:

powershell -ExecutionPolicy Bypass -File scripts/smoke_windows.ps1

The smoke test creates a temporary Git repository, adds a GitHub-style remote URL, scans it, imports it into SQLite, checks that Git status returns a reasonable status, and verifies scan/check log rows are written.

If cargo is missing, smoke_windows.ps1 still runs the Node-backed backend core logic harness and prints a warning that the Tauri Rust command layer could not be compiled.

Screenshots And Visual Verification

Capture the built web UI with a local Chromium-family browser:

npm run screenshot

The script runs npm run build, starts vite preview on http://127.0.0.1:4173, and saves a PNG under screenshots\. It uses Microsoft Edge, Chrome, Chromium, or Brave in headless mode. If no browser is found, install Microsoft Edge or Chrome and rerun:

powershell -ExecutionPolicy Bypass -File scripts/capture_screenshots.ps1

Manual verification path:

npm run build
npm run preview -- --host 127.0.0.1 --port 4173

Then open http://127.0.0.1:4173, check the Dashboard, Scan, Projects, Logs, and Settings pages, and confirm there are no console errors.

MCP Server Wrapper

This repo includes a stdio MCP server wrapper for agent tools:

npm install
npm run mcp

Direct command:

node scripts/mcp-server.mjs

Run the MCP protocol smoke test:

npm run mcp:smoke

The wrapper uses the same default SQLite location as the desktop app:

%LOCALAPPDATA%\local-ai-ops-desktop\local-ai-ops.sqlite3

For isolated tests or agent sandboxes, set:

$env:LOCAL_AI_OPS_DB = "C:\temp\local-ai-ops-test.sqlite3"
npm run mcp

Available MCP tools:

  • get_dashboard_stats: read dashboard counters.
  • get_default_scan_roots: return existing default scan roots.
  • scan_projects: scan folders for Git repositories.
  • import_scan_result: import a scanned repo into managed projects.
  • list_projects: list managed projects.
  • check_project_update: fetch/check ahead, behind, dirty and upstream state.
  • analyze_update_risk: rule-based update risk summary.
  • safe_update_project: backup and git pull --ff-only; dirty projects require dirtyStrategy=move or dirtyStrategy=overwrite.
  • list_logs: read recent operation logs.
  • list_backups: read backup records for a project.

Security note: safe_update_project can run git reset --hard, git clean -fd, and git pull --ff-only depending on the selected dirty strategy. Keep human approval enabled in your agent client for this tool.

Example MCP stdio config:

{
  "mcpServers": {
    "local-ai-ops": {
      "command": "node",
      "args": [
        "C:\\path\\to\\local-ai-ops-desktop\\scripts\\mcp-server.mjs"
      ],
      "env": {
        "LOCAL_AI_OPS_DB": "C:\\Users\\you\\AppData\\Local\\local-ai-ops-desktop\\local-ai-ops.sqlite3"
      }
    }
  }
}

Agent Integration: OpenClaw, Hermes, Codex

Integration status:

  • Compatible as a Windows desktop app and local Git/PowerShell project.
  • Compatible with agents that can run shell commands, open local URLs, or operate a browser.
  • Compatible as a stdio MCP server through scripts/mcp-server.mjs.

OpenClaw fit:

  • OpenClaw supports Windows setup and a local workflow through its CLI/Hub, and can run shell tasks against this repository.
  • Use the MCP wrapper when OpenClaw is configured with stdio MCP servers.
  • Recommended agent task: run npm run check:env, npm run smoke:windows, npm run tauri:build, then inspect outputs\.
  • For visual checks, start npm run preview -- --host 127.0.0.1 --port 4173, then use OpenClaw browser automation to open http://127.0.0.1:4173 and capture/inspect the page.

Hermes fit:

  • Hermes supports native Windows installation and ships agent workflows that can run local terminal tasks.
  • Use the MCP wrapper when Hermes is configured to launch local stdio MCP tools.
  • Hermes browser automation supports local/private URLs through its local browser path, so it can verify http://127.0.0.1:4173 after preview starts.
  • Recommended agent task: run npm run check:env, run npm run smoke:windows, run npm run screenshot, and summarize the generated screenshots\*.png.

Suggested OpenClaw/Hermes prompt:

进入这个仓库,运行 npm run check:env、npm run mcp:smoke、npm run smoke:windows 和 npm run screenshot。
如果失败,先修复环境或代码错误;如果成功,说明 outputs 目录中的安装包和 screenshots 目录中的截图是否已生成。
不要执行会覆盖用户 Git 工作区的更新操作,除非用户明确选择。

References:

Implemented Features

  • Dashboard metrics for imported projects, scan results, updateable projects, high-risk projects and last scan time
  • Scan page with multiple roots, max depth, default excludes, and warning for whole C:\ scans
  • Recursive .git directory or file discovery
  • Git remote, branch, commit, dirty state and platform detection
  • Project type detection for Node, Python, Docker, ComfyUI, Gradio and Ollama
  • Imported projects table
  • Git status check with upstream, dirty, ahead, behind, diverged and failure states
  • Rule-based update risk analysis
  • Optional OpenAI-compatible and Ollama JSON risk analysis
  • Safe update flow with dirty/diverged protection, backup creation and git pull --ff-only
  • Dirty project update choice: move local changes into backup dirty_changes, or explicitly overwrite after confirmation
  • Stdio MCP wrapper for scan/import/check/analyze/update/log tools
  • Optional dependency install when explicitly enabled
  • Rollback through confirmed git reset --hard plus backup restore
  • Logs with command, stdout, stderr and duration
  • Settings for scan roots, backup directory, safety defaults and LLM provider
  • API key password field and log redaction for obvious key patterns

Common Problems

Git is not installed

Install Git for Windows and make sure git.exe is available in PATH. Restart the terminal or Codex session after installing.

Rust or Cargo is not installed

Install Rust through rustup, then restart PowerShell:

winget install Rustlang.Rustup

After install:

rustc --version
cargo --version

Visual Studio Build Tools is missing

Install Visual Studio Build Tools and select Desktop development with C++. Tauri on Windows needs MSVC and a Windows SDK for native builds.

WebView2 is missing

Install the WebView2 Evergreen Runtime. Tauri uses WebView2 to render the desktop window on Windows.

Permission errors during scan

Avoid scanning the whole system drive. Use specific project folders such as D:\AI, D:\Projects, Documents, or Downloads.

Scanning is slow

Reduce max scan depth and keep the default excluded folders. Large folders such as node_modules, virtual environments and build outputs are ignored by default.

Project has no upstream

The app can import and inspect local Git repositories without upstream, but update checks cannot compare ahead/behind until the branch tracks a remote branch.

Dirty project cannot update

Projects with local changes require a user choice before update:

  • Move then update: copy changed/untracked files into the backup folder under dirty_changes, clean the worktree, then run git pull --ff-only.
  • Overwrite update: discard tracked changes and untracked files after confirmation, then run git pull --ff-only.

Next Recommended Steps

  • Add MCP resources for README, screenshots, and recent logs
  • Add a dedicated MCP rollback tool with strict confirmation metadata
  • Add project-level editable test commands
  • Add cancellation plumbing for active scans
  • Add richer LLM diff summaries for selected files
  • Add signed Windows installer metadata for production distribution

About

Windows desktop tool for safely scanning, analyzing, updating, and rolling back local AI GitHub projects

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors