添加“在 Firebase Studio 中打开”按钮
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Firebase Studio,您可以简化代码库新手设置开发环境并开始高效工作所需的步骤。
例如:
如果您与其他贡献者协作开发项目,可以根据项目需求自定义环境,并将 .idx/dev.nix
文件提交到项目的 Git 代码库。这样,当团队成员在 Firebase Studio 中导入您的 Git 代码库时,其新的工作区将具有与您的工作区完全相同的配置,并包含相同的系统软件包、IDE 扩展程序、启动脚本等。
如果您要构建框架或库供他人使用,可以在示例代码库中包含 .idx/dev.nix
文件,让用户将示例导入 Firebase Studio 时,跳过环境配置,直接试用您的框架。您甚至可以构建自己的自定义模板,为用户提供一个具有预设配置且可自定义的起点。
对环境自定义感到满意后,您可以通过向文档(例如项目的 README.md
文件)添加“在 Firebase Studio 中打开”按钮,让其他人更轻松地将您的项目导入 Firebase Studio。
常见的“在 Firebase Studio 中打开”入口点
“在 Firebase Studio 中打开”按钮支持以下几种网址格式:
如需链接到导入 Git 代码库 flow(已预先填充您的 Git 代码库网址),请使用以下网址格式:
https://studio.firebase.google.com/import?url=https://github.com/my-org/my-repo
目前,仅支持 GitHub 代码库(包括专用和公共)。
如需连接到预定义的工作区模板,请在 Firebase Studio 的模板页面中找到所需的模板,然后复制其网址,该网址应遵循以下网址格式:
https://studio.firebase.google.com/new/gemini
如需链接到自定义模板(已预先填充您的模板的 GitHub 网址),请使用以下网址格式:
https://studio.firebase.google.com/new?template=https://github.com/my-org/my-template
如需使用预填提示打开 App Prototyping agent,请使用以下网址格式:
https://studio.firebase.google.com/?prototypePrompt=Create an app that transforms sketches into a high-quality photograph with Gemini
添加“在 Firebase Studio 中打开”按钮
安装“在 Firebase Studio 中打开”SDK,或使用此工具为 Firebase Studio 按钮生成 HTML 文件:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-12。
[null,null,["最后更新时间 (UTC):2025-08-12。"],[],[],null,["With Firebase Studio, you can simplify the steps for someone new to\nyour codebase to set up their development environment and get productive.\n\nFor example:\n\n- If you're **working on a team with other contributors** , you can\n [customize your environment](/docs/studio/customize-workspace)\n precisely for your project and then commit your `.idx/dev.nix` file to\n your project's Git repository. That way, when a teammate imports your\n Git repository in Firebase Studio, their new workspace will have\n the exact same configuration as yours, complete with the same system\n packages, IDE extensions, starter scripts, and more.\n\n- If you're **building a framework or library** for others to use, you\n can include a `.idx/dev.nix` file in your sample code repositories, so\n that when a user imports your samples into Firebase Studio, they\n can skip the environment setup and jump straight into trying out your\n framework. You can even [build your own, custom\n template](/docs/studio/custom-templates) as an opinionated,\n customizable starting point for your users.\n\nAfter you're happy with your environment customizations, you can make it\neven easier for others to import your project into Firebase Studio by\nadding an \"Open in Firebase Studio\" button to your documentation, such\nas your project's `README.md` file.\n\nCommon \"Open in Firebase Studio\" entry points\n\nThere are several URL patterns available for an \"Open in\nFirebase Studio\" button:\n\n- To link to the **import a Git repository** flow, prefilled with your Git\n repository URL, use this URL pattern:\n\n https://studio.firebase.google.com/import?url=https://github.com/my-org/my-repo\n\n At this time, only GitHub repositories are supported (both private and\n public).\n- To link to a **predefined workspace template** , find the template\n you're looking for in the\n [Templates](https://studio.firebase.google.com/templates) page in\n Firebase Studio, and copy its URL, which should follow this URL pattern:\n\n https://studio.firebase.google.com/new/gemini\n\n- To link to a **custom template**, prefilled with your template's GitHub URL,\n use this URL pattern:\n\n https://studio.firebase.google.com/new?template=https://github.com/my-org/my-template\n\n- To open the App Prototyping agent with a pre-filled prompt, use this URL\n pattern:\n\n https://studio.firebase.google.com/?prototypePrompt=Create an app that transforms sketches into a high-quality photograph with Gemini\n\nAdd an \"Open in Firebase Studio\" button\n\nInstall the [Open in Firebase Studio\nSDK](https://www.npmjs.com/package/@firebase-studio/open-sdk) or\nuse this tool to generate the HTML for a Firebase Studio button:"]]