GitHub Codespaces
AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. 🎬 Watch The Story of VS Code! VS Code is now on Instagram, follow @vscode.ig for updates, tips, and more. Rewatch GitHub Copilot Day. GitHub Codespaces View as Markdown Ask in VS Code Ask in VS Code Insiders GitHub Codespaces provides cloud-powered development environments for any activity - whether it's a long-term project, or a short-term task like reviewing a pull request.
You can work with these environments from Visual Studio Code or in a browser-based editor. Environments An environment is the "backend" half of GitHub Codespaces. It's where all of the compute associated with software development happens: compiling, debugging, restoring, etc. When you need to work on a new project, pick up a new task, or review a PR, you can simply spin up a Cloud-hosted environment, and GitHub Codespaces takes care of configuring it correctly.
It automatically configures everything you need to work on your project: the source code, runtime, compiler, debugger, editor, custom dotfile configurations, relevant editor extensions and more. Customization GitHub Codespaces are fully customizable on a per project basis. This is accomplished by including a devcontainer.json file in the project's repository, similar to VS Code Dev Containers development. Example customizations include: Setting the Linux-based operating system to use.
Automatically installing various tools, runtimes, and frameworks. Forwarding commonly used ports. Setting environment variables. Configuring editor settings and installing preferred extensions. See the Configuring Codespaces documentation for codespace-specific devcontainer.json settings. Dotfile per user configuration Dotfiles are files whose filename begins with a dot (.). They typically contain configuration information for applications and can control how terminals, editors, source control, and various other tools behave. .bashrc , .gitignore , and .editorconfig are examples of dotfiles commonly used by developers.
You can specify a GitHub repo containing your dotfiles, a target location for the files, as well as install commands when creating a codespace. See the Personalizing Codespaces documentation to learn how to add your dotfile configurations to a codespace. Getting started There are getting started topics for both GitHub Codespaces clients. These will fast-track you through signing in to GitHub Codespaces, creating your first codespace, and connecting to it with your preferred client: Codespaces in VS Code - Use the GitHub Codespaces extension to connect and work in your environment.
Codespaces in the browser - Connect to your codespace through a browser-based editor. Extension authors The VS Code extension API hides most of the implementation details of running remotely so many extensions will just work in GitHub Codespaces environments without any modification. However, we recommend that you test your extension in a codespace to be sure that all of its functionality works as expected. See the article on Supporting Remote Development and GitHub Codespaces for details.
Browser-based editor You also have a free, lightweight Visual Studio Code experience entirely in the browser. The web-based editor lets you browse source code repositories from GitHub safely and quickly and make lightweight code changes. You can open any repository, fork, or pull request in the editor, which has many of the features of VS Code, including search and syntax highlighting. If you want to run or debug your code, you can switch to the cloud-hosted environment or the VS Code desktop.
To access this browser-based editor, you can go to your repo on github.com and press . (period key) or change the URL of your repository to github.dev/org/repo , replacing github.com with github.dev . Limitation: You may not be able to use the web-based editor if you are running your browser with Incognito mode or have ad blockers enabled. Note : This editor is currently in Technical Preview. You can try it out today and provide feedback at https://github.co/browser-editor-feedback .
Known limitations and adaptations While working with Codespaces and specifically VS Code in the web, there are certain limitations to keep in mind. Some of these limitations have workarounds or adaptations in place to provide a consistent development experience. For several issues (especially keyboard shortcuts or those listed with a workaround for the desktop), you can install and use a Codespace as a progressive web application (PWA).
Issue Reason Workaround Ctrl+Shift+P won't launch the Command Palette in Firefox. Ctrl+Shift+P is reserved in Firefox. Use F1 to launch the Command Palette. Certain default keyboard shortcuts (for debugging) are different in the web. Since the browser may already have an action registered for those keyboard shortcuts, we adjust the default for VS Code in the web. Use the adjusted defaults. They appear on tooltip hovers over the debug actions.
Step over is Alt+F10 (instead of F10 ) on all browsers. Step into in the web is Alt+F11 (instead of F11 ) on Windows browsers. F11 for debugging does not work on macOS in web or desktop. This is a known, non-browser specific limitation. More information can be found in issue #5102 . Disable F11 to show desktop on macOS. Go to: System Preferences > Keyboard > Shortcuts Uncheck the Show Desktop F11 option Ctrl+N for new file doesn't work in web.
Ctrl+N opens a new window instead. Ctrl+N for new file works in the desktop. Ctrl+W for closing an editor doesn't work in web. Ctrl+W closes the current tab in browsers. Ctrl+W works in the desktop. Ctrl+Shift+B will not toggle the favorites bar in the browser. Codespaces overrides this and redirects to the "Build" menu in the Command Palette. No current workarounds. Dragging and dropping files from VS Code to a Codespace (and vice versa) does not work.
You can see more context in issue #115535 . There are a couple of options: You can right-click the file in your Codespace to download it to your local machine. You can drag files to your Codespace from the File Explorer. Angular app debugging isn't supported in the web. Code running in a browser cannot launch another browser instance in debug mode for security reasons. You have a few options: Debug Node.js/service-side js normally.
Open the Codespace in desktop, in which case the companion will be used to launch your local Edge or Chrome install. Downloading a file with no extension from the browser automatically adds ".txt" This is how Chrome and Edge behave. Context and potential future solutions in issue #118436 . When you download a file from a remote (including Codespaces), attributes such as the executable bit are removed. Context and potential future solutions can be found in issue #112099 .
No current workarounds. You may see the prompt, " Your_codespace_name can't open this folder because it contains system files" when trying to download certain folders from a Codespace. A user agent is free to impose the level of restrictions on sensitive directories. More information in this spec and Chromium's blocklist . No additional workarounds beyond the spec and blocklist. Manually visiting http://localhost:forwarded_port won't work to access a forwarded port from a Codespace in the web.
This is based on how Codespaces handles port forwarding and generates the correct URL for the web. Click the link from the port forwarding notification to open your app, or the globe icon in the Ports view , both of which will provide the properly generated link. More information in the Codespaces docs . Some extensions behave differently in the web Extension Issue / Reason Workaround Extensions with keyboard shortcuts that overlap with browser shortcuts, for example Git Graph , which uses Ctrl+R to refresh.
The keyboard shortcut may overlap with an existing browser shortcut, for example Ctrl+
The rest of this page is on the live site.