From 6f2d8268e8dbd8d4efebdcdbf277338cb5c56071 Mon Sep 17 00:00:00 2001 From: Sophie <29382425+sophietheking@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:05:47 +0100 Subject: [PATCH 1/4] Copilot in the CLI transparency note update - [GA] (#49010) Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Co-authored-by: Andy Feller --- .../about-github-copilot-in-the-cli.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/content/copilot/github-copilot-in-the-cli/about-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/about-github-copilot-in-the-cli.md index f5fee35395e6..1419f1ab8d0b 100644 --- a/content/copilot/github-copilot-in-the-cli/about-github-copilot-in-the-cli.md +++ b/content/copilot/github-copilot-in-the-cli/about-github-copilot-in-the-cli.md @@ -41,7 +41,7 @@ The response generated by {% data variables.product.prodname_copilot_cli %} is f ### Find the right command to perform a task -{% data variables.product.prodname_copilot_cli %} aims to suggest commands that help you perform the tasks you’re trying to complete. To help {% data variables.product.prodname_copilot_cli_short %} provide better suggestions, you can specify the type of command you are looking for (generic, `git`, or `gh`). If the result isn’t quite what you’re looking for, you can keep revising your question until the returned command meets your expectations. Once you’ve generated the perfect command for your task, you can easily copy it to your clipboard to run it wherever you need. +{% data variables.product.prodname_copilot_cli %} aims to suggest commands that help you perform the tasks you’re trying to complete. To help {% data variables.product.prodname_copilot_cli_short %} provide better suggestions, you can specify the type of command you are looking for (generic, `git`, or `gh`). If the result isn’t quite what you’re looking for, you can keep revising your question until the returned command meets your expectations. Once you’ve generated the perfect command for your task, you can copy it to your clipboard to run it wherever you need, or you can ask {% data variables.product.prodname_copilot_cli %} to execute the command for you. ### Explain an unfamiliar command @@ -67,7 +67,7 @@ Depending on factors such as your operating system and input data, you may encou ### Limited scope -{% data variables.product.prodname_copilot_cli %}'s training is based on online content from the Internet dating up to 2021. It operates within defined boundaries and might struggle with intricate commands, less common ones, or more recently developed tools. The quality of suggestions it provides for each language can be influenced by the availability and diversity of training data. For instance, inquiries about well-documented commands and tools like Git may yield more accurate responses compared to questions about more obscure command line tools. +{% data variables.product.prodname_copilot_cli %} operates within defined boundaries and might struggle with intricate commands, less common ones, or more recently developed tools. The quality of suggestions it provides for each language can be influenced by the availability and diversity of training data. For instance, inquiries about well-documented commands and tools like Git may yield more accurate responses compared to questions about more obscure command line tools. ### Potential biases and errors @@ -77,6 +77,12 @@ Depending on factors such as your operating system and input data, you may encou {% data variables.product.prodname_copilot_cli %} may generate seemingly valid but syntactically or semantically incorrect commands. To avoid issues, always carefully review and verify suggestions, especially for critical or destructive tasks such as deleting content. Ensure generated commands align with best practices and fit your workflow. +### Risk management and user accountability in command execution + +Additional caution is required with the addition of the functionality to ask {% data variables.product.prodname_copilot_cli %} to execute a command, particularly regarding the potential destructiveness of some suggested commands. You may encounter commands for file deletion or hard drive formatting, which can cause problems if used incorrectly. While such commands may be necessary in certain scenarios, you need to be careful when accepting and running these commands. + +Additionally, you are ultimately responsible for the commands executed by {% data variables.product.prodname_copilot_cli %}. It is entirely your decision whether to use commands generated by {% data variables.product.prodname_copilot_cli %}. Despite the presence of fail-safes and safety mechanisms, you must understand that executing commands carries inherent risks. {% data variables.product.prodname_copilot_cli %} provides a powerful tool set, but you should approach its recommendations with caution and ensure that commands align with your intentions and requirements. + ### Inaccurate responses to non-coding topics {% data variables.product.prodname_copilot_cli %} is not designed to answer questions beyond the scope of command line-related tasks. As a result, its responses might not consistently offer accuracy or assistance when confronted with questions unrelated to coding or general command line use. When you inquire about non-coding topics, {% data variables.product.prodname_copilot_cli %} may express its inability to provide a meaningful response. @@ -87,5 +93,5 @@ Depending on factors such as your operating system and input data, you may encou ## Further reading -- "[AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-copilot-pre-release-terms)" +- "[AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot)" - [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center/) From 1f4bc5550b9d4c4ceb4615f1a39c292862765d6a Mon Sep 17 00:00:00 2001 From: Sophie <29382425+sophietheking@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:05:51 +0100 Subject: [PATCH 2/4] Copilot in the CLI - [GA] (#49017) Co-authored-by: Laura Coursen Co-authored-by: Andy Feller --- .../configuring-github-copilot-in-the-cli.md | 44 ++++++++++++++ .../enabling-github-copilot-in-the-cli.md | 10 +--- .../github-copilot-in-the-cli/index.md | 1 + .../using-github-copilot-in-the-cli.md | 58 +++++++++++++++++-- .../gated-features/copilot-in-cli.md | 6 +- 5 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 content/copilot/github-copilot-in-the-cli/configuring-github-copilot-in-the-cli.md diff --git a/content/copilot/github-copilot-in-the-cli/configuring-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/configuring-github-copilot-in-the-cli.md new file mode 100644 index 000000000000..899655716a3c --- /dev/null +++ b/content/copilot/github-copilot-in-the-cli/configuring-github-copilot-in-the-cli.md @@ -0,0 +1,44 @@ +--- +title: Configuring GitHub Copilot in the CLI +intro: 'You can configure usage analytics and the default behavior for the execute command option.' +versions: + feature: copilot-in-the-cli +topics: + - Copilot + - CLI +shortTitle: Configuring Copilot in the CLI +--- + +## About configuration for {% data variables.product.prodname_copilot_cli %} + +By running `gh copilot config` you can configure multiple settings: + +- Optional Usage Analytics +- The default behavior for the execute command confirmation + +## About Optional Usage Analytics + +You can choose to allow {% data variables.product.company_short %} to collect usage data. This helps with improving the product and providing better support. You can enable or disable usage analytics at any time. + +{% data variables.product.company_short %} uses metrics to prioritize work and evaluate whether {% data variables.product.prodname_copilot_cli_short %} is successful in solving real user problems. For example, when a new version is released and there's a spike in exceptions and response ratings, usage analytics are used to understand if there is a regression or a platform issue causing problems. + +Unless you've opted out, {% data variables.product.prodname_copilot_cli_short %} will send a payload in the format below to the analytics system. {% data variables.product.company_short %} is very sensitive to the privacy of users and will never look at the data of specific individuals, but rather only examine aggregate data and trends to inform product decisions. + +```json +{ + "platform": "darwin", + "architecture": "arm64", + "version": "0.3.0-beta", + "custom_event": "true", + "event_parent_command": "explain", + "event_name": "Explain", + "sha": "089a53215fc4383179869f7f6132ce9d6e58754a", + "thread_id": "e61d0d08-f6ba-465b-81cf-c30fd9127d70" +} +``` + +## About the execute command confirmation + +When you use the `ghcs` alias and choose to execute the suggested command, {% data variables.product.prodname_copilot_cli_short %} will prompt you to confirm that you want to execute the code. For more information, see "[AUTOTITLE](/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli#executing-the-command)." + +To prevent accidental execution of commands, the confirmation prompt defaults to `No`. For faster execution, you can change the default answer to `Yes`. diff --git a/content/copilot/github-copilot-in-the-cli/enabling-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/enabling-github-copilot-in-the-cli.md index 3cbe8699a6fc..7a05674c10e6 100644 --- a/content/copilot/github-copilot-in-the-cli/enabling-github-copilot-in-the-cli.md +++ b/content/copilot/github-copilot-in-the-cli/enabling-github-copilot-in-the-cli.md @@ -11,17 +11,13 @@ shortTitle: Enabling Copilot in the CLI {% note %} -**Note:** If you have a {% data variables.product.prodname_copilot_for_individuals %} subscription, you are automatically granted access to the {% data variables.product.prodname_copilot_cli %} beta. +**Note:** If you have a {% data variables.product.prodname_copilot_for_individuals %} subscription, you can install the {% data variables.product.prodname_copilot_cli %} extension without needing to enable it for your organization. {% endnote %} -The {% data variables.product.prodname_copilot_cli %} public beta is available to all organizations{% ifversion ghec %} and enterprises{% endif %} that have an active {% data variables.product.prodname_copilot_for_business %} license. You can enable or disable {% data variables.product.prodname_copilot_cli_short %} for your organization{% ifversion ghec %} or enterprise{% endif %} in the {% data variables.product.prodname_copilot_short %} settings. +You can enable or disable {% data variables.product.prodname_copilot_cli_short %} for your organization{% ifversion ghec %} or enterprise{% endif %} in the {% data variables.product.prodname_copilot_short %} settings. -{% note %} - -**Note:** To use {% data variables.product.prodname_copilot_cli %}, after it has been enabled, users must install the {% data variables.product.prodname_copilot_cli %} extension, see "[AUTOTITLE](/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli)." - -{% endnote %} +To use {% data variables.product.prodname_copilot_cli %}, after it has been enabled, users must install the {% data variables.product.prodname_copilot_cli %} extension, see "[AUTOTITLE](/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli)." ## Enabling or disabling {% data variables.product.prodname_copilot_cli_short %} at the organization level diff --git a/content/copilot/github-copilot-in-the-cli/index.md b/content/copilot/github-copilot-in-the-cli/index.md index 2d422058bcf8..c19b68d5adb2 100644 --- a/content/copilot/github-copilot-in-the-cli/index.md +++ b/content/copilot/github-copilot-in-the-cli/index.md @@ -11,4 +11,5 @@ children: - /about-github-copilot-in-the-cli - /enabling-github-copilot-in-the-cli - /using-github-copilot-in-the-cli + - /configuring-github-copilot-in-the-cli --- \ No newline at end of file diff --git a/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md index d3b55b5920f1..c5821b4a1610 100644 --- a/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md +++ b/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md @@ -29,11 +29,9 @@ To install the {% data variables.product.prodname_copilot_cli_short %} extension To update {% data variables.product.prodname_copilot_cli_short %}, run `gh extension upgrade gh-copilot`. -## Using {% data variables.product.prodname_copilot_cli_short %} - To use `gh` to work with {% data variables.product.prodname_copilot %}, type `gh copilot SUBCOMMAND`. Additionally, you can use `gh copilot --help` for general help or `gh copilot SUBCOMMAND --help` for help with a specific subcommand. -### Asking {% data variables.product.prodname_copilot_cli_short %} to explain a command +## Asking {% data variables.product.prodname_copilot_cli_short %} to explain a command You can ask {% data variables.product.prodname_copilot_cli_short %} to explain a command for you by running: @@ -49,7 +47,7 @@ gh copilot explain "sudo apt-get" {% data variables.product.prodname_copilot_cli_short %} can help by explaining what a command does in plain language. This makes it easier for you to understand the command's purpose and how it works for a specific example. You don't need to go through the command's documentation because the explanation includes information about what the command takes as input and produces as output, and provides practical examples. -### Asking {% data variables.product.prodname_copilot_cli_short %} to suggest a command +## Asking {% data variables.product.prodname_copilot_cli_short %} to suggest a command You can ask {% data variables.product.prodname_copilot_cli_short %} to suggest a command for you by running: @@ -67,7 +65,57 @@ gh copilot suggest "Install git" If the result isn’t quite what you’re looking for, you can keep revising your question until the returned command meets your expectations. You can do this by selecting the **Revise command** option. -Once you’ve generated the perfect command for your task, you can easily copy it to your clipboard to run it wherever you need by selecting the **Copy to clipboard** option. +Once you’ve generated the perfect command for your task, you can easily copy it to your clipboard to run it wherever you need by selecting the **Copy to clipboard** option, or you can execute the command. + +### Executing the command + +After {% data variables.product.prodname_copilot_cli_short %} suggests a command, you can choose to execute the command by selecting the **Execute command** option. If you select this option after running `gh copilot suggest` to ask for a suggestion, {% data variables.product.prodname_copilot_cli_short %} will copy the command to your clipboard and exit out of the interactive session automatically. You can then paste the command and run it yourself. + +If you want {% data variables.product.prodname_copilot_cli_short %} to execute commands for you, the `ghcs` alias generated by `gh copilot alias` provides this support. For more information about configuring the `ghcs` alias, see "[Setting up aliases for {% data variables.product.prodname_copilot_cli_short %}](#setting-up-aliases-for-copilot-in-the-cli)." + +When you use the `ghcs` alias and you select **Execute command**, {% data variables.product.prodname_copilot_cli_short %} will ask for your confirmation before executing the command. The confirmation prompt defaults to `No`, but you can change your preference via the `gh copilot config` option. For more information, see "[AUTOTITLE](/copilot/github-copilot-in-the-cli/configuring-github-copilot-in-the-cli)." + +If you confirm, the command will be executed and saved to your shell history for future reference. + +## Setting up aliases for {% data variables.product.prodname_copilot_cli_short %} + +With `gh copilot alias`, you can create aliases for {% data variables.product.prodname_copilot_cli_short %}. Aliases are not required to use {% data variables.product.prodname_copilot_cli_short %}, but they can be useful for convenience as they require fewer keystrokes and aid in executing suggested commands. + +You can also use the provided aliases to wrap `gh copilot suggest` and `gh copilot explain`. The provided aliases are `ghcs` and `ghce`. To use `ghcs` and `ghce`, you'll need to add some alias configurations to your shell configuration file. + +The following examples show how to add the alias configurations to your Bash, PowerShell, and Zsh configuration files. + +**Bash** + +Add the following to your Bash configuration file: + +```shell +echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc +``` + +**PowerShell** + +Add the following to your PowerShell profile: + +```shell +$GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath "gh-copilot.ps1" +gh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force ) +echo ". $GH_COPILOT_PROFILE" >> $PROFILE +``` + +**Zsh** + +Add the following to your Zsh configuration file: + +```shell +echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc +``` + +Once you have the alias set up, you can run the following: + +```shell +ghcs 'print "Hello world!"' +``` ## Sharing feedback about {% data variables.product.prodname_copilot_cli_short %} diff --git a/data/reusables/gated-features/copilot-in-cli.md b/data/reusables/gated-features/copilot-in-cli.md index a5cbd189caa2..bb71b5826d3e 100644 --- a/data/reusables/gated-features/copilot-in-cli.md +++ b/data/reusables/gated-features/copilot-in-cli.md @@ -1,5 +1,3 @@ -{% data variables.product.prodname_copilot_cli %} is currently in public beta, and is subject to change. +Owners of organizations or enterprises with a {% data variables.product.prodname_copilot_for_business %} or {% data variables.product.prodname_copilot_enterprise %} subscription can decide whether to grant access to {% data variables.product.prodname_copilot_cli %} for users in their organization or enterprise.

-Owners of organizations or enterprises with a {% data variables.product.prodname_copilot_for_business %} or {% data variables.product.prodname_copilot_enterprise %} subscription can decide whether to grant access to the {% data variables.product.prodname_copilot_cli %} beta for users in their organization or enterprise. -

-If you have a {% data variables.product.prodname_copilot_for_individuals %} subscription, you now have access to the {% data variables.product.prodname_copilot_cli %} beta. +If you have a {% data variables.product.prodname_copilot_for_individuals %} subscription, you now have access to {% data variables.product.prodname_copilot_cli %}. From cba98349a4238ecad8249deaf7bfb0bb349e07db Mon Sep 17 00:00:00 2001 From: Taylor Reis <76077878+taylorreis@users.noreply.github.com> Date: Thu, 21 Mar 2024 07:05:59 -0700 Subject: [PATCH 3/4] Update enabling-guest-collaborators.md (#49744) Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com> --- .../enabling-guest-collaborators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/enabling-guest-collaborators.md b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/enabling-guest-collaborators.md index 166cbae5355b..da619d40abbd 100644 --- a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/enabling-guest-collaborators.md +++ b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/enabling-guest-collaborators.md @@ -32,7 +32,7 @@ If you use Microsoft Entra ID (previously known as Azure AD) or Okta for SAML au - If the application registration does not display the roles, proceed to the next step. 1. In the Azure portal, click **App registrations**. 1. Click **All applications**, then use the search bar to find your application for {% data variables.product.prodname_emus %}. -1. Click your SAML application. +1. Click your SAML or OIDC application. 1. In the left sidebar, click **Manifest**. 1. Under "appRoles", add the following: From 0221dc1f8f7aed1714a2d588ccac11fb602a6885 Mon Sep 17 00:00:00 2001 From: Matt Togstad Date: Thu, 21 Mar 2024 07:15:28 -0700 Subject: [PATCH 4/4] Update about-visual-studio-subscriptions-with-github-enterprise.md (#49787) Co-authored-by: Laura Coursen --- .../about-visual-studio-subscriptions-with-github-enterprise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md b/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md index 19d6889a0ba3..09ca8d17261a 100644 --- a/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md +++ b/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md @@ -33,7 +33,7 @@ After you assign a license for {% data variables.visual_studio.prodname_vss_ghe {% note %} -**Note:** To make sure that a {% data variables.product.prodname_emus %} account consumes a {% data variables.product.prodname_vs %} license, either the email address associated with the {% data variables.product.prodname_dotcom %} account or the SCIM `userName` attribute value from the linked identity must match the UPN. +**Note:** For {% data variables.product.prodname_emu %} only, to make sure a user account consumes a {% data variables.product.prodname_vs %} license, ensure the {% data variables.product.prodname_vs %} UPN matches the SCIM `userName` attribute or the email address from the linked identity on the {% data variables.product.prodname_dotcom %} account. {% endnote %}