Skip to content

Commit 753858b

Browse files
timeyoutakeit2percentsilklucascosti
authored
Add Command Palette guide for Codespaces (github#19756)
* adding command palette guide * finishing command palette guide * copy editing * adding and updating reusables * adding correct reusable name * minor fixes * minor fixes * Apply suggestions from code review Co-authored-by: Allison Weins <[email protected]> Co-authored-by: Lucas Costi <[email protected]> * updating images and alt text Co-authored-by: Allison Weins <[email protected]> Co-authored-by: Lucas Costi <[email protected]>
1 parent 23b0b84 commit 753858b

16 files changed

+91
-35
lines changed
Loading
Loading
Loading
Loading
Loading

content/codespaces/codespaces-reference/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ children:
77
- /about-billing-for-codespaces
88
- /troubleshooting-your-codespace
99
- /allowing-your-codespace-to-access-a-private-image-registry
10+
- /using-the-command-palette-in-codespaces
1011
---
1112
{% data reusables.codespaces.release-stage %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Using the Command Palette in Codespaces
3+
intro: 'You can use the Command Palette feature of {% data variables.product.prodname_vscode %} to access many commands in Codespaces.'
4+
versions:
5+
free-pro-team: '*'
6+
type: reference
7+
topics:
8+
- Codespaces
9+
- Visual Studio Code
10+
---
11+
12+
{% data reusables.codespaces.release-stage %}
13+
14+
### About the Command Palette
15+
16+
The Command Palette is one of the focal features of {% data variables.product.prodname_vscode %} and is available for you to use in Codespaces. The Command Palette allows you to access many commands for {% data variables.product.prodname_codespaces %} and {% data variables.product.prodname_vscode %}. For more information on using the Command Palette, see "[User Interface](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette)" in the Visual Studio Code documentation.
17+
18+
### Accessing the Command Palette
19+
20+
You can access the Command Palette in a number of ways.
21+
22+
- `Shift + Command + P` (Mac) / `Ctrl + Shift + P` (Windows).
23+
24+
Note that this command is a reserved keyboard shortcut in Firefox.
25+
- `F1`
26+
- From the Application Menu, click **View > Command Palette…**.
27+
28+
![The application menu](/assets/images/help/codespaces/codespaces-view-menu.png)
29+
30+
### Commands for {% data variables.product.prodname_github_codespaces %}
31+
32+
To see all commands related to {% data variables.product.prodname_github_codespaces %} access the Command Palette, then start typing "Codespaces".
33+
34+
![A list of all commands that relate to Codespaces](/assets/images/help/codespaces/codespaces-commad-palette.png)
35+
36+
#### Suspending or stopping a codespace
37+
38+
If you add a new secret, you'll have to stop and restart the codespace for it to apply your changes.
39+
40+
To suspend or stop your codespace's container, access the Command Palette, then start typing "stop". Select **Codespaces: Stop Current Codespace**.
41+
42+
![Command to stop a codespace](/assets/images/help/codespaces/codespaces-stop.png)
43+
44+
#### Adding a dev container from a template
45+
46+
To add a dev container from a template, access the Command Palette, then start typing "dev container". Select **Codespaces: Add Development Container Configuration Files...**
47+
48+
![Command to add a dev container](/assets/images/help/codespaces/add-prebuilt-container-command.png)
49+
50+
#### Rebuilding a codespace
51+
52+
If you add a dev container or edit any of the configuration files (`devcontainer.json` and `Dockerfile`), you'll have to rebuild your codespace for it to apply your changes.
53+
54+
To rebuild your container, access the Command Palette, then start typing "rebuild". Select **Codespaces: Rebuild Container**.
55+
56+
![Command to rebuild a codespace](/assets/images/help/codespaces/codespaces-rebuild.png)
57+
58+
#### Codespaces logs
59+
60+
You can use the Command Palette to access the codespace creation logs, or you can use it export all logs.
61+
62+
To retrieve the logs for Codespaces, access the Command Palette, then start typing "log". Select **Codespaces: Export Logs** to export all logs related to Codespaces or select **Codespaces: View Creation Logs** to view logs related to the setup.
63+
64+
![Command to access logs](/assets/images/help/codespaces/codespaces-logs.png)

content/codespaces/developing-in-codespaces/developing-in-a-codespace.md

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ For more information on using {% data variables.product.prodname_vscode %}, see
4747

4848
{% data reusables.codespaces.committing-link-to-procedure %}
4949

50+
#### Using the Command Palette
51+
52+
The Command Palette allows you to access and manage many features for {% data variables.product.prodname_codespaces %} and {% data variables.product.prodname_vscode %}. For more information, see "[Using the Command Palette in {% data variables.product.prodname_codespaces %}](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces)."
53+
5054
### Navigating to an existing codespace
5155

5256
1. {% data reusables.codespaces.you-can-see-all-your-codespaces %}

content/codespaces/getting-started-with-codespaces/getting-started-with-your-dotnet-project.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,14 @@ To set up your project with a custom container, you will need to use a `devconta
4444
](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
4545

4646

47-
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
48-
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
47+
{% data reusables.codespaces.command-palette-container %}
4948
2. For this example, click **C# (.NET)**. If you need additional features you can select any container that’s specific to C# (.NET) or a combination of tools such as C# (.NET) and MS SQL.
5049
![Select C# (.NET) option from the list](/assets/images/help/codespaces/add-dotnet-prebuilt-container.png)
5150
3. Click the recommended version of .NET.
5251
![.NET version selection](/assets/images/help/codespaces/add-dotnet-version.png)
5352
4. Accept the default option to add Node.js to your customization.
5453
![Add Node.js selection](/assets/images/help/codespaces/dotnet-options.png)
55-
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
56-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
54+
{% data reusables.codespaces.rebuild-command %}
5755

5856
#### Anatomy of your dev container
5957

@@ -190,9 +188,7 @@ With your dev container added and a basic understanding of what everything does,
190188
"postCreateCommand": "dotnet restore",
191189
```
192190

193-
4. To rebuild your container and apply the devcontainer.json changes, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
194-
195-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
191+
{% data reusables.codespaces.rebuild-command %}
196192

197193
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
198194

content/codespaces/getting-started-with-codespaces/getting-started-with-your-java-project-in-codespaces.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ The default codespaces container comes with the latest Java version, package man
4242
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
4343

4444

45-
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
46-
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
45+
{% data reusables.codespaces.command-palette-container %}
4746
3. For this example, click **Java**. In practice, you could select any container that’s specific to Java or a combination of tools such as Java and Azure Functions.
4847
![Select Java option from the list](/assets/images/help/codespaces/add-java-prebuilt-container.png)
4948
4. Click the recommended version of Java.
5049
![Java version selection](/assets/images/help/codespaces/add-java-version.png)
51-
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
52-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
50+
{% data reusables.codespaces.rebuild-command %}
5351

5452
#### Anatomy of your dev container
5553

@@ -163,9 +161,7 @@ With your dev container added and a basic understanding of what everything does,
163161

164162
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) on the Visual Studio Code docs.
165163

166-
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
167-
168-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
164+
{% data reusables.codespaces.rebuild-command %}
169165

170166
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
171167

content/codespaces/getting-started-with-codespaces/getting-started-with-your-nodejs-project-in-codespaces.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ The default codespaces container will support running Node.js projects like [vsc
4444

4545
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
4646

47-
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
48-
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
47+
{% data reusables.codespaces.command-palette-container %}
4948
3. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
5049
![Select Node option from the list](/assets/images/help/codespaces/add-node-prebuilt-container.png)
5150
4. Click the recommended version of Node.js.
5251
![Node.js version selection](/assets/images/help/codespaces/add-node-version.png)
53-
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
54-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
52+
{% data reusables.codespaces.rebuild-command %}
5553

5654
#### Anatomy of your dev container
5755

@@ -147,9 +145,7 @@ With your dev container added and a basic understanding of what everything does,
147145

148146
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) in the {% data variables.product.prodname_vscode %} docs.
149147

150-
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
151-
152-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
148+
{% data reusables.codespaces.rebuild-command %}
153149

154150
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
155151

content/codespaces/getting-started-with-codespaces/getting-started-with-your-python-project-in-codespaces.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ The default codespaces container comes with the latest Python version, package m
4545
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
4646

4747

48-
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
49-
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
48+
{% data reusables.codespaces.command-palette-container %}
5049
2. For this example, click **Python 3**. If you need additional features you can select any container that’s specific to Python or a combination of tools such as Python 3 and PostgresSQL.
5150
![Select Python option from the list](/assets/images/help/codespaces/add-python-prebuilt-container.png)
5251
3. Click the recommended version of Python.
5352
![Python version selection](/assets/images/help/codespaces/add-python-version.png)
5453
4. Accept the default option to add Node.js to your customization.
5554
![Add Node.js selection](/assets/images/help/codespaces/add-nodejs-selection.png)
56-
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
57-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
55+
{% data reusables.codespaces.rebuild-command %}
5856

5957
#### Anatomy of your dev container
6058

@@ -180,9 +178,7 @@ With your dev container added and a basic understanding of what everything does,
180178
"postCreateCommand": "pip3 install --user -r requirements.txt",
181179
```
182180

183-
4. To rebuild your container and apply the devcontainer.json changes, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
184-
185-
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
181+
{% data reusables.codespaces.rebuild-command %}
186182

187183
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
188184

content/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ Predefined container definitions include a common configuration for a particular
7777

7878
Using a predefined configuration is a great idea if you need some additional extensibility. You can also start with a predefined configuration and amend it as needed for your project's setup.
7979

80-
1. To access the command palette, in the upper-left corner, select the Application Menu and click **Command Palette…** from the **View** menu, then start typing "Codespaces: Add Development Container Configuration Files...". Click **Codespaces: Add Development Container Configuration Files...**
81-
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
80+
{% data reusables.codespaces.command-palette-container %}
8281
1. Click the definition you want to use.
8382
![List of predefined container definitions](/assets/images/help/codespaces/predefined-container-definitions-list.png)
8483
1. Follow the prompts to customize your definition.
@@ -137,10 +136,9 @@ For more information about the available settings for `devcontainer.json`, see [
137136

138137
{% data reusables.codespaces.apply-devcontainer-changes %}
139138

140-
1. {% data reusables.codespaces.rebuild-command %}
141-
!["Codespaces: Rebuild Container" in the command palette](/assets/images/help/codespaces/rebuild-container-command.png)
139+
{% data reusables.codespaces.rebuild-command %}
142140
1. {% data reusables.codespaces.recovery-mode %} Fix the errors in the configuration.
143141
![Error message about recovery mode](/assets/images/help/codespaces/recovery-mode-error-message.png)
144142
- To diagnose the error by reviewing the creation logs, click **View creation log**.
145143
- To fix the errors identified in the logs, update your `devcontainer.json` file.
146-
- To apply the changes, rebuild your container. {% data reusables.codespaces.rebuild-command %}
144+
- To apply the changes, rebuild your container.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1. Access the Command Palette (`Shift + Command + P` / `Ctrl + Shift + P`), then start typing "dev container". Select **Codespaces: Add Development Container Configuration Files...**.
2+
3+
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Access the command palette (`shift command P` / `shift control P`), then start typing "Codespaces: Rebuild Container". Click **Codespaces: Rebuild Container**.
1+
1. Access the command palette (`Shift + Command + P`/ `Ctrl + Shift + P`), then start typing "rebuild". Select **Codespaces: Rebuild Container**.
2+
3+
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Once you have created a secret, it will be available when you create a new codespace or restart the codespace. To use a secret that you've just created in a current codespace, you will need to suspend the codespace and resume it.
1+
Once you have created a secret, it will be available when you create a new codespace or restart the codespace. To use a secret that you've just created in a current codespace, you will need to stop the codespace and resume it. For information about stopping the codespace, see "[Using the Command Palette in {% data variables.product.prodname_codespaces %}](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces#suspending-or-stopping-a-codespace)."

0 commit comments

Comments
 (0)