# Kuaitu CLI Agent Installation Instructions

These instructions are for a local AI agent that can run commands on the user's computer.

## Security rules

- Only use `https://kuaitu.ai` and `https://download.kuaitu.ai`.
- Do not use Gitee, GitHub Releases, mirrors, package registries, or copied binaries.
- Do not ask the user for Git, Go, Node.js, repository access, OSS credentials, or a token.
- Never print, copy, inspect, or include Kuaitu access tokens or refresh tokens in conversation.
- The user must personally complete Kuaitu web login and click the CLI authorization confirmation button.
- Stop if the signed manifest, file size, or SHA-256 verification fails.

## Install

Detect the operating system first.

On macOS or Linux:

```sh
tmp_file="$(mktemp)" && curl -fsSL --proto '=https' --tlsv1.2 https://kuaitu.ai/cli/install.sh -o "$tmp_file" && sh "$tmp_file" && rm -f "$tmp_file"
```

On Windows PowerShell:

```powershell
$tmpFile = Join-Path $env:TEMP "kuaitu-install.ps1"; Invoke-WebRequest https://kuaitu.ai/cli/install.ps1 -OutFile $tmpFile -UseBasicParsing; & $tmpFile; Remove-Item $tmpFile -Force
```

Do not bypass a failed installer check.

## Authenticate and verify

After installation, run:

```sh
kt auth login
```

Wait for the user to finish the real browser authorization. Then run:

```sh
kt skill setup --target all --yes
kt auth status
kt doctor --json
```

Report the installed version, login state, and doctor result. If the current Agent cannot reload newly installed skills dynamically, tell the user to start a new task or restart the Agent.

## Update an existing installation

When the user says “更新快图”, “升级快图”, or “检查快图有没有新版本”, run:

```sh
kt upgrade --check --json
kt upgrade --yes
kt doctor --json
```

Do not reinstall when the CLI reports that it is already current.
