# 安装法信 Skill / Install Faxin Skill

适用于本机 Codex、WorkBuddy 与 Claude Code。WorkBuddy 桌面版请使用 Windows 或 macOS。支持 Windows 11 x64 / ARM64、macOS Apple Silicon / Intel、Linux x64 / ARM64（glibc 2.28+）。普通网页聊天不能安装本机文件。

## 推荐：让 AI 帮你安装

> 请按 https://faxin.david-legal.com/install.md 的指南安装 faxin-cli。检查我的操作系统和处理器架构，使用对应的单行命令安装到当前客户端的技能目录，最后验证 CLI 可用。不要运行 npm ci，不要在聊天中索要账号密码或令牌。

## Windows 11：PowerShell 单行安装

打开 Windows 终端，选择 **PowerShell**，粘贴执行。Windows 自带 PowerShell 5.1 即可，也支持 PowerShell 7。无需以管理员身份运行，无需更改执行策略。

Codex：

```powershell
& ([scriptblock]::Create((irm https://faxin.david-legal.com/install.ps1))) -Client codex
```

WorkBuddy：

```powershell
& ([scriptblock]::Create((irm https://faxin.david-legal.com/install.ps1))) -Client workbuddy
```

Claude Code：

```powershell
& ([scriptblock]::Create((irm https://faxin.david-legal.com/install.ps1))) -Client claude
```

请使用 PowerShell，勿粘贴到命令提示符（cmd）或 WSL 中。安装器自动选择本机 x64 或 ARM64 架构。Windows ARM 电脑优先使用原生 ARM64 环境；未安装匹配的 Node.js 时会自动准备。

## macOS / Linux：终端单行安装

Codex：

```sh
curl -fsSL https://faxin.david-legal.com/install.sh | sh -s -- --client codex
```

WorkBuddy（macOS）：

```sh
curl -fsSL https://faxin.david-legal.com/install.sh | sh -s -- --client workbuddy
```

Claude Code：

```sh
curl -fsSL https://faxin.david-legal.com/install.sh | sh -s -- --client claude
```

可先查看 [Windows 脚本](https://faxin.david-legal.com/install.ps1) 或 [macOS / Linux 脚本](https://faxin.david-legal.com/install.sh)。安装包包含 PDF 解析依赖，不运行 npm。缺少合适的 Node.js 时，从 nodejs.org 获取 SHA-256 已固定的 Node.js 24.16.0，保存到用户目录。不会修改系统 Node.js、PATH 或 PowerShell 执行策略。Linux 需有 curl、tar、unzip 及 shasum 或 sha256sum。

## 安装器做什么

1. 检查操作系统、架构和运行环境。
2. 自动下载匹配的组件并验证 SHA-256；解压后逐文件校验。
3. 安装到用户主目录的 `.codex/skills/faxin-cli`、`.workbuddy/skills/faxin-cli` 或 `.claude/skills/faxin-cli`，分别遵循 CODEX_HOME / WORKBUDDY_CONFIG_DIR / CLAUDE_CONFIG_DIR；已有目录先备份。
4. 准备 `bin/faxin.cmd`（Windows）或 `bin/faxin`（macOS / Linux）启动入口，验证 CLI 与 PDF 组件；不读取、复制或上传已有授权。

Windows 可在命令末尾加 `-Destination 'D:\我的技能\faxin-cli'` 指定目录；macOS / Linux 使用 `--dest /绝对路径/faxin-cli`。安装器显示最终位置。安装完成后开启新的 AI 对话。WorkBuddy 可在「技能」中确认 faxin-cli 已启用；如未刷新，重启客户端。

版本、来源提交及校验值见 [release.json](https://faxin.david-legal.com/release.json)。网站提供提示词与单行命令入口，组件由安装器自动获取。

## 给本机 AI 的执行步骤

- 确认客户端和操作系统后，使用对应的安装命令。不要要求使用者运行 npm，不要使用 Browser Use 做日常查询。
- 安装后执行启动入口的 `help`。Windows PowerShell 示例：`& "$HOME\.codex\skills\faxin-cli\bin\faxin.cmd" help`。如设有 CODEX_HOME / WORKBUDDY_CONFIG_DIR / CLAUDE_CONFIG_DIR 或自定义路径，使用安装器显示的实际位置。
- 优先使用安装器生成的启动入口，即使 Node.js 不在 PATH 中也可启动。Windows 的中文、带空格路径须加引号，并使用 PowerShell 的 `&` 调用。
- 用户请求真实检索后运行 `auth check`。有效授权直接复用；首次或失效时才运行 `auth login`。保持本机登录进程存活，让用户在页面中填写自己的上海律协账号。不要在聊天中接收密码或令牌。
- 主站和类案授权分别检查。安装成功不等于取得平台权限，不承诺永久免登录。
- 保留结果来源、案号或法规编号，引用前核验原文。PDF 文字提取不包含 OCR。

## 授权保存、更新与卸载

Windows 使用系统 DPAPI 按当前 Windows 用户加密保存授权；复制授权文件到另一账号或电脑不能直接复用。macOS / Linux 使用仅本人可读写的授权文件。密码不保存。每个人都需使用自己有权限的上海律协账号登录。

再次运行安装命令可更新，旧技能目录自动生成带时间戳的备份。卸载时删除安装器显示的技能目录；授权在用户主目录的 `.config/faxin-cli` 单独保存（或由 FAXIN_CONFIG_DIR 指定），需要清除时另行删除。自动准备的运行环境位于 Windows 的 `%LOCALAPPDATA%\FaxinSkill`，macOS / Linux 的 `~/.local/share/faxin-skill`；确认不再使用后可删除。

## English

Choose Codex, WorkBuddy or Claude Code and use the corresponding command above. WorkBuddy Desktop is available for Windows and macOS; its default skill directory is `~/.workbuddy/skills/faxin-cli`, with `WORKBUDDY_CONFIG_DIR` supported. On Windows 11, open Windows Terminal **PowerShell** (5.1+ or 7), not cmd or WSL. Both x64 and ARM64 are supported. No administrator access, npm install, PATH changes or execution-policy changes are required. The installer obtains a checksum-verified Node.js runtime in your user directory if necessary, verifies the release, and backs up an existing installation.

Start a new AI conversation after installing. Use `bin/faxin.cmd` on Windows or `bin/faxin` on macOS / Linux. Windows paths with spaces need quoting and PowerShell's `&` call operator. A custom destination can be supplied with `-Destination` on Windows or `--dest` elsewhere.

Each user signs in with their own authorized Shanghai Bar account on the local sign-in page. Passwords are not saved. Windows sessions are encrypted with current-user DPAPI; macOS / Linux sessions use private file permissions. The publishing site receives neither passwords nor tokens. Queries go to Faxin, and conversation content is handled by your AI client. Main-site and case-search sessions may expire separately. Automatic renewal and OCR are not included. This independent tool is not an official Faxin or Shanghai Bar product and does not grant database access.
