> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Lynxtron Go

Lynxtron Go 是 Lynxtron 官方提供的 playground，它本身也是使用 Lynxtron 框架构建的桌面应用。无需先创建完整工程，即可编辑、运行和分享小型实验。

- [下载 macOS 版本（Apple 芯片）](https://github.com/lynx-community/lynxtron-examples/releases/latest/download/lynxtron-go-darwin-arm64.dmg)
- [下载 macOS 版本（Intel，x64）](https://github.com/lynx-community/lynxtron-examples/releases/latest/download/lynxtron-go-darwin-x64.dmg)
- [下载 Windows 版本（x64）](https://github.com/lynx-community/lynxtron-examples/releases/latest/download/LynxtronGo-win-x64-Setup.exe)
- [查看全部版本](https://github.com/lynx-community/lynxtron-examples/releases/latest)

Lynxtron Go 的主工作区会在同一窗口中展示应用文件、包模块和进程 Console。

![Lynxtron Go 主工作区，包含应用编辑器、模块和 Console](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynxtron/go/editor.png)

## 从模板或示例开始

打开右上角的 **…** 菜单并选择 **New Project**；也可以使用菜单栏中的 **File > New Project**，或按 `⌘N`（Windows 上为 `Ctrl+N`）。在打开的对话框中，选择 **Blank** 创建空白应用边界，选择 **Hello Lynxtron** 创建最小可运行应用，或选择 **Start from a showcase** 进入示例 Gallery。

![选择 Blank 或 Hello Lynxtron，或继续进入示例 Gallery](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynxtron/go/new-project.png)

在 Gallery 中，点击 **Open** 可以将示例载入编辑器，点击 **Run** 可以直接运行。Gallery 收录了由 Lynxtron 项目维护的示例，用于展示桌面 API 和相关能力。

![在内置 Gallery 中浏览可运行的 Lynxtron 示例](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynxtron/go/showcase-gallery.png)

## 同时编辑完整的应用边界

在 Lynxtron Go 中打开示例后，从 **Editors** 侧边栏选择文件。以 **Hello Lynxtron** 模板为例，在 `src/main/desktop/main.ts` 中编辑 Node.js 主进程，在 `src/app/App.tsx` 中编辑 Lynx UI，并通过 `src/app/App.css` 和 `package.json` 管理样式与依赖。UI 入口为 `src/app/index.tsx`；这个最小模板不包含 preload 文件。其他示例的文件组织可能不同。分栏编辑器可以同时展示这些层，**Modules** 面板则会展示当前示例可用的包。

## 运行和检查

点击工具栏中的 **Run**，在新的 Lynxtron 进程中启动当前示例。启动后按钮会变为 **Stop**，进程输出会显示在 Lynxtron Go 底部的 Console 中。停止进程、修改文件，再次点击 **Run** 即可重复这一流程。

![Counter 示例在独立的 Lynxtron 窗口中运行](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynxtron/go/run-result.png)

## 使用 npm 包和保存示例

在 **Modules** 面板中搜索包，即可将其加入当前示例。使用 **File > Save** 将示例保存到本地，或者通过工具栏中的 Gist 输入框加载和发布 GitHub Gist。Lynxtron Go 适合专注的实验与原型；当想法逐渐成长为应用时，可以继续阅读 [Lynxtron 快速上手](/next/zh/lynxtron/introduction.md)来创建完整工程。

## 打开文档示例

在 Lynxtron 文档的可运行示例中，打开启动菜单并选择 **Open in Lynxtron Go**。该操作会将示例 bundle 传递给桌面应用；如果尚未安装 Lynxtron Go，尝试唤起失败后会提供对应的下载入口。
