diff --git a/.github/workflows/add-persona-labelled-to-review-board.yml b/.github/workflows/add-persona-labelled-to-review-board.yml index 27bc845f4ec6..664cb6cd782f 100644 --- a/.github/workflows/add-persona-labelled-to-review-board.yml +++ b/.github/workflows/add-persona-labelled-to-review-board.yml @@ -1,7 +1,7 @@ name: Add persona-labeled issues and PRs to Docs Content Review Board # When the builder persona or driver persona label is added to an issue or PR -# in github/docs, add it to the Docs Content Review Board project. +# in github/docs, add it to the Docs Content Review Board project and thank the contributor. on: issues: @@ -19,6 +19,13 @@ jobs: if: >- github.repository == 'github/docs' && (github.event.label.name == 'builder persona' || github.event.label.name == 'driver persona') + permissions: + issues: write + pull-requests: write + # Serialize runs per item so adding both persona labels posts only one comment. + concurrency: + group: persona-review-board-${{ github.event.issue.number || github.event.pull_request.number }} + cancel-in-progress: false steps: - name: Add item to project env: @@ -28,3 +35,19 @@ jobs: run: | echo "Adding $ITEM_URL to project $PROJECT_NUMBER..." gh project item-add "$PROJECT_NUMBER" --owner github --url "$ITEM_URL" + + - name: Thank the contributor + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + AUTHOR: ${{ github.event.issue.user.login || github.event.pull_request.user.login }} + run: | + existing=$(gh api --paginate "repos/$REPO/issues/$NUMBER/comments" \ + --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | startswith("Thanks for your submission,"))) | .id') + if [ -n "$existing" ]; then + echo "Thank-you comment already posted, skipping." + exit 0 + fi + gh api "repos/$REPO/issues/$NUMBER/comments" \ + -f body="Thanks for your submission, @$AUTHOR! We've marked this for review by the appropriate team." diff --git a/.github/workflows/localization-label-message.yml b/.github/workflows/localization-label-message.yml new file mode 100644 index 000000000000..1c3eb9305235 --- /dev/null +++ b/.github/workflows/localization-label-message.yml @@ -0,0 +1,39 @@ +name: Localization label message + +# When the localization label is added to an issue or PR in github/docs, +# explain that we don't accept changes to translated files. + +on: + issues: + types: [labeled] + pull_request_target: + types: [labeled] + +permissions: + contents: read + +jobs: + comment: + concurrency: + group: localization-label-message-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }} + cancel-in-progress: false + name: Comment with localization message + runs-on: ubuntu-latest + if: github.repository == 'github/docs' && github.event.label.name == 'localization' + permissions: + issues: write + steps: + - name: Comment on issue or PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + run: | + existing=$(gh api --paginate "repos/$REPO/issues/$NUMBER/comments" \ + --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("changes to our translated files"))) | .id') + if [ -n "$existing" ]; then + echo "Localization comment already posted, skipping." + exit 0 + fi + gh api "repos/$REPO/issues/$NUMBER/comments" \ + -f body="Thanks for reaching out! We don't accept changes to our translated files as we use an internal, automated solution for translations. We will flag your request for our team. :yellow_heart:" diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions.md b/content/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions.md index 007fcb346c72..8378d49f109e 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions.md @@ -66,6 +66,9 @@ Referenced files must remain within the repository, or within the custom instruc {% data reusables.copilot.custom-instructions-path %} +> [!NOTE] +> Path-specific instruction files with `excludeAgent: "cloud-agent"` are also ignored by {% data variables.copilot.copilot_cli_short %}. + ## Custom instructions in use Changes you make to custom instructions files are not immediately available for use in active CLI sessions. To apply your changes, exit the current session and then either resume it (for example, run `copilot --continue`), or start a new session (for example, use `/new` from within an interactive session). diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/add-llm-models.md b/content/copilot/how-tos/copilot-cli/customize-copilot/add-llm-models.md index d6dba7d967b0..5eca74208130 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/add-llm-models.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/add-llm-models.md @@ -57,7 +57,7 @@ The CLI saves the model details to the `providers.json` file so it is available ## Manually adding a model provider configuration -To use a model provider other than Ollama, you need to manually add the provider details to the `providers.json` file. +To use a model provider other than Ollama, you can manually add the provider details to the `providers.json` file. ### Prerequisite diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers.md b/content/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers.md index 3f03713b8086..7ce7042709e3 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers.md @@ -125,7 +125,7 @@ copilot mcp add --transport http \ ### Editing the configuration file -You can also add MCP servers by editing the configuration file at `~/.copilot/mcp-config.json`. This is useful if you want to share configurations or add multiple servers at once. +You can also add MCP servers by editing the configuration file at `~/.copilot/mcp-config.json`. This is useful if you want to share configurations or add multiple servers at once. Remove credentials entered directly in the file before sharing it. The following example shows a configuration file with a local server and a remote HTTP server: @@ -157,6 +157,9 @@ For more information on MCP server configuration, see [AUTOTITLE](/copilot/how-t You can configure MCP servers for a specific project by adding a JSON file to the repository. This is useful when you want servers to be available only when working in that project, or when you want to share an MCP setup with collaborators by committing it to the repository. +> [!WARNING] +> Do not commit credentials in a project-level MCP configuration. Set credentials as environment variables and reference them in the configuration, for example `${VAR}`. + {% data variables.copilot.copilot_cli_short %} looks for project-level configuration in the following locations: | Path | Recommended use | @@ -224,11 +227,11 @@ You can manage your configured MCP servers using the `/mcp` commands in interact * **List configured MCP servers:** Use the command `/mcp`. This opens the plugins dashboard showing all configured MCP servers and their current status. Use `/mcp list` to print the same information as plain text. -* **View details about a specific server:** Use the command `/mcp show SERVER-NAME`. This displays the status of the specified server and the list of tools it provides. +* **View details about a specific server:** Use the command `/mcp get SERVER-NAME`. This displays the status of the specified server and the list of tools it provides. * **Edit a server's configuration:** Use the command `/mcp edit SERVER-NAME`. -* **Delete a server:** Use the command `/mcp delete SERVER-NAME`. +* **Delete a server:** Use the command `/mcp remove SERVER-NAME`. * **Disable a server:** Use the command `/mcp disable SERVER-NAME`. A disabled server remains configured but is not used by {% data variables.product.prodname_copilot_short %}. This setting persists across sessions. diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/add-skills.md b/content/copilot/how-tos/copilot-cli/customize-copilot/add-skills.md index 9e58b0aa5b46..a36202d78d33 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/add-skills.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/add-skills.md @@ -18,10 +18,13 @@ docsTeamMetrics: Agent skills are folders of instructions, scripts, and resources that {% data variables.product.prodname_copilot_short %} can load when relevant to improve its performance in specialized tasks. For more information, see [AUTOTITLE](/copilot/concepts/agents/about-agent-skills). +> [!WARNING] +> In {% data variables.copilot.copilot_cli_short %}, omitting a tool from `allowed-tools` does not guarantee a permission prompt. Existing permission settings or approvals can still allow the tool without a prompt. + {% data reusables.copilot.creating-adding-skills %} 1. Start a CLI session, or if you are currently in a CLI session enter `/skills reload`. -1. Enter `/skills info SKILL-NAME` to check that the skill has reloaded. +1. Enter `/skills get SKILL-NAME` to check that the skill has reloaded. SKILL-NAME is defined in the SKILL.md file and is typically the same as the name of the skill directory. @@ -45,13 +48,13 @@ Use the /frontend-design skill to create a responsive navigation bar in React. * **Enable or disable specific skills:** use the command `/skills`, then use the up and down keys on your keyboard to select a skill, press Enter, and choose **Enable** or **Disable**. -* **Find out more about a skill** (including its location): use the command `/skills info SKILL-NAME`. +* **Find out more about a skill** (including its location): use the command `/skills get SKILL-NAME`. * **Add a skills location:** to add an alternative location in which to store skills, use the command `/skills add SKILL-DIRECTORY`, replacing `SKILL-DIRECTORY` with the directory's path. * **Reload skills:** if you have added a skill during a CLI session, you can add it using the command `/skills reload` to avoid having to restart the CLI to use it. -* **Remove skills:** to remove a skill that you have added directly—not via a plugin—use the command `/skills remove SKILL-DIRECTORY`. To remove skills added as part of a plugin you must manage the plugin itself. Use the `info` subcommand to find out which plugin a skill came from. +* **Remove skills:** to remove a personal or project skill by name, use `/skills remove SKILL-NAME`. This deletes the skill's files. To unregister a custom skills directory without deleting its files, use `/skills remove SKILL-DIRECTORY`. To remove skills added as part of a plugin you must manage the plugin itself. Use the `get` subcommand to find out which plugin a skill came from. The `/skills` commands above run inside an interactive session. The same list, add, remove, disable, and enable operations are also available from the terminal command line by using the `copilot skill` subcommand. This is useful for scripting or for setting up skills before you start a session. For example, run `copilot skill list` to list your skills, `copilot skill add ` to add one, or `copilot skill disable SKILL-NAME` and `copilot skill enable SKILL-NAME` to turn a skill off and back on. For the full set of subcommands for {% data variables.copilot.copilot_cli_short %}, see [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-command-reference). diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/change-settings.md b/content/copilot/how-tos/copilot-cli/customize-copilot/change-settings.md index 66b6789ce681..e836bcfff730 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/change-settings.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/change-settings.md @@ -17,11 +17,11 @@ You can use the `/settings` slash command to view and change your settings from Use `/settings` to: -* **Browse and edit settings interactively** — Run `/settings` on its own to open a searchable editor that lists every setting with a description and its current value. +* **Browse and edit settings interactively** — Run `/settings` on its own to open a searchable editor that lists settings with a description and their current values. * **Change a setting with a single command** — Run `/settings KEY VALUE` to change a particular setting without opening the editor. * **Check a setting's value** — Run `/settings show KEY` to display the current value of a setting. -Changes you make with `/settings`, `/config KEY VALUE`, or `/config unset KEY` are written to your personal settings file (by default, `~/.copilot/settings.json`) and persist across sessions. +By default, changes you make with `/settings`, `/config KEY VALUE`, or `/config unset KEY` are written to your personal settings file and persist across sessions. The default file is `~/.copilot/settings.json`. ## Opening the settings editor @@ -31,7 +31,7 @@ To browse and edit settings interactively, enter the slash command with no argum /settings ``` -The editor lists every setting you can change, and the setting's current value. As you move up or down through the list, a short description of the highlighted setting is shown at the bottom of the editor. This allows you to browse and edit settings without needing to know their exact names. +The editor lists settings and their current values. As you move up or down through the list, a short description of the highlighted setting is shown at the bottom of the editor. This allows you to browse and edit settings without needing to know their exact names. For more information about the available settings, see [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#user-settings-copilotsettingsjson). @@ -128,15 +128,13 @@ This outputs a line such as `theme = high-contrast`. The `show` form is useful f Most settings apply right away, but a few only take full effect after {% data variables.copilot.copilot_cli_short %} restarts—for example, `experimental` and the proxy settings. When you change one of these, {% data variables.product.prodname_copilot_short %} tells you a restart is needed, and may restart the session for you. -## Settings you can't change from the command line +## Restrictions when changing settings from the command line -Not every setting is editable through the inline `/settings KEY VALUE` method: +The inline `/settings KEY VALUE` method has the following restrictions: * **Security-sensitive settings**—such as those that change how credentials are stored or that run a shell command—are deliberately excluded, because flipping them in a single line with no confirmation is risky. * **List and structured settings** can't be set inline. Enter `/settings` then press Ctrl+E to open `settings.json` in your configured terminal editor, then edit the setting there. -* **Settings managed by your repository or organization** are shown for reference, but their values come from those sources and override your personal value. Changing them in your user settings has no effect. - -In each of these cases, {% data variables.product.prodname_copilot_short %} explains why the change wasn't applied and points you to the right place to make it. +* **Settings set by your repository or organization** can override or combine with your personal values, depending on the setting. ## Commands replaced by `/settings` diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating.md b/content/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating.md index 1d1637e031fb..c8aff146f8f6 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating.md @@ -159,7 +159,7 @@ The following commands test a plugin in {% data variables.copilot.copilot_cli_sh 1. Iterate on your plugin development, as required. > [!IMPORTANT] - > When you install a plugin, its components are cached and {% data variables.copilot.copilot_cli_short %} reads from the cache for subsequent sessions. To pick up changes made to a local plugin, install it again: + > When you install a plugin directly from a local path, its components are cached and {% data variables.copilot.copilot_cli_short %} reads from the cache for subsequent sessions. To pick up changes made to a local plugin, install it again: > > ```shell copy > copilot plugin install ./my-plugin diff --git a/content/copilot/how-tos/copilot-cli/customize-copilot/use-hooks.md b/content/copilot/how-tos/copilot-cli/customize-copilot/use-hooks.md index 1e2932b7d43c..f7e9eb41ba13 100644 --- a/content/copilot/how-tos/copilot-cli/customize-copilot/use-hooks.md +++ b/content/copilot/how-tos/copilot-cli/customize-copilot/use-hooks.md @@ -22,16 +22,22 @@ docsTeamMetrics: ## Creating a repository-level hook +If you use the `sessionStart` example below, create a `logs` directory in the root of the repository. + 1. Create a new `NAME.json` file (where `NAME` describes the purpose of the file) in the `.github/hooks/` folder of your repository. {% data reusables.copilot.cloud-agent.create-hooks-instructions %} +1. Start or restart {% data variables.copilot.copilot_cli_short %} in a trusted repository to load the hook. You don't need to commit or merge the file for the hook to run locally. + ## Creating a user-level hook User-level hooks are configured just like repository-level hooks, but the hook files are stored locally, below your home directory. The following examples for macOS and Windows show how to configure hooks that will play a sound and display a message box when the CLI finishes responding to a prompt, and when you quit {% data variables.copilot.copilot_cli_short %}. Hooks for Linux would be similar to the macOS example, but would use Linux tools for playing sounds and displaying messages. +When you quit the CLI, the `sessionEnd` hooks for a session share a 1.5-second limit, even if `timeoutSec` is longer. After deleting a user-level hook file, restart the CLI. Hooks can continue to run in sessions that loaded the file, including as the session ends. + ### User-level example for macOS 1. Create a file called `notification-hooks.json` in `~/.copilot/hooks/`. @@ -100,8 +106,24 @@ The following examples for macOS and Windows show how to configure hooks that wi ## Troubleshooting +> [!WARNING] +> The debugging example below logs the full hook input, which can include sensitive data. Remove `set -x` and `echo "$INPUT" >&2` before using it with sensitive input. + {% data reusables.copilot.cloud-agent.troubleshoot-hooks %} +* **Test hooks locally** by piping test input into your hook to validate its behavior: + + ```shell copy + # Create test input + echo '{"timestamp":1704614400000,"cwd":"/tmp","toolName":"bash","toolArgs":{"command":"ls"}}' | ./my-hook.sh + + # Check exit code + echo $? + + # Validate output is valid JSON + ./my-hook.sh | jq . + ``` + ## Troubleshooting sandboxed hooks If a hook fails or times out only when sandboxing is enabled, a tool it calls may need access to a configuration file or cache. See [AUTOTITLE](/copilot/reference/hooks-reference#sandboxed-sessions). diff --git a/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/use-hooks.md b/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/use-hooks.md index e285ab4e7db1..be4194869e82 100644 --- a/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/use-hooks.md +++ b/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/use-hooks.md @@ -23,10 +23,28 @@ redirect_from: {% data reusables.copilot.cloud-agent.create-hooks-instructions %} +1. Commit the file to the repository and merge it into the default branch. Your hooks will now run during agent sessions. + ## Troubleshooting {% data reusables.copilot.cloud-agent.troubleshoot-hooks %} +* **Test hooks locally** by piping test input into your hook to validate its behavior: + + > [!WARNING] + > Hook input can include sensitive data (for example, prompts, tool arguments, or credentials). Use sanitized test payloads, avoid real secrets, and remove or redact any temporary full-input logging after debugging. + + ```shell copy + # Create test input + echo '{"timestamp":1704614400000,"cwd":"/tmp","toolName":"bash","toolArgs":"{\"command\":\"ls\"}"}' | ./my-hook.sh + + # Check exit code + echo $? + + # Validate output is valid JSON + ./my-hook.sh | jq . + ``` + ## Further reading * [AUTOTITLE](/copilot/reference/hooks-reference) diff --git a/data/reusables/copilot/cloud-agent/create-hooks-instructions.md b/data/reusables/copilot/cloud-agent/create-hooks-instructions.md index 73c30c847fbb..0d2748a60873 100644 --- a/data/reusables/copilot/cloud-agent/create-hooks-instructions.md +++ b/data/reusables/copilot/cloud-agent/create-hooks-instructions.md @@ -50,5 +50,3 @@ ``` For a full reference on the input JSON from agent sessions along with sample scripts, see [AUTOTITLE](/copilot/reference/hooks-reference). - -1. Commit the file to the repository and merge it into the default branch. Your hooks will now run during agent sessions. diff --git a/data/reusables/copilot/cloud-agent/troubleshoot-hooks.md b/data/reusables/copilot/cloud-agent/troubleshoot-hooks.md index 4c5ba983c708..7cfdda9068b9 100644 --- a/data/reusables/copilot/cloud-agent/troubleshoot-hooks.md +++ b/data/reusables/copilot/cloud-agent/troubleshoot-hooks.md @@ -19,17 +19,4 @@ You can debug hooks using the following methods: echo "DEBUG: Received input" >&2 echo "$INPUT" >&2 # ... rest of script - ``` - -* **Test hooks locally** by piping test input into your hook to validate its behavior: - - ```shell copy - # Create test input - echo '{"timestamp":1704614400000,"cwd":"/tmp","toolName":"bash","toolArgs":"{\"command\":\"ls\"}"}' | ./my-hook.sh - - # Check exit code - echo $? - - # Validate output is valid JSON - ./my-hook.sh | jq . ``` \ No newline at end of file diff --git a/data/reusables/copilot/creating-adding-skills.md b/data/reusables/copilot/creating-adding-skills.md index edbd864fd12d..3ceed64eadca 100644 --- a/data/reusables/copilot/creating-adding-skills.md +++ b/data/reusables/copilot/creating-adding-skills.md @@ -64,7 +64,7 @@ To create a skill that runs a script: └── convert-svg-to-png.sh ``` -1. **Optionally pre-approve the tools the skill needs.** In your `SKILL.md` frontmatter, you can use the `allowed-tools` field to list the tools {% data variables.product.prodname_copilot_short %} may use without asking for confirmation each time. If a tool is not listed in the `allowed-tools` field, {% data variables.product.prodname_copilot_short %} will prompt you for permission before using it. +1. **Optionally pre-approve the tools the skill needs.** In your `SKILL.md` frontmatter, you can use the `allowed-tools` field to list the tools {% data variables.product.prodname_copilot_short %} may use without asking for confirmation each time. If a tool is not listed in the `allowed-tools` field, {% data variables.product.prodname_copilot_short %} will prompt you for permission before using it, except in {% data variables.copilot.copilot_cli_short %}, where existing permission settings or approvals can allow the tool without a prompt. ```markdown --- @@ -75,7 +75,7 @@ To create a skill that runs a script: ``` > [!WARNING] - > Only pre-approve the `shell` or `bash` tools if you have reviewed this skill and any referenced scripts, and you fully trust their source. Pre-approving `shell` or `bash` removes the confirmation step for running terminal commands and can allow attacker-controlled skills or prompt injections to execute arbitrary commands in your environment. When in doubt, omit `shell` and `bash` from `allowed-tools` so that {% data variables.product.prodname_copilot_short %} must ask for your explicit confirmation before running terminal commands. + > Only pre-approve the `shell` or `bash` tools if you have reviewed this skill and any referenced scripts, and you fully trust their source. Pre-approving `shell` or `bash` removes the confirmation step for running terminal commands and can allow attacker-controlled skills or prompt injections to execute arbitrary commands in your environment. When in doubt, omit `shell` and `bash` from `allowed-tools`. In {% data variables.copilot.copilot_cli_short %}, existing permission settings or approvals can still allow these tools without a prompt. 1. **Write instructions that tell {% data variables.product.prodname_copilot_short %} how to use the script.** In the Markdown body of `SKILL.md`, describe when and how to run the script.