> ## Documentation Index
> Fetch the complete documentation index at: https://forgekit-docs-mintlify-4374fee9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 安装

> 同一棵树上的三扇门:plugin marketplace、npm 全局安装、以及无需 registry 的 github: 安装 —— 外加贡献者用的符号链接开发环境。

Forge 遵循**一棵树、三扇门**的设计:plugin manifest、加固安装脚本和 npm bin 都指向同一份 `global/` + `source/` 树。根据你的工具挑一个通道即可。

## 选择一个通道

<CardGroup cols={2}>
  <Card title="Plugin(推荐)" icon="puzzle-piece">
    面向 Claude Code 和 Codex。护栏自动接线,无需合并。
  </Card>

  <Card title="npm global" icon="node-js">
    面向任何工具。从公共 npm registry 安装 `forge` CLI。
  </Card>

  <Card title="github: 安装" icon="github">
    无需 registry —— 直接从仓库安装。
  </Card>

  <Card title="贡献者 / 本地开发" icon="code">
    克隆 + `npm link`,或运行 `bash install.sh` 建立符号链接。
  </Card>
</CardGroup>

## 要求

* **Node.js >= 20**
* **零运行时依赖** —— 一切都是 Node 内置模块。可选层(`FORGE_EMBED` 嵌入,`uicheck visual` 需要的 Playwright)是可选加装,不引入必需依赖。

## Plugin marketplace

面向 Claude Code 和 Codex 的推荐路径,不需要令牌也不需要克隆:

```bash theme={null}
/plugin marketplace add CodeWithJuber/forgekit
/plugin install forgekit
```

Plugin 通过 `${CLAUDE_PROJECT_DIR}` 接入护栏,使预动作门与完成门在后台生效。

## npm 全局

从公共 npm 安装,可服务任何工具:

```bash theme={null}
npm install -g @codewithjuber/forgekit
forge doctor          # everything green?
```

## 无 registry 的 github: 安装

```bash theme={null}
npm install -g github:CodeWithJuber/forgekit
```

## 贡献者 / 本地开发

<CodeGroup>
  ```bash npm link theme={null}
  git clone https://github.com/CodeWithJuber/forgekit.git
  cd forgekit
  npm link
  ```

  ```bash install.sh (symlink setup) theme={null}
  git clone https://github.com/CodeWithJuber/forgekit.git
  cd forgekit
  bash install.sh
  ```
</CodeGroup>

这个安装脚本经过加固:幂等、基于符号链接、带备份,不使用 `curl | sh`。

## 校验

无论走哪个通道,都可以确认安装:

```bash theme={null}
forge doctor          # tools, guards, MCP auth, config drift, update status
```

<Note>
  `forge doctor` 还会为 git 检出显示一条不烦人的"落后于上游几个提交"提示。设置 `FORGE_NO_UPDATE_CHECK=1` 可以静默它。每一条路径都失败开放 —— 离线或 detached HEAD 报告"unknown",从不作为错误。
</Note>

## 保持 Forge 最新

```bash theme={null}
forge update --check          # report whether a newer version is available
forge update                  # apply the update (git checkout or npm/copy install)
forge update --to <version>   # pin or downgrade to a specific version
```

<Card title="现在配置一个仓库" icon="arrow-right" href="/zh-CN/quickstart">
  转到快速开始,运行 `forge init` 并进行你的第一次基座检查。
</Card>
