This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
AI代理和Expo概览
使用 Claude Code、Codex 和 Cursor 等 AI 编码代理构建和发布 Expo 与 React Native 应用。
Claude Code、Codex、Cursor 及其他 AI 编码代理可以帮助你构建、升级、调试和部署你的 Expo 和 React Native 项目。当你使用 create-expo-app 创建新项目时,该新项目已经配置好了 AI 代理所需的配置文件。这个设置也会提交到你的项目中,因此团队中的每个人都从相同的 SDK 版本和项目说明开始,他们的代理也会读取相同的项目上下文。
🌐 Claude Code, Codex, Cursor, and other AI coding agents can help you build, upgrade, debug, and deploy your Expo and React Native projects. When you use create-expo-app to create a new project, that new project is already set up with the configuration files required by an AI agent. This setup is also committed to your project, so everyone on your team starts from the same SDK version and project instructions, and their agents read the same project context.
快速开始
🌐 Quick start
Claude Code 和 Codex 有一个官方的 Expo 插件。一个命令可以安装 Expo 技能 并注册 Expo 模型上下文协议 (MCP) 服务器。
🌐 Claude Code and Codex have an official Expo plugin. One command installs Expo Skills and registers the Expo Model Context Protocol (MCP) Server.
然后在你的 Claude Code 会话中运行 /mcp 来登录你的 Expo 账号。
🌐 Then run /mcp inside your Claude Code session to sign in to your Expo account.
然后登录你的 Expo 账号:
🌐 Then sign in to your Expo account:
Cursor 和其他代理没有官方的 Expo 插件。要配置它们,请分别安装 Expo Skills 和 Expo MCP Server。
🌐 Cursor and other agents do not have an official Expo plugin. To configure them, install Expo Skills and the Expo MCP Server separately.
Expo如何支持人工智能代理
🌐 How Expo supports AI agents
三部分共同作用,为 AI 代理提供一致的、Expo 特定的上下文:
🌐 Three pieces work together to give an AI agent consistent, Expo-specific context:
- Expo 技能:
expo插件为代理添加了 Expo 特定的指令和斜杠命令。代理会应用已知的良好 Expo 模式(SDK 升级、EAS 工作流、使用 Jetpack Compose 和 SwiftUI 的原生 UI、API 路由),而不是从训练数据中猜测。技能每台机器只需安装一次。 - Expo MCP 服务器: 一个远程模型上下文协议 (MCP) 服务器,让代理可以实时访问最新的 Expo 文档、EAS 构建历史、EAS 更新渠道和 TestFlight 元数据。代理可以通过它安装与 SDK 匹配的包、查看构建日志以及拍摄模拟器截图。对于 Claude Code 和 Codex,
expo插件会注册这个服务器,所以你不需要单独添加。 - 项目上下文文件:
create-expo-app会在项目根目录下写入 AGENTS.md,指引代理查看你项目所针对的 Expo SDK 版本的文档。当安装 Claude Code 时,它还会写入 .claude/settings.json 来启用 Expo 插件。
设置 Expo 技能和 Expo MCP 服务器
🌐 Set up Expo Skills and Expo MCP Server
Expo Skills 和 Expo MCP 服务器适用于所有支持的代理。如果你已经安装了上面的 expo 插件,那么两者都已设置完成。下面的指南涵盖了所有安装选项,包括没有插件的代理:
🌐 Expo Skills and the Expo MCP Server work with every supported agent. If you installed the expo plugin above, both are already set up. The guides below cover every install option, including agents that have no plugin:
安装教授代理已知良好 Expo 模式的插件,并浏览可用技能的完整列表。
连接远程 Expo MCP 服务器以让代理实时访问 Expo 文档和 EAS。
选择一个代理
🌐 Pick an agent
每个代理指南都涵盖了该代理的安装、设置和示例提示:
🌐 Each per-agent guide covers install, setup, and example prompts for that agent:
使用 Expo 设置 Anthropic 的终端代理,包括项目背景和示例提示。
使用 Expo 设置 OpenAI 的终端代理,包括项目上下文和示例提示。
使用 Expo 设置以 AI 为先的代码编辑器,包括项目上下文和示例提示。
代理的项目上下文文件
🌐 Project context files for agents
create-expo-app 命令行工具会在新项目的根目录添加 AGENTS.md。当安装 Claude Code 时,它还会添加 .claude/settings.json:
🌐 The create-expo-app CLI adds AGENTS.md to a new project's root. When Claude Code is installed, it also adds .claude/settings.json:
在 AGENTS.md 中添加共享项目说明,让 Claude Code、Codex 和 Cursor 阅读相同的上下文。
🌐 Add shared project instructions to AGENTS.md so Claude Code, Codex, and Cursor read the same context.
设置一个现有项目
🌐 Set up an existing project
create-expo-app 只会在创建新项目时写入项目上下文文件。对于已有项目,请你自己在项目根目录下添加相同的文件。
1
下载 AGENTS.md
🌐 Download AGENTS.md
下载 create-expo-app 在你的 Expo 项目根目录提供的标准 AGENTS.md:
🌐 Download the canonical AGENTS.md that create-expo-app ships at the root of your Expo project:
如果你的项目已经有一个 AGENTS.md,就把下载的内容追加到里面,而不是替换这个文件。
🌐 If your project already has an AGENTS.md, append the downloaded content to it instead of replacing the file.
2
为 Claude Code 启用 Expo 插件
🌐 Enable the Expo plugin for Claude Code
创建 .claude/settings.json 来启用 Claude Code 插件市场中的官方 Expo 插件:
🌐 Create .claude/settings.json to enable the official Expo plugin from the Claude Code plugin marketplace:
这个文件会为每个打开项目的人启用插件。每个开发者仍然要在自己的机器上用 claude plugin install expo@claude-plugins-official 安装一次。
🌐 This file enables the plugin for everyone who opens the project. Each developer still installs it once on their own machine with claude plugin install expo@claude-plugins-official.
提交两个文件,这样你团队中的每个代理会话都会从相同的项目环境开始。Codex 和 Cursor 只需要 AGENTS.md,所以第 2 步只适用于 Claude Code。
🌐 Commit both files so every agent session on your team starts from the same project context. Codex and Cursor need only AGENTS.md, so step 2 applies to Claude Code only.
验证设置
🌐 Verify the setup
要确认代理可以读取你的项目,请在你的 Expo 项目中为 AI 代理打开一个会话并运行此提示:
🌐 To confirm an agent can read your project, open a session for your AI agent within your Expo project and run this prompt:
如果代理回复的是来自 package.json 的 SDK 版本,则说明代理正在正确读取你的项目。
🌐 If the agent replies with the SDK version from package.json, the agent is reading your project correctly.
代理工具包
🌐 Agent toolkits
在 选择一个代理 中提到的代理会阅读你的代码和文档等内容。为了让代理在运行时也能对你的 Expo 项目进行操作,可以将其与第三方工具包配对。然后,代理工具包可以通过流程、读取日志、检查 React 组件树以及分析性能。
🌐 The agents mentioned in Pick an agent read your code and documentation, among other things. To let an agent also act on your Expo project while it runs, pair it with a third-party toolkit. An agent toolkit can then tap through flows, read logs, inspect the React component tree, and profile performance.
Callstack 提供的开源、原生代理 CLI,用于在模拟器、模拟器和真实设备上检查、控制、调试、分析和测试应用。
来自 Software Mansion 的一个主动工具包,通过 MCP 连接来控制、调试和分析你在 Android 模拟器或 iOS 模拟器上的应用。