[](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=http://path-to-repo/sample.git)
如需将相同的功能嵌入到网站中,请使用以下等效 HTML 代码段:
<a href="https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=http://path-to-repo/sample.git">
<img alt="Open in Cloud Shell" src ="https://gstatic.com/cloudssh/images/open-btn.svg">
</a>
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Open in Cloud Shell\n\nThe Open in Cloud Shell feature allows you to publish a link that\nopens the Google Cloud console with a Git repository cloned into Cloud Shell and/or starts Cloud Shell with a custom\nimage. You can also print instructions to the terminal to help users interact\nwith the content.\n\nOpen in Cloud Shell links help developers experiment with your code\nsamples and APIs without having to download the Google Cloud CLI, install\nrequired dependencies, or search for relevant source files. This page explains\nhow to add an Open in Cloud Shell link to your Git repository.\n| **Note:** Only GitHub and Bitbucket repositories are permitted by default. If you would like to add a different repository, [send feedback]() with the repository type you'd like to use with *Open in Cloud Shell*.\n\nURL parameters\n--------------\n\nAn Open in Cloud Shell link, optionally embedded in a button image,\ncan be added to the README.md file of any directory in your Git repository. The\nrecommended location for this link is the root README.md file of your Git\nrepository.\n\n### Required URL parameter\n\nTo create this link, use a base URL of `shell.cloud.google.com` (or any page in\nthe Google Cloud console that begins with `console.cloud.google.com`) with\nthe following required URL parameter:\n\n### Optional URL parameters\n\nYou can also specify any of the following optional parameters:\n\nExamples\n--------\n\nTo embed a button to open a sample Git repository in Cloud Shell,\ninclude the following Markdown in your repository's README.md file: \n\n [](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=http://path-to-repo/sample.git)\n\nTo embed the same functionality into a website, use this equivalent HTML\nsnippet: \n\n \u003ca href=\"https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=http://path-to-repo/sample.git\"\u003e\n \u003cimg alt=\"Open in Cloud Shell\" src =\"https://gstatic.com/cloudssh/images/open-btn.svg\"\u003e\n \u003c/a\u003e\n\nOpen in Cloud Shell link generator\n----------------------------------\n\nTo define the behavior of the Open in Cloud Shell link more\nspecifically, you can use the form below to experiment with parameters needed to\nopen your repository in Cloud Shell.\n**Choose your preferred link format:**\n\nMarkdown HTML\n\n**Set at least one of the following parameters:** Git repository:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDocker image:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**Specify any optional parameters you'd like to include:** Git branch:\n\n\u003cbr /\u003e\n\nWorkspace:\n\n\u003cbr /\u003e\n\nOpen in Editor:\n\n\u003cbr /\u003e\n\nPrint:\n\n\u003cbr /\u003e\n\nTutorial File:\n\n\u003cbr /\u003e\n\nGenerate Snippet \n\n```\n\n```\n\n\u003cbr /\u003e"]]