Skip to content

Commit

Permalink
Merge pull request #32174 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Mar 21, 2024
2 parents 5a597be + 0221dc1 commit 3ef0cdb
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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.
Expand All @@ -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/)
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions content/copilot/github-copilot-in-the-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:

Expand All @@ -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 %}

Expand Down
6 changes: 2 additions & 4 deletions data/reusables/gated-features/copilot-in-cli.md
Original file line number Diff line number Diff line change
@@ -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.
<br><br>
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.
<br><br>
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 %}.

0 comments on commit 3ef0cdb

Please sign in to comment.