lingtai-update-detection

Detects how the running lingtai-tui binary was installed using install metadata and executable paths.

692|60|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Lingtai-AI/lingtai --skill lingtai-update-detection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lingtai-update-detection
Source: https://github.com/Lingtai-AI/lingtai/tree/main/tui/internal/preset/skills/lingtai-update/reference/detection
Command: npx skills add https://github.com/Lingtai-AI/lingtai --skill lingtai-update-detection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When updating the lingtai-tui terminal client, the correct update path depends on how it was originally installed (native installer, Homebrew, or unknown). Choosing the wrong method can leave stale binaries, duplicate installs, or broken PATH resolution. This Skill determines the actual install method conservatively before any update action is taken.

Core Features & Use Cases

  • Metadata-based detection: Reads and validates ~/.lingtai-tui/install.json against the lingtai.tui.install/v1 schema to identify source/user-local installs.
  • Homebrew recognition: Identifies Homebrew installs from executable paths and prefixes such as /opt/homebrew, /usr/local, and /home/linuxbrew/.linuxbrew, without running brew unnecessarily.
  • Duplicate install handling: Detects the DuplicateNativeInstall state where a native install exists but the resolved executable is still the old Homebrew binary, routing users to manual removal instead of re-running the installer.
  • Use Case: A user on an Apple-Silicon Mac runs /update-tui; detection finds valid native metadata but the resolved lingtai-tui still points to the Homebrew Cellar copy, so the update flow reports that migration is incomplete rather than silently reinstalling.

Quick Start

Ask the agent to determine how the currently running lingtai-tui was installed before performing an update.

Frequently Asked Questions about lingtai-update-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check how lingtai-tui was installed?

Read `~/.lingtai-tui/install.json` and validate it against the `lingtai.tui.install/v1` schema; a match with the running executable indicates a source/user-local install. Otherwise, inspect the executable path for Homebrew prefixes like `/opt/homebrew` or `/usr/local`.

How to detect a Homebrew install of a CLI binary on macOS?

Check whether the resolved executable path falls under Homebrew prefixes such as `/opt/homebrew` (Apple Silicon), `/usr/local` (Intel), or `/home/linuxbrew/.linuxbrew` (Linux). Resolve symlinks first, since a manually linked binary may not be the Homebrew Cellar copy.

Why does lingtai-tui still run the old version after a successful update?

On Apple-Silicon Homebrew hosts, `/opt/homebrew/bin` precedes the native installer's default bin directory on PATH, so the resolved binary can still be the old Homebrew copy. Detection reports this as DuplicateNativeInstall and prompts manual Homebrew removal.

Does install detection run the brew command to check Homebrew?

No. Detection is deliberately conservative and never runs `brew` merely because it is available. It classifies installs from validated metadata and executable path patterns only, treating anything unrecognized as unknown/other.

Can detection remove the old Homebrew installation automatically?

No. Removing the Homebrew copy always requires an explicit interactive confirmation at startup. The `self-update` and `doctor` commands only report the manual removal command and never uninstall anything themselves.