Developing in a codespace - GitHub Docs
https://docs.github.com/en/codespaces/developing-in-a-codespace/developing-in-a-codespace • 221 KB fetched
Open original page
Developing in a codespace - GitHub Docs Skip to main content
GitHub Docs Version: Free, Pro, & Team
Search or ask Copilot Search or ask Copilot
Select language: current language is English
Search or ask Copilot Search or ask Copilot
Open menu
Collapse sidebar Expand sidebar
Scroll breadcrumbs left
* Home
* Codespaces
* Developing in a codespace
* Develop in a codespace
Scroll breadcrumbs right
Codespaces
*
*
* Quickstart
* Getting started
* What are Codespaces?
* Codespaces features
* The codespace lifecycle
* Deep dive into Codespaces
* Developing in a codespace
* Develop in a codespace
* Create a codespace for a repo
* Create a codespace from a template
* Delete a codespace
* Open an existing codespace
* Work collaboratively
* Source control
* Pull requests
* Stop a codespace
* Forward ports
* Rebuilding a container
* Default environment variables
* Persist variables and files
* Connecting to a private network
* Machine learning
* Visual Studio Code
* GitHub CLI
* Customizing your codespace
* Rename a codespace
* Change your shell
* Change the machine type
* Setting your user preferences
* Personalize your codespaces
* Set the default editor
* Set the default region
* Set the timeout
* Configure automatic deletion
* Choose the host image
* Setting up your project
* Adding a dev container configuration
* Introduction to dev containers
* Setting up a Node.js project
* Setting up a C# (.NET) project
* Setting up a Java project
* Setting up a PHP project
* Setting up a Python project
* Configuring dev containers
* Set a minimum machine spec
* Adding features
* Automatically opening files
* Specifying recommended secrets
* Setting up your repository
* Facilitating codespace creation
* Set up a template repo
* Prebuilding your codespaces
* About prebuilds
* Configure prebuilds
* Allow external repo access
* Manage prebuilds
* Test dev container changes
* Managing your codespaces
* Codespaces secrets
* Repository access
* Security logs
* GPG verification
* Managing your organization
* Enable or disable Codespaces
* Billing and ownership
* List organization codespaces
* Manage Codespaces costs
* Manage secrets
* Audit logs
* Restrict machine types
* Restrict codespace creation
* Restrict base image
* Restrict port visibility
* Restrict timeout periods
* Restrict the retention period
* Reference
* Access a private registry
* Copilot in Codespaces
* VS Code Command Palette
* Security in Codespaces
* Disaster recovery
* Troubleshooting
* Codespaces logs
* Codespaces clients
* Included usage
* Exporting changes
* Creation and deletion
* Authenticating to repositories
* Connection
* Codespaces prebuilds
* Personalization
* Port forwarding
* GPG verification
* Working with support
* github.dev editor
Developing in a codespace
You can work in a codespace using your browser, Visual Studio Code, or in a command shell.
Tool navigation
* Visual Studio Code
* GitHub CLI
* Web browser
Copy as Markdown
In this article
* About development with GitHub Codespaces
* Working in a codespace in the browser
* Navigating to an existing codespace
* Working in a codespace in VS Code
* Navigating to an existing codespace
* Working in a codespace in a command shell
About development with GitHub Codespaces
You can develop code in a codespace using your choice of tool:
* A command shell, via an SSH connection initiated using GitHub CLI
* The Visual Studio Code desktop application
* A browser-based version of Visual Studio Code
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for the web browser version of Visual Studio Code.
Working in a codespace in the browser
Using Codespaces in the browser provides you with a fully featured development experience. You can edit code, debug, use Git commands, and run your application.
The main components of the user interface are:
* Side bar - By default, this area shows your project files in the Explorer.
* Activity bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
* Editor - This is where you edit your files. You can right-click the tab for a file to access options such as locating the file in the Explorer.
* Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
* Status bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.
For the best experience with GitHub Codespaces, we recommend using a Chromium-based browser, like Google Chrome or Microsoft Edge. For more information, see Troubleshooting GitHub Codespaces clients .
Customizing the codespaces for a repository
You can customize the codespaces that are created for a repository by creating or updating the dev container configuration for the repository. You can do this from within a codespace. After you change a dev container configuration, you can apply the changes to the current codespace by rebuilding the Docker container for the codespace. For more information, see Introduction to dev containers .
Personalizing your codespace
You can use a dotfiles repository and Settings Sync to personalize aspects of the codespace environment for any codespace that you create. Personalization can include shell preferences and additional tools. For more information, see Personalizing GitHub Codespaces for your account .
Running your app from a codespace
You can forward ports in your codespace to test and debug your application. You can also manage the port protocol and share the port within your organization or publicly. For more information, see Forwarding ports in your codespace .
Committing your changes
When you've made changes to your codespace, either new code or configuration changes, you'll want to commit your changes. Committing configuration changes to your repository ensures that anyone else who creates a codespace from this repository has the same configuration. Any customization you do, such as adding VS Code extensions, will be available to all users.
For this tutorial, you created a codespace from a template repository, so the code in your codespace is not yet stored in a repository. You can create a repository by publishing the current branch to GitHub.
For information, see Using source control in your codespace .
Using the Visual Studio Code Command Palette
The Visual Studio Code Command Palette allows you to access and manage many features for Codespaces and Visual Studio Code. For more information, see Using the Visual Studio Code Command Palette in GitHub Codespaces .
Navigating to an existing codespace
*
You can see every available codespace that you have created on the "Your codespaces" page. To display this page, in the top-left corner of GitHub, select , then click Codespaces . This takes you to github.com/codespaces .
*
Click the name of the codespace you want to develop in.
Alternatively, you can see any of your codespaces for a specific repository by navigating to that repository, clicking the Code button and selecting the Codespaces tab. The dropdown menu will display all active codespaces for the repository.
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for Visual Studio Code.
Working in a codespace in VS Code
GitHub Codespaces provides you with the full development experience of Visual Studio Code. You can edit code, debug, and use Git commands while developing in a codespace with VS Code. For more information, see the VS Code documentation .
The main components of the user interface are:
* Side bar - By default, this area shows your project files in the Explorer.
* Activity bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
* Editor - This is where you edit your files. You can right-click the tab for a file to access options such as locating the file in the Explorer.
* Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
* Status bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.
For more information on using VS Code, see the User Interface guide in the VS Code documentation.
You can connect to your codespace directly from VS Code. For more information, see Using GitHub Codespaces in Visual Studio Code .
For troubleshooting information, see Troubleshooting GitHub Codespaces clients .
Customizing the codespaces for a repository
You can customize the codespaces that are created for a repository by creating or updating the dev container configuration for the repository. You can do this from within a codespace. After you change a dev container configuration, you can apply the changes to the current codespace by rebuilding the Docker container for the codespace. For more information, see Introduction to dev containers .
Personalizing your codespace
You can use a dotfiles repository and Settings Sync to personalize aspects of the codespace environment for any codespace that you create. Personalization can include shell preferences and additional tools. For more information, see Personalizing GitHub Codespaces for your account .
Running your app from a codespace
You can forward ports in your codespace to test and debug your application. You can also manage the port protocol and share the port within your organization or publicly. For more information, see Forwarding ports in your codespace .
Committing your changes
When you've made changes to your codespace, either new code or configuration changes, you'll want to commit your changes. Committing configuration changes to your repository ensures that anyone else who creates a codespace from this repository has the same configuration. Any customization you do, such as adding VS Code extensions, will be available to all users.
For this tutorial, you created a codespace from a template repository, so the code in your codespace is not yet stored in a repository. You can create a repository by publishing the current branch to GitHub.
For information, see Using source control in your codespace .
Using the Visual Studio Code Command Palette
The Visual Studio Code Command Palette allows you to access and manage many features for Codespaces and Visual Studio Code. For more information, see Using the Visual Studio Code Command Palette in GitHub Codespaces .
Navigating to an existing codespace
*
You can see every available codespace that you have created on the "Your codespaces" page. To display this page, in the top-left corner of GitHub, select , then click Codespaces . This takes you to github.com/codespaces .
*
Click the name of the codespace you want to develop in.
Alternatively, you can see any of your codespaces for a specific repository by navigating to that repository, clicking the Code button and selecting the Codespaces tab. The dropdown menu will display all active codespaces for the repository.
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for GitHub CLI.
Working in a codespace in a command shell
Note
To learn more about GitHub CLI, see About GitHub CLI .
You can use GitHub CLI to create a new codespace, or start an existing codespace, and then SSH to it. Once connected, you can work on the command line using your preferred command-line tools.
After installing GitHub CLI and authenticating with your GitHub account you can use the command gh codespace [<SUBCOMMAND>...] --help to browse the help information. Alternatively, you can view the same reference information at https://cli.github.com/manual/gh_codespace .
For more information, see Using GitHub Codespaces with GitHub CLI .
Back to top
Help and support
Was this Doc helpful?
Yes No
Help us make GitHub Docs great!
All Docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution
Still need help?
Provide GitHub Feedback Contact support Expert services Blog
GitHub Inc. © 2026 Terms Privacy Status Pricing
Links found on this page
- Skip to main content [direct]
- GitHub Docs [direct]
- Codespaces [direct]
- Developing in a codespace [direct]
- Quickstart [direct]
- What are Codespaces? [direct]
- Codespaces features [direct]
- The codespace lifecycle [direct]
- Deep dive into Codespaces [direct]
- Create a codespace for a repo [direct]
- Create a codespace from a template [direct]
- Delete a codespace [direct]
- Open an existing codespace [direct]
- Work collaboratively [direct]
- Source control [direct]
- Pull requests [direct]
- Stop a codespace [direct]
- Forward ports [direct]
- Rebuilding a container [direct]
- Default environment variables [direct]
- Persist variables and files [direct]
- Connecting to a private network [direct]
- Machine learning [direct]
- Visual Studio Code [direct]
- GitHub CLI [direct]
- Rename a codespace [direct]
- Change your shell [direct]
- Change the machine type [direct]
- Personalize your codespaces [direct]
- Set the default editor [direct]
- Set the default region [direct]
- Set the timeout [direct]
- Configure automatic deletion [direct]
- Choose the host image [direct]
- Introduction to dev containers [direct]
- Setting up a Node.js project [direct]
- Setting up a C# (.NET) project [direct]
- Setting up a Java project [direct]
- Setting up a PHP project [direct]
- Setting up a Python project [direct]
- Set a minimum machine spec [direct]
- Adding features [direct]
- Automatically opening files [direct]
- Specifying recommended secrets [direct]
- Facilitating codespace creation [direct]
- Set up a template repo [direct]
- About prebuilds [direct]
- Configure prebuilds [direct]
- Allow external repo access [direct]
- Manage prebuilds [direct]
- Test dev container changes [direct]
- Codespaces secrets [direct]
- Repository access [direct]
- Security logs [direct]
- GPG verification [direct]
- Enable or disable Codespaces [direct]
- Billing and ownership [direct]
- List organization codespaces [direct]
- Manage Codespaces costs [direct]
- Manage secrets [direct]
- Audit logs [direct]
- Restrict machine types [direct]
- Restrict codespace creation [direct]
- Restrict base image [direct]
- Restrict port visibility [direct]
- Restrict timeout periods [direct]
- Restrict the retention period [direct]
- Access a private registry [direct]
- Copilot in Codespaces [direct]
- VS Code Command Palette [direct]
- Security in Codespaces [direct]
- Disaster recovery [direct]
- Codespaces logs [direct]
- Codespaces clients [direct]
- Included usage [direct]
- Exporting changes [direct]
- Creation and deletion [direct]
- Authenticating to repositories [direct]
- Connection [direct]
- Codespaces prebuilds [direct]