diff --git a/assets/images/help/copilot/coding-agent/open-workbench.png b/assets/images/help/copilot/coding-agent/open-workbench.png deleted file mode 100644 index 59d06a65f67b..000000000000 Binary files a/assets/images/help/copilot/coding-agent/open-workbench.png and /dev/null differ diff --git a/assets/images/social-cards/_convert-svgs.sh b/assets/images/social-cards/_convert-svgs.sh deleted file mode 100755 index c317fe175859..000000000000 --- a/assets/images/social-cards/_convert-svgs.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -# Generate social card PNGs from template SVGs -# Requires: -# - librsvg (install with: brew install librsvg) -# - zopfli (install with: brew install zopfli) -# - Mona Sans font (install with: brew install --cask font-mona-sans) - -set -e - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# Check for required CLI tools -if ! command -v rsvg-convert &> /dev/null; then - echo "Error: rsvg-convert not found. Install with: brew install librsvg" - exit 1 -fi - -if ! command -v zopflipng &> /dev/null; then - echo "Error: zopflipng not found. Install with: brew install zopfli" - exit 1 -fi - -# Check for Mona Sans font -if ! fc-list | grep -qi "Mona Sans"; then - echo "Error: Mona Sans font not found. Install with: brew install --cask font-mona-sans" - exit 1 -fi - -# Labels to generate from template (filename:Label Text) -LABELS=( - "account-and-profile:Account" - "actions:Actions" - "admin:Admin" - "apps:Apps" - "authentication:Auth" - "billing:Billing" - "code-security:Security" - "codespaces:Codespaces" - "communities:Community" - "contributing:Contributing" - "copilot:Copilot" - "desktop:Desktop" - "discussions:Discussions" - "education:Education" - "enterprise-onboarding:Enterprise" - "get-started:Get Started" - "github-cli:GitHub CLI" - "github-models:Models" - "graphql:GraphQL" - "integrations:Integrations" - "issues:Issues" - "migrations:Migrations" - "nonprofit:Nonprofit" - "organizations:Orgs" - "packages:Packages" - "pages:Pages" - "pull-requests:Pull requests" - "repositories:Repositories" - "rest:REST" - "search-github:Search" - "site-policy:Site Policy" - "sponsors:Sponsors" - "subscriptions-and-notifications:Account" - "support:Support" - "webhooks:Webhooks" -) - -# Generate default.png from _default.svg -echo "Converting _default.svg to default.png..." -rsvg-convert -w 1200 -h 628 "$SCRIPT_DIR/_default.svg" -o "$SCRIPT_DIR/default.png" -echo "Optimizing default.png with zopflipng..." -zopflipng -y "$SCRIPT_DIR/default.png" "$SCRIPT_DIR/default.png" - -# Generate labeled PNGs from _template.svg -for entry in "${LABELS[@]}"; do - filename="${entry%%:*}" - label="${entry##*:}" - png="$SCRIPT_DIR/$filename.png" - - echo "Generating $filename.png with label \"$label\"..." - sed "s/{{LABEL}}/$label/g" "$SCRIPT_DIR/_template.svg" | rsvg-convert -w 1200 -h 628 -o "$png" - echo "Optimizing $filename.png with zopflipng..." - zopflipng -y "$png" "$png" -done - -echo "Done!" diff --git a/assets/images/social-cards/_default.svg b/assets/images/social-cards/_default.svg deleted file mode 100644 index 09c966f62c1e..000000000000 --- a/assets/images/social-cards/_default.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - GitHub - - - Docs - - - diff --git a/assets/images/social-cards/_template.svg b/assets/images/social-cards/_template.svg deleted file mode 100644 index 82d14ad1aef8..000000000000 --- a/assets/images/social-cards/_template.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - GitHub - - - Docs - - - - {{LABEL}} - - diff --git a/content/code-security/concepts/code-scanning/codeql/codeql-query-suites.md b/content/code-security/concepts/code-scanning/codeql/codeql-query-suites.md index 1f7b6fef4094..8d15e99addbd 100644 --- a/content/code-security/concepts/code-scanning/codeql/codeql-query-suites.md +++ b/content/code-security/concepts/code-scanning/codeql/codeql-query-suites.md @@ -17,20 +17,19 @@ topics: contentType: concepts --- -## About {% data variables.product.prodname_codeql %} query suites +## What are query suites? -With {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}, you can select a specific group of {% data variables.product.prodname_codeql %} queries, called a {% data variables.product.prodname_codeql %} query suite, to run against your code. The following built-in query suites are available through {% data variables.product.prodname_dotcom %}: +Query suites allow you to pass multiple queries to {% data variables.product.prodname_codeql %} without having to specify the path to each query file individually. They provide a way of selecting queries based on their filename, metadata properties, or location on disk or in a {% data variables.product.prodname_codeql %} pack. -* `default` query suite. -* `security-extended` query suite. This suite is referred to as the "Extended" query suite on {% data variables.product.prodname_dotcom %}. +You should use query suites for the queries that you want to frequently use in your {% data variables.product.prodname_codeql %} analyses. You can use a built-in query suite available through {% data variables.product.github %}, or you can create your own. -Currently, both the `default` query suite and the `security-extended` query suite are available for default setup for {% data variables.product.prodname_code_scanning %}. Additionally, organization owners and security managers can recommend a query suite for use with default setup throughout their organization. For more information on configuring default setup for individual repositories, see [AUTOTITLE](/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning). For more information on configuring default setup at scale and recommending a query suite, see [AUTOTITLE](/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning-at-scale). +## Built-in {% data variables.product.prodname_codeql %} query suites -To use a custom query suite, you must configure advanced setup for {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}. For more information on advanced setups and creating a query suite, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning#configuring-advanced-setup-for-code-scanning-with-codeql) and [AUTOTITLE](/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-codeql-query-suites). +The built-in {% data variables.product.prodname_codeql %} query suites, `default` and `security-extended`, are created and maintained by {% data variables.product.prodname_dotcom %}. Both of these query suites are available with default setup for every {% data variables.product.prodname_codeql %}-supported language. -## Built-in {% data variables.product.prodname_codeql %} query suites +Organization owners and security managers can recommend a query suite for use with default setup throughout their organization. For more information, see [AUTOTITLE](/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning-at-scale). -The built-in {% data variables.product.prodname_codeql %} query suites, `default` and `security-extended`, are created and maintained by {% data variables.product.prodname_dotcom %}. Both of these query suites are available for every {% data variables.product.prodname_codeql %}-supported language. For more information on {% data variables.product.prodname_codeql %}-supported languages, see [AUTOTITLE](/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql#about-codeql). +For a complete list of queries included in each query suite for every language, see [AUTOTITLE](/code-security/code-scanning/reference/code-ql-built-in-queries). ### `default` query suite @@ -44,7 +43,11 @@ The built-in {% data variables.product.prodname_codeql %} query suites, `default * Relative to the `default` query suite, the `security-extended` suite may return a greater number of false positive {% data variables.product.prodname_code_scanning %} results. * This query suite is available for use with default setup for {% data variables.product.prodname_code_scanning %}, and is referred to as the "Extended" query suite on {% data variables.product.prodname_dotcom %}. -For a complete list of queries included in each query suite for every language, see [AUTOTITLE](/code-security/code-scanning/reference/code-ql-built-in-queries). +## Custom query suites + +To use a custom query suite, you must configure advanced setup for {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning). + +Query suite definitions are stored in YAML files with the extension `.qls`. A suite definition is a sequence of instructions, where each instruction is a YAML mapping with (usually) a single key. The instructions are executed in the order they appear in the query suite definition. After all the instructions in the suite definition have been executed, the result is a set of selected queries. For more information, see [AUTOTITLE](/code-security/tutorials/customize-code-scanning/creating-codeql-query-suites). ## Further reading diff --git a/content/code-security/concepts/code-scanning/setup-types.md b/content/code-security/concepts/code-scanning/setup-types.md index e7eb4d88966b..531f1335dc14 100644 --- a/content/code-security/concepts/code-scanning/setup-types.md +++ b/content/code-security/concepts/code-scanning/setup-types.md @@ -20,14 +20,28 @@ Default setup for {% data variables.product.prodname_code_scanning %} is the qui * When creating or committing to a pull request based against the repository's default branch, or any protected branch, excluding pull requests from forks. * On a weekly schedule. -If you need more granular control over your {% data variables.product.prodname_code_scanning %} configuration, you should instead configure advanced setup. - ### Supported languages {% data reusables.code-scanning.default-setup-pre-enablement-explanation %} If the code in a repository changes to include any {% data variables.product.prodname_codeql %}-supported languages, {% data variables.product.prodname_dotcom %} will automatically update the {% data variables.product.prodname_code_scanning %} configuration to include the new language. If {% data variables.product.prodname_code_scanning %} fails with the new configuration, {% data variables.product.prodname_dotcom %} will resume the previous configuration automatically so the repository does not lose {% data variables.product.prodname_code_scanning %} coverage. +## Customization of default setup + +After running an initial analysis of your code with default setup, you can make changes to your configuration to better meet your needs. + +If you need more granular control over your {% data variables.product.prodname_code_scanning %} configuration, you should instead configure advanced setup. + +### Configuration options + +For existing configurations of default setup, you can edit: + +* Which languages default setup will analyze. +* The query suite run during analysis. For more information on the available query suites, see [AUTOTITLE](/code-security/code-scanning/managing-your-code-scanning-configuration/codeql-query-suites). +* The threat models ({% data variables.release-phases.public_preview %}) to use for analysis. Your choice of threat model determines which sources of tainted data are treated as a risk to your application. During the {% data variables.release-phases.public_preview %}, threat models are supported only for analysis of {% data variables.code-scanning.code_scanning_threat_model_support %}. For more information about threat models, see [Including local sources of tainted data in default setup](/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup#including-local-sources-of-tainted-data-in-default-setup). + +If your codebase depends on a library or framework that is not recognized by the standard libraries included with {% data variables.product.prodname_codeql %}, you can also extend the {% data variables.product.prodname_codeql %} coverage in default setup using {% data variables.product.prodname_codeql %} model packs. For more information, see [Extending CodeQL coverage with CodeQL model packs in default setup](/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup#extending-codeql-coverage-with-codeql-model-packs-in-default-setup). + ### Available runners You can use default setup for all {% data variables.product.prodname_codeql %}-supported languages on self-hosted runners or {% data variables.product.prodname_dotcom %}-hosted runners. diff --git a/content/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup.md b/content/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup.md index 8392399ef89f..3ddcc0cf4ec6 100644 --- a/content/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup.md +++ b/content/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/editing-your-configuration-of-default-setup.md @@ -15,14 +15,7 @@ redirect_from: contentType: how-tos --- -## About editing your configuration of default setup - -After running an initial analysis of your code with default setup, you may need to make changes to your configuration to better meet your needs. For existing configurations of default setup, you can edit: -* Which languages default setup will analyze. -* The query suite run during analysis. For more information on the available query suites, see [AUTOTITLE](/code-security/code-scanning/managing-your-code-scanning-configuration/codeql-query-suites). -* The threat models ({% data variables.release-phases.public_preview %}) to use for analysis. Your choice of threat model determines which sources of tainted data are treated as a risk to your application. During the {% data variables.release-phases.public_preview %}, threat models are supported only for analysis of {% data variables.code-scanning.code_scanning_threat_model_support %}. For more information about threat models, see [Including local sources of tainted data in default setup](#including-local-sources-of-tainted-data-in-default-setup). - -If your codebase depends on a library or framework that is not recognized by the standard libraries included with {% data variables.product.prodname_codeql %}, you can also extend the {% data variables.product.prodname_codeql %} coverage in default setup using {% data variables.product.prodname_codeql %} model packs. For more information, see [Extending CodeQL coverage with CodeQL model packs in default setup](#extending-codeql-coverage-with-codeql-model-packs-in-default-setup). +After running an initial analysis of your code with default setup, you can make changes to your configuration to better meet your needs. For more information on setup types and customization options, see [AUTOTITLE](/code-security/concepts/code-scanning/setup-types). If you need to change any other aspects of your {% data variables.product.prodname_code_scanning %} configuration, consider configuring advanced setup. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning). diff --git a/content/code-security/how-tos/view-and-interpret-data/analyze-organization-data/exporting-data-from-security-overview.md b/content/code-security/how-tos/view-and-interpret-data/analyze-organization-data/exporting-data-from-security-overview.md index 637a3ea53481..f3e32b84a416 100644 --- a/content/code-security/how-tos/view-and-interpret-data/analyze-organization-data/exporting-data-from-security-overview.md +++ b/content/code-security/how-tos/view-and-interpret-data/analyze-organization-data/exporting-data-from-security-overview.md @@ -19,12 +19,8 @@ redirect_from: - /code-security/security-overview/exporting-data-from-security-overview --- -## About exporting your security overview data - {% data reusables.security-overview.download-csv-files %} -The overview page contains data about security alerts across your organization or enterprise, while the risk and coverage pages contain data about repositories and how they are affected by security alerts or covered by security features. The {% data variables.product.prodname_codeql %} pull request alerts page contains data about {% data variables.product.prodname_codeql %} alerts that were caught in pull requests merged to the default branch. - The CSV file you download will contain data corresponding to the filters you have applied to security overview. For example, if you add the filter `dependabot-alerts:enabled`, your file will only contain data for repositories that have enabled {% data variables.product.prodname_dependabot_alerts %}. > [!NOTE] diff --git a/content/code-security/tutorials/customize-code-scanning/creating-codeql-query-suites.md b/content/code-security/tutorials/customize-code-scanning/creating-codeql-query-suites.md index e6fcd9cdf3e4..a0f1ac713d4c 100644 --- a/content/code-security/tutorials/customize-code-scanning/creating-codeql-query-suites.md +++ b/content/code-security/tutorials/customize-code-scanning/creating-codeql-query-suites.md @@ -17,19 +17,9 @@ redirect_from: contentType: tutorials --- -## About creating {% data variables.product.prodname_codeql %} query suites - {% data reusables.code-scanning.codeql-cli-version-ghes %} -{% data variables.product.prodname_codeql %} query suites provide a way of selecting queries, based on their -filename, location on disk or in a {% data variables.product.prodname_codeql %} pack, or metadata properties. -Create query suites for the queries that you want to frequently use in -your {% data variables.product.prodname_codeql %} analyses. - -Query suites allow you to pass multiple queries to {% data variables.product.prodname_codeql %} without having to specify the path to each query file individually. Query suite definitions are stored in YAML files with the extension `.qls`. A suite definition is a sequence of instructions, where each instruction is a YAML -mapping with (usually) a single key. The instructions are executed in the order -they appear in the query suite definition. After all the instructions in the -suite definition have been executed, the result is a set of selected queries. +You can create query suites for the queries that you want to frequently use in your {% data variables.product.prodname_codeql %} analyses. For more information, see [AUTOTITLE](/code-security/concepts/code-scanning/codeql/codeql-query-suites). > [!NOTE] > Any custom queries that you want to add to a query suite must be in a [{% data variables.product.prodname_codeql %} pack](/code-security/codeql-cli/getting-started-with-the-codeql-cli/customizing-analysis-with-codeql-packs) and contain the correct query metadata. For more information, see [Using custom queries with the {% data variables.product.prodname_codeql_cli %}](/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/using-custom-queries-with-the-codeql-cli). diff --git a/content/copilot/concepts/about-enterprise-accounts-for-copilot-business.md b/content/copilot/concepts/about-enterprise-accounts-for-copilot-business.md index 28c43fac7926..e2c9d15f7f23 100644 --- a/content/copilot/concepts/about-enterprise-accounts-for-copilot-business.md +++ b/content/copilot/concepts/about-enterprise-accounts-for-copilot-business.md @@ -14,6 +14,8 @@ redirect_from: - /early-access/copilot/managing-copilot-business-licenses-with-an-enterprise-account - /early-access/copilot/managing-copilot-business-licenses-with-an-enterprise-account contentType: concepts +category: + - Learn about Copilot --- ## How can my enterprise use {% data variables.product.prodname_copilot %} only? diff --git a/content/copilot/concepts/agents/about-agent-skills.md b/content/copilot/concepts/agents/about-agent-skills.md index 6cf3dd7ee5f4..81bf82fb1930 100644 --- a/content/copilot/concepts/agents/about-agent-skills.md +++ b/content/copilot/concepts/agents/about-agent-skills.md @@ -7,6 +7,8 @@ versions: feature: copilot topics: - Copilot +category: + - Learn about Copilot --- ## About Agent Skills diff --git a/content/copilot/concepts/agents/coding-agent/about-custom-agents.md b/content/copilot/concepts/agents/coding-agent/about-custom-agents.md index e0837e0e73f2..74a30030372d 100644 --- a/content/copilot/concepts/agents/coding-agent/about-custom-agents.md +++ b/content/copilot/concepts/agents/coding-agent/about-custom-agents.md @@ -7,6 +7,8 @@ versions: feature: copilot topics: - Copilot +category: + - Learn about Copilot --- ## About {% data variables.copilot.custom_agents_short %} diff --git a/content/copilot/concepts/agents/coding-agent/agent-management.md b/content/copilot/concepts/agents/coding-agent/agent-management.md index fb7fe4f3c15a..cb8a0541743d 100644 --- a/content/copilot/concepts/agents/coding-agent/agent-management.md +++ b/content/copilot/concepts/agents/coding-agent/agent-management.md @@ -10,6 +10,9 @@ topics: redirect_from: - /copilot/concepts/agents/coding-agent/managing-agents contentType: concepts +category: + - Learn about Copilot + - Author and optimize with Copilot --- ## About agents diff --git a/content/copilot/concepts/agents/enterprise-management.md b/content/copilot/concepts/agents/enterprise-management.md index ce4d31c7a990..9e0334a5e522 100644 --- a/content/copilot/concepts/agents/enterprise-management.md +++ b/content/copilot/concepts/agents/enterprise-management.md @@ -7,6 +7,8 @@ versions: topics: - Copilot contentType: concepts +category: + - Learn about Copilot --- {% data reusables.enterprise-accounts.ai-controls-preview-note %} diff --git a/content/copilot/concepts/agents/openai-codex.md b/content/copilot/concepts/agents/openai-codex.md index a4a4b64663aa..2875ea15f2c5 100644 --- a/content/copilot/concepts/agents/openai-codex.md +++ b/content/copilot/concepts/agents/openai-codex.md @@ -9,6 +9,8 @@ versions: topics: - Copilot contentType: concepts +category: + - Learn about Copilot --- > [!NOTE] {% data variables.product.prodname_openai_codex %} integration is currently in {% data variables.release-phases.public_preview %}. diff --git a/content/copilot/concepts/copilot-metrics.md b/content/copilot/concepts/copilot-metrics.md index efaa12287306..c54e7e7e375d 100644 --- a/content/copilot/concepts/copilot-metrics.md +++ b/content/copilot/concepts/copilot-metrics.md @@ -15,6 +15,9 @@ redirect_from: - /early-access/copilot-metrics/apis/about-the-copilot-metrics-apis - /early-access/copilot-metrics/dashboards/about-the-copilot-metrics-dashboard - /early-access/copilot-metrics/apis/rest-api-endpoints-for-copilot-enterprise-and-user-usage-metrics +category: + - Learn about Copilot + - Manage Copilot for a team --- {% data reusables.copilot.usage-metrics-preview %} diff --git a/content/copilot/concepts/mcp-management.md b/content/copilot/concepts/mcp-management.md index bcd284f24e54..a55de3b6265d 100644 --- a/content/copilot/concepts/mcp-management.md +++ b/content/copilot/concepts/mcp-management.md @@ -7,6 +7,9 @@ versions: topics: - Copilot contentType: concepts +category: + - Learn about Copilot + - Manage Copilot for a team --- You can manage Model Context Protocol (MCP) server usage in your organization or enterprise by configuring a series of MCP policies on {% data variables.product.prodname_dotcom_the_website %}. Through these policies, you can allow or block MCP server usage entirely, or restrict access to a list of servers that you define in an MCP registry. diff --git a/content/copilot/concepts/tools/about-copilot-integrations.md b/content/copilot/concepts/tools/about-copilot-integrations.md index 128ac385e585..d9f85d93a63e 100644 --- a/content/copilot/concepts/tools/about-copilot-integrations.md +++ b/content/copilot/concepts/tools/about-copilot-integrations.md @@ -8,6 +8,9 @@ topics: - Copilot product: '{% data reusables.gated-features.copilot-integrations %}
Sign up for {% data variables.product.prodname_copilot_short %} {% octicon "link-external" height:16 %}' contentType: concepts +category: + - Learn about Copilot + - Integrate Copilot with your tools --- ## Overview diff --git a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/monitor-agentic-activity.md b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/monitor-agentic-activity.md index 66b589d519fc..51b6229be007 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/monitor-agentic-activity.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/monitor-agentic-activity.md @@ -8,6 +8,8 @@ topics: - Copilot shortTitle: Monitor agentic activity contentType: how-tos +category: + - Manage Copilot for a team --- {% data reusables.enterprise-accounts.ai-controls-preview-note %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents.md b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents.md index a21a96a6ed3c..9caafaae8f38 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents.md @@ -8,6 +8,9 @@ topics: - Copilot shortTitle: Prepare for custom agents contentType: how-tos +category: + - Configure Copilot + - Manage Copilot for a team --- {% data reusables.enterprise-accounts.ai-controls-preview-note %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys.md b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys.md index 512389803d8d..5e81c6889bd5 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys.md @@ -8,6 +8,9 @@ topics: - Copilot contentType: how-tos allowTitleToDifferFromFilename: true +category: + - Configure Copilot + - Manage Copilot for a team --- {% data reusables.copilot.byok-intro %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation.md b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation.md index 61ad9fd54f88..f146c79dd8f7 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation.md @@ -9,6 +9,8 @@ topics: - Copilot contentType: how-tos allowTitleToDifferFromFilename: true +category: + - Manage Copilot for a team --- {% data reusables.copilot.usage-metrics-preview %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption.md b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption.md index c2dc27ac7246..2e33f847848d 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption.md @@ -9,6 +9,8 @@ topics: - Copilot contentType: how-tos allowTitleToDifferFromFilename: true +category: + - Manage Copilot for a team --- {% data reusables.copilot.usage-metrics-preview %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents.md b/content/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents.md index 7d19226925d6..d902330fa407 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents.md @@ -8,6 +8,9 @@ topics: - Copilot shortTitle: Prepare for custom agents contentType: how-tos +category: + - Configure Copilot + - Manage Copilot for a team --- {% data reusables.copilot.custom-agents-preview-note %} diff --git a/content/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys.md b/content/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys.md index 02dbed0d6bd4..823400a77ede 100644 --- a/content/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys.md +++ b/content/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys.md @@ -8,6 +8,9 @@ topics: - Copilot contentType: how-tos allowTitleToDifferFromFilename: true +category: + - Configure Copilot + - Manage Copilot for a team --- {% data reusables.copilot.byok-intro %} diff --git a/content/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry.md b/content/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry.md index b4e4f8428580..7602ec4f652e 100644 --- a/content/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry.md +++ b/content/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry.md @@ -10,6 +10,9 @@ topics: - Enterprise shortTitle: Configure MCP registry contentType: how-tos +category: + - Configure Copilot + - Manage Copilot for a team --- ## Prerequisites diff --git a/content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md b/content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md index d0c46bee7663..0a11328bb952 100644 --- a/content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md +++ b/content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md @@ -531,58 +531,6 @@ Whitespace between instructions is ignored, so the instructions can be written a - - -{% copilotcli %} - -This version of this article is for using repository custom instructions with the {% data variables.product.prodname_copilot %} CLI. Click the tabs above for instructions on using custom instructions in other environments. - -## Creating custom instructions - -{% data variables.product.prodname_copilot %} supports three types of repository custom instructions. - -* **Repository-wide custom instructions**, which apply to all requests made in the context of a repository. - - These are specified in a `copilot-instructions.md` file in the `.github` directory of the repository. See [Creating repository-wide custom instructions](#creating-repository-wide-custom-instructions). - -* **Path-specific custom instructions**, which apply to requests made in the context of files that match a specified path. - - These are specified in one or more `NAME.instructions.md` files within or below the `.github/instructions` directory in the repository. See [Creating path-specific custom instructions](#creating-path-specific-custom-instructions). - - If the path you specify matches a file that {% data variables.product.prodname_copilot_short %} is working on, and a repository-wide custom instructions file also exists, then the instructions from both files are used. You should avoid potential conflicts between instructions as {% data variables.product.prodname_copilot_short %}'s choice between conflicting instructions is non-deterministic. - -* **Agent instructions** are used by AI agents. - - {% data reusables.copilot.custom-instructions-agents %} - - Alternatively, you can use a single `CLAUDE.md` or `GEMINI.md` file stored in the root of the repository. - -## Creating repository-wide custom instructions - -1. In the root of your repository, create a file named `.github/copilot-instructions.md`. - - Create the `.github` directory if it does not already exist. - -1. Add natural language instructions to the file, in Markdown format. - - Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility. - -## Creating path-specific custom instructions - -{% data reusables.copilot.custom-instructions-path %} - -{% data reusables.copilot.custom-instructions-note %} - -## Further reading - -* [AUTOTITLE](/copilot/reference/custom-instructions-support) -* [AUTOTITLE](/copilot/tutorials/customization-library/custom-instructions)—a curated collection of examples -* [AUTOTITLE](/copilot/tutorials/use-custom-instructions) - -{% endcopilotcli %} - - - {% eclipse %} diff --git a/content/copilot/how-tos/copilot-cli/add-repository-instructions.md b/content/copilot/how-tos/copilot-cli/add-repository-instructions.md new file mode 100644 index 000000000000..66dde3eaefe0 --- /dev/null +++ b/content/copilot/how-tos/copilot-cli/add-repository-instructions.md @@ -0,0 +1,54 @@ +--- +title: Adding repository custom instructions +shortTitle: Add repository instructions +intro: 'Create repository custom instructions files that give {% data variables.product.prodname_copilot_short %} additional context on how to understand your project and how to build, test and validate its changes.' +versions: + feature: copilot +topics: + - Copilot +contentType: how-tos +--- + +This version of this article is for using repository custom instructions with the {% data variables.product.prodname_copilot %} CLI. Click the tabs above for instructions on using custom instructions in other environments. + +## Creating custom instructions + +{% data variables.product.prodname_copilot %} supports three types of repository custom instructions. + +* **Repository-wide custom instructions**, which apply to all requests made in the context of a repository. + + These are specified in a `copilot-instructions.md` file in the `.github` directory of the repository. See [Creating repository-wide custom instructions](#creating-repository-wide-custom-instructions). + +* **Path-specific custom instructions**, which apply to requests made in the context of files that match a specified path. + + These are specified in one or more `NAME.instructions.md` files within or below the `.github/instructions` directory in the repository. See [Creating path-specific custom instructions](#creating-path-specific-custom-instructions). + + If the path you specify matches a file that {% data variables.product.prodname_copilot_short %} is working on, and a repository-wide custom instructions file also exists, then the instructions from both files are used. You should avoid potential conflicts between instructions as {% data variables.product.prodname_copilot_short %}'s choice between conflicting instructions is non-deterministic. + +* **Agent instructions** are used by AI agents. + + {% data reusables.copilot.custom-instructions-agents %} + + Alternatively, you can use a single `CLAUDE.md` or `GEMINI.md` file stored in the root of the repository. + +## Creating repository-wide custom instructions + +1. In the root of your repository, create a file named `.github/copilot-instructions.md`. + + Create the `.github` directory if it does not already exist. + +1. Add natural language instructions to the file, in Markdown format. + + Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility. + +## Creating path-specific custom instructions + +{% data reusables.copilot.custom-instructions-path %} + +{% data reusables.copilot.custom-instructions-note %} + +## Further reading + +* [AUTOTITLE](/copilot/reference/custom-instructions-support) +* [AUTOTITLE](/copilot/tutorials/customization-library/custom-instructions)—a curated collection of examples +* [AUTOTITLE](/copilot/tutorials/use-custom-instructions) diff --git a/content/copilot/how-tos/copilot-cli/cli-best-practices.md b/content/copilot/how-tos/copilot-cli/cli-best-practices.md new file mode 100644 index 000000000000..a6902af66bf9 --- /dev/null +++ b/content/copilot/how-tos/copilot-cli/cli-best-practices.md @@ -0,0 +1,445 @@ +--- +title: Best practices for GitHub Copilot CLI +shortTitle: Copilot CLI best practices +intro: 'Learn how to get the most out of {% data variables.copilot.copilot_cli %}.' +allowTitleToDifferFromFilename: true +versions: + feature: copilot +topics: + - Copilot +contentType: get-started +category: + - Learn about Copilot + - Author and optimize with Copilot +--- + +## Introduction + +{% data variables.copilot.copilot_cli %} is a terminal-native AI coding assistant that brings agentic capabilities directly to your command line. {% data variables.copilot.copilot_cli_short %} can operate like a chatbot, answering your questions, but its true power lies in its ability to work autonomously as your coding partner, allowing you to delegate tasks and oversee its work. + +This article provides tips for getting the most out of {% data variables.copilot.copilot_cli_short %}, from using the various CLI commands effectively to managing the CLI's access to files. Consider these tips as starting points, then experiment to find out what works best for your workflows. + +> [!NOTE] +> {% data variables.copilot.copilot_cli %} is continually evolving. Use the `/help` command to see the most up to date information. + +## 1. Customize your environment + +### Use custom instructions files + +{% data variables.copilot.copilot_cli_short %} automatically reads instructions from multiple locations, allowing you to define organization-wide standards and repository-specific conventions. + +**Supported locations (in order of discovery):** + +| Location | Scope | +|---------------------------------------------|-----------------------| +| `~/.copilot/copilot-instructions.md` | All sessions (global) | +| `.github/copilot-instructions.md` | Repository | +| `.github/instructions/**/*.instructions.md` | Repository (modular) | +| `AGENTS.md` (in Git root or cwd) | Repository | +| `{% data variables.product.prodname_copilot_short %}.md`, `GEMINI.md`, `CODEX.md` | Repository | + +#### Best practice + +Repository instructions **always take precedence** over global instructions. Use this to enforce team conventions. For example, this is a simple `.github/copilot-instructions.md` file. + +```markdown +## Build Commands +- `npm run build` - Build the project +- `npm run test` - Run all tests +- `npm run lint:fix` - Fix linting issues + +## Code Style +- Use TypeScript strict mode +- Prefer functional components over class components +- Always add JSDoc comments for public APIs + +## Workflow +- Run `npm run lint:fix && npm test` after making changes +- Commit messages follow conventional commits format +- Create feature branches from `main` +``` + +> [!TIP] +> Keep instructions concise and actionable. Lengthy instructions can dilute effectiveness. + +For more information, see [AUTOTITLE](/copilot/concepts/prompting/response-customization?tool=webui). + +### Configure allowed tools + +Manage which tools {% data variables.product.prodname_copilot_short %} can run without asking for permission. When {% data variables.product.prodname_copilot_short %} requests permission for an action, you can choose to **Allow once**, or **Always allow** to add the tool to your allowlist for this and future sessions. + +To reset previously approved tools, use: + +```copilot +/reset-allowed-tools +``` + +You can also preconfigure allowed tools via CLI flags: + +```bash +copilot --allow-tool 'shell(git:*)' --deny-tool 'shell(git push)' +``` + +**Common permission patterns:** + +* `shell(git:*)` — Allow all Git commands +* `shell(npm run:*)` — Allow all npm scripts +* `shell(npm run test:*)` — Allow npm test commands +* `write` — Allow file writes + +### Select your preferred model + +Use `/model` to choose from available models based on your task complexity: + +| Model | Best For | Tradeoffs | +| ----- | -------- | --------- | +| **Claude Opus 4.5** (default) | Complex architecture, difficult debugging, nuanced refactoring | Most capable but uses more [premium requests](/copilot/concepts/billing/copilot-requests#model-multipliers) | +| **Claude Sonnet 4.5** | Day-to-day coding, most routine tasks | Fast, cost-effective, handles most work well | +| **GPT-5.2 Codex** | Code generation, code review, straightforward implementations | Excellent for reviewing code produced by other models | + +**Recommendations:** + +* **Opus 4.5** is ideal for tasks requiring deep reasoning, complex system design, subtle bug investigation, or extensive context understanding. +* **Switch to Sonnet 4.5** for routine tasks where speed and cost efficiency matter—it handles the majority of everyday coding effectively. +* **Use Codex** for high-volume code generation and as a second opinion for reviewing code produced by other models. + +You can switch models mid-session with `/model` as task complexity changes. + +## 2. Plan before you code + +### Plan mode + +**Models achieve higher success rates when given a concrete plan to follow.** In plan mode, {% data variables.product.prodname_copilot_short %} will create a structured implementation plan before any code is written. + +Press Shift+Tab to toggle between normal mode and plan mode. In plan mode, all prompts you enter will trigger the plan workflow. + +Alternatively, you can use the `/plan` command in normal mode to achieve the same effect. + +**Example prompt (from normal mode):** + +```copilot +/plan Add OAuth2 authentication with Google and GitHub providers +``` + +**What happens:** + +* {% data variables.product.prodname_copilot_short %} analyzes your request and codebase. +* **Asks clarifying questions** to align on requirements and approach. +* Creates a structured implementation plan with checkboxes. +* Saves the plan to `plan.md` in your session folder. +* **Waits for your approval** before implementing. + +You can press Ctrl+y to view and edit the plan in your default editor for Markdown files. + +**Example plan output:** + +```markdown +# Implementation Plan: OAuth2 Authentication + +## Overview +Add social authentication using OAuth2 with Google and GitHub providers. + +## Tasks +- [ ] Install dependencies (passport, passport-google-oauth20, passport-github2) +- [ ] Create authentication routes in `/api/auth` +- [ ] Implement passport strategies for each provider +- [ ] Add session management middleware +- [ ] Create login/logout UI components +- [ ] Add environment variables for OAuth credentials +- [ ] Write integration tests + +## Detailed Steps +1. **Dependencies**: Add to package.json... +2. **Routes**: Create `/api/auth/google` and `/api/auth/github`... +``` + +### When to use plan mode + +| Scenario | Use plan mode? | +| ---------------------------------- | ------------ | +| Complex multi-file changes | {% octicon "check" aria-label="Yes" %} | +| Refactoring with many touch points | {% octicon "check" aria-label="Yes" %} | +| New feature implementation | {% octicon "check" aria-label="Yes" %} | +| Quick bug fixes | {% octicon "x" aria-label="No" %} | +| Single file changes | {% octicon "x" aria-label="No" %} | + +### The explore → plan → code → commit workflow + +For best results on complex tasks: + +* **Explore**: + + `Read the authentication files but don't write code yet` + +* **Plan**: + + `/plan Implement password reset flow` + +* **Review**: + + Check the plan, suggest modifications + +* **Implement**: + + `Proceed with the plan` + +* **Verify**: + + `Run the tests and fix any failures` + +* **Commit**: + + `Commit these changes with a descriptive message` + +## 3. Leverage infinite sessions + +### Automatic context window management + +{% data variables.copilot.copilot_cli_short %} features **infinite sessions**. You don't need to worry about running out of context. The system automatically manages context through intelligent compaction that summarizes conversation history while preserving essential information. + +**Session storage location:** + +```copilot +~/.copilot/session-state/{session-id}/ +├── events.jsonl # Full session history +├── workspace.yaml # Metadata +├── plan.md # Implementation plan (if created) +├── checkpoints/ # Compaction history +└── files/ # Persistent artifacts +``` + +> [!NOTE] +> If you ever need to manually trigger compaction, use `/compact`. This is rarely necessary since the system handles it automatically. + +### Session management commands + +```bash +# View session info +/session + +# View checkpoint history +/session checkpoints + +# View files in session +/session files + +# View current plan +/session plan +``` + +### Best practice: Keep sessions focused + +While infinite sessions allow long-running work, focused sessions produce better results: + +* Use `/clear` or `/new` between unrelated tasks. +* This resets context and improves response quality. +* Think of it like starting a fresh conversation with a colleague. + +### The `/context` command + +Visualize your current context usage with `/context`. It shows a breakdown of: + +* System/tools tokens +* Message history tokens +* Available free space +* Buffer allocation + +## 4. Delegate work effectively + +### The `/delegate` command + +**Offload work to run in the cloud using {% data variables.copilot.copilot_coding_agent %}.** This is particularly powerful for: + +* Tasks that can run asynchronously. +* Changes to other repositories. +* Long-running operations you don't want to wait for. + +**Example prompt:** + +```copilot +/delegate Add dark mode support to the settings page +``` + +**What happens:** + +* Your request is sent to {% data variables.copilot.copilot_coding_agent %}. +* The agent creates a pull request with the changes. +* You can continue working locally while the cloud agent works. + +### When to use `/delegate` + +| Use `/delegate` | Work locally | +|------------------------------|-------------------------| +| Tangential tasks | Core feature work | +| Documentation updates | Debugging | +| Refactoring separate modules | Interactive exploration | + +## 5. Common workflows + +### Codebase onboarding + +Use {% data variables.copilot.copilot_cli_short %} as your pair programming partner when joining a new project. For example, you could ask {% data variables.product.prodname_copilot_short %}: + +* `How is logging configured in this project?` +* `What's the pattern for adding a new API endpoint?` +* `Explain the authentication flow` +* `Where are the database migrations?` + +### Test-driven development + +Pair with {% data variables.copilot.copilot_cli_short %} to develop tests. + +* `Write failing tests for the user registration flow` +* *Review and approve the tests.* +* `Now implement code to make all tests pass` +* *Review the implementation.* +* `Commit with message "feat: add user registration"` + +### Code review assistance + +* ``/review Use Opus 4.5 and Codex 5.2 to review the changes in my current branch against `main`. Focus on potential bugs and security issues.`` + +### Git operations + +{% data variables.product.prodname_copilot_short %} excels at Git workflows: + +* ``What changes went into version `2.3.0`?`` +* `Create a PR for this branch with a detailed description` +* ``Rebase this branch against `main` `` +* ``Resolve the merge conflicts in `package.json` `` + +### Bug investigation + +* ``The `/api/users` endpoint returns 500 errors intermittently. Search the codebase and logs to identify the root cause.`` + +### Refactoring + +* `/plan Migrate all class components to functional components with hooks` + + Then answer the questions {% data variables.product.prodname_copilot_short %} asks. Review the plan it creates, and ask {% data variables.product.prodname_copilot_short %} to make changes if necessary. When you are happy with the plan you can prompt: + + `Implement this plan` + +## 6. Advanced patterns + +### Work across multiple repositories + +**{% data variables.copilot.copilot_cli_short %} provides flexible multi-repository workflows**—a key differentiator for teams working on microservices, monorepos, or related projects. + +**Option 1: Run from a parent directory** + +```bash +# Navigate to a parent directory containing multiple repos +cd ~/projects +copilot +``` + +{% data variables.product.prodname_copilot_short %} can now access and work across all child repositories simultaneously. This is ideal for: + +* Microservices architectures +* Making coordinated changes across related repos +* Refactoring shared patterns across projects + +**Option 2: Use `/add-dir` to expand access** + +```bash +# Start in one repo, then add others (requires full paths) +copilot +/add-dir /Users/me/projects/backend-service +/add-dir /Users/me/projects/shared-libs +/add-dir /Users/me/projects/documentation +``` + +**View and manage allowed directories:** + +```bash +/list-dirs +``` + +**Example workflow: coordinated API changes** + +```bash +I need to update the user authentication API. The changes span: + +- @/Users/me/projects/api-gateway (routing changes) +- @/Users/me/projects/auth-service (core logic) +- @/Users/me/projects/frontend (client updates) + +Start by showing me the current auth flow across all three repos. +``` + +This multi-repository capability enables: + +* Cross-cutting refactors (update a shared pattern everywhere) +* API contract changes with client updates +* Documentation that references multiple codebases +* Dependency upgrades across a monorepo + +### Using images for UI work + +{% data variables.product.prodname_copilot_short %} can work with visual references. Simply **drag and drop** images directly into the CLI input, or reference image files: + +```bash +Implement this design: @mockup.png +Match the layout and spacing exactly +``` + +### Checklists for complex migrations + +For large-scale changes: + +```bash +Run the linter and write all errors to `migration-checklist.md` as a checklist. +Then fix each issue one by one, checking them off as you go. +``` + +## 7. Team guidelines + +### Recommended repository setup + +* **Create `.github/copilot-instructions.md`** with: + * Build and test commands + * Code style guidelines + * Required checks before commits + * Architecture decisions + +* **Establish conventions** for: + * When to use `/plan` (complex features, refactoring) + * When to use `/delegate` (tangential work) + * Code review processes with AI assistance + +### Security considerations + +* {% data variables.copilot.copilot_cli_short %} requires explicit approval for potentially destructive operations. +* Review all proposed changes before accepting. +* Use permission allowlists judiciously. +* Never commit secrets. {% data variables.product.prodname_copilot_short %} is designed to avoid this, but always verify. + +### Measuring productivity + +Track metrics like: + +* Time from issue to pull request +* Number of iterations before merge +* Code review feedback cycles +* Test coverage improvements + +### Getting help + +```bash +# In-CLI help +/help + +# View usage statistics +/usage + +# Submit feedback +/feedback +``` + +## Further reading + +* [AUTOTITLE](/copilot/concepts/agents/about-copilot-cli) +* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/use-copilot-cli) +* [AUTOTITLE](/copilot/reference/cli-command-reference) +* [{% data variables.product.prodname_copilot_short %} plans and pricing](https://github.com/features/copilot/plans) diff --git a/content/copilot/how-tos/copilot-cli/cli-getting-started.md b/content/copilot/how-tos/copilot-cli/cli-getting-started.md new file mode 100644 index 000000000000..429fa006346c --- /dev/null +++ b/content/copilot/how-tos/copilot-cli/cli-getting-started.md @@ -0,0 +1,123 @@ +--- +title: Getting started with GitHub Copilot CLI +shortTitle: Copilot CLI quickstart +intro: 'Quickly learn how to use {% data variables.copilot.copilot_cli %}.' +allowTitleToDifferFromFilename: true +versions: + feature: copilot +topics: + - Copilot +contentType: get-started +category: + - Learn about Copilot + - Author and optimize with Copilot +--- + +## Introduction + +{% data variables.copilot.copilot_cli %} is a powerful terminal-native AI coding assistant that brings agentic capabilities directly to your command line. The {% data variables.copilot.copilot_cli_short %} offers deep flexibility, {% data variables.product.github %} workflow integration, and the ability to work autonomously on complex tasks while maintaining full user control. + +This guide will help you start using the CLI. + +## Installation + +Use one of these commands: + +* **Cross-platform (npm)** + + ```bash copy + npm install -g @github/copilot + ``` + +* **Windows (WinGet)** + + ```bash copy + winget install GitHub.Copilot + ``` + +* **macOS/Linux (Homebrew)** + + ```bash copy + brew install copilot-cli + ``` + +## Starting the CLI for the first time + +1. In the terminal, navigate to the project directory where you want to use {% data variables.copilot.copilot_cli_short %}. +1. Start an interactive CLI session: + + ```bash + copilot + ``` + +1. In the CLI interface, enter `/login` and follow the on-screen prompts to authenticate with your {% data variables.product.github %} account. + + You'll only have to do this the first time you use the CLI. + +1. When prompted, confirm that you trust that the files in the current directory are suitable for use with an AI tool. + + > [!NOTE] + > {% data variables.product.prodname_copilot_short %} won't make changes to your files without your explicit approval. + +1. Try asking {% data variables.product.prodname_copilot_short %} a question, for example: + + ```copilot copy + Give me an overview of this project. + ``` + +## Core shortcuts to master + +| Shortcut | Action | +| -------- | ------ | +| Esc | Cancel the current operation | +| Ctrl+C | Cancel if thinking, clear input, or exit | +| Ctrl+L | Clear the screen | +| `@` | Mention files to include in context | +| `/` | Show slash commands | +| and | Navigate the command history | + +For a full list of shortcuts and available commands, enter: + +```bash +/help +``` + +## Using {% data variables.copilot.copilot_cli %} non-interactively + +You can also enter a command and get a response from {% data variables.product.prodname_copilot_short %} directly in your terminal, without starting an interactive session. + +To do this, pass a prompt to the CLI with the `-p` flag. For example: + +```bash +copilot -p "In Git, how can I apply a commit from another branch" +``` + +The `-p` flag allows you to use {% data variables.copilot.copilot_cli %} programmatically within scripts, for example to automate tasks using AI. + +You can add the `-s` flag to tell the CLI to output only {% data variables.product.prodname_copilot_short %}'s response, omitting the additional usage information. + +```bash +copilot -sp "YOUR PROMPT HERE" +``` + +For details of other flags you can use programmatically, and for more information, enter: + +```bash +copilot help +``` + +or: + +```bash +copilot help TOPIC +``` + +where TOPIC is one of the topics listed in the help output. + +## Next steps + +Find out more about {% data variables.copilot.copilot_cli_short %}: + +* [AUTOTITLE](/copilot/concepts/agents/about-copilot-cli) +* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/use-copilot-cli) +* [AUTOTITLE](/copilot/how-tos/copilot-cli/cli-best-practices) diff --git a/content/copilot/how-tos/copilot-cli/index.md b/content/copilot/how-tos/copilot-cli/index.md new file mode 100644 index 000000000000..07fb025c3ae2 --- /dev/null +++ b/content/copilot/how-tos/copilot-cli/index.md @@ -0,0 +1,15 @@ +--- +title: GitHub Copilot CLI +shortTitle: Copilot CLI +intro: Learn how to use {% data variables.product.prodname_copilot %} in your terminal. +versions: + feature: copilot +children: + - /cli-getting-started + - /cli-best-practices + - /install-copilot-cli + - /add-repository-instructions + - /use-hooks + - /use-copilot-cli +contentType: how-tos +--- diff --git a/content/copilot/how-tos/set-up/install-copilot-cli.md b/content/copilot/how-tos/copilot-cli/install-copilot-cli.md similarity index 95% rename from content/copilot/how-tos/set-up/install-copilot-cli.md rename to content/copilot/how-tos/copilot-cli/install-copilot-cli.md index f0078becdc58..a012a3f03b1d 100644 --- a/content/copilot/how-tos/set-up/install-copilot-cli.md +++ b/content/copilot/how-tos/copilot-cli/install-copilot-cli.md @@ -1,7 +1,7 @@ --- title: Installing GitHub Copilot CLI shortTitle: Install Copilot CLI -intro: 'Learn how to install {% data variables.copilot.copilot_cli_short %} so that you can use {% data variables.product.prodname_copilot_short %} directly from the command line.' +intro: Learn how to install {% data variables.copilot.copilot_cli_short %} so that you can use {% data variables.product.prodname_copilot_short %} directly from the command line. versions: feature: copilot topics: @@ -15,6 +15,7 @@ redirect_from: - /copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli - /copilot/how-tos/personal-settings/installing-github-copilot-in-the-cli - /copilot/how-tos/set-up/installing-github-copilot-in-the-cli + - /copilot/how-tos/set-up/install-copilot-cli contentType: how-tos category: - Configure Copilot diff --git a/content/copilot/how-tos/use-copilot-agents/use-copilot-cli.md b/content/copilot/how-tos/copilot-cli/use-copilot-cli.md similarity index 99% rename from content/copilot/how-tos/use-copilot-agents/use-copilot-cli.md rename to content/copilot/how-tos/copilot-cli/use-copilot-cli.md index 5a81beb417f5..c60d027ae47f 100644 --- a/content/copilot/how-tos/use-copilot-agents/use-copilot-cli.md +++ b/content/copilot/how-tos/copilot-cli/use-copilot-cli.md @@ -5,6 +5,7 @@ intro: Learn how to use {% data variables.product.prodname_copilot %} from the c product: '{% data reusables.gated-features.copilot-cli %}' redirect_from: - /copilot/how-tos/use-copilot-cli + - /copilot/how-tos/use-copilot-agents/use-copilot-cli versions: feature: copilot topics: diff --git a/content/copilot/how-tos/copilot-cli/use-hooks.md b/content/copilot/how-tos/copilot-cli/use-hooks.md new file mode 100644 index 000000000000..b4dd5ba03022 --- /dev/null +++ b/content/copilot/how-tos/copilot-cli/use-hooks.md @@ -0,0 +1,29 @@ +--- +title: Using hooks with GitHub Copilot CLI +shortTitle: Use hooks +intro: "Extend {% data variables.product.prodname_copilot %} agent behavior with custom shell commands at key points during agent execution." +versions: + feature: copilot +topics: + - Copilot +contentType: how-tos +category: + - Configure Copilot +--- + +{% data reusables.copilot.coding-agent.hooks-intro %} + +## Creating a hook in a repository on {% data variables.product.github %} + +{% data reusables.copilot.coding-agent.create-hooks-instructions %} + +## Troubleshooting + +{% data reusables.copilot.coding-agent.troubleshoot-hooks %} + +## Further reading + +* [AUTOTITLE](/copilot/reference/hooks-configuration) +* [AUTOTITLE](/copilot/concepts/agents/coding-agent/about-coding-agent) +* [AUTOTITLE](/copilot/concepts/agents/about-copilot-cli) +* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment) \ No newline at end of file diff --git a/content/copilot/how-tos/index.md b/content/copilot/how-tos/index.md index 33f4ee2caa27..2c889032bf0d 100644 --- a/content/copilot/how-tos/index.md +++ b/content/copilot/how-tos/index.md @@ -10,6 +10,7 @@ children: - /set-up - /get-code-suggestions - /chat-with-copilot + - /copilot-cli - /use-copilot-agents - /use-ai-models - /provide-context diff --git a/content/copilot/how-tos/provide-context/use-mcp/change-mcp-registry.md b/content/copilot/how-tos/provide-context/use-mcp/change-mcp-registry.md index b583d57067b8..f7e28fa5d8e0 100644 --- a/content/copilot/how-tos/provide-context/use-mcp/change-mcp-registry.md +++ b/content/copilot/how-tos/provide-context/use-mcp/change-mcp-registry.md @@ -7,6 +7,8 @@ versions: feature: copilot defaultTool: jetbrains contentType: how-tos +category: + - Configure Copilot --- MCP registries for {% data variables.product.prodname_copilot_short %} in your IDE streamline the process of discovering and setting up MCP servers. By default, {% data variables.product.prodname_copilot_short %} uses the {% data variables.product.github %} MCP Registry, but you can configure your own MCP registry to customize the list of servers available in your environment. diff --git a/content/copilot/how-tos/provide-context/use-mcp/configure-toolsets.md b/content/copilot/how-tos/provide-context/use-mcp/configure-toolsets.md index d3166c21b8f3..a1aa4f36bb23 100644 --- a/content/copilot/how-tos/provide-context/use-mcp/configure-toolsets.md +++ b/content/copilot/how-tos/provide-context/use-mcp/configure-toolsets.md @@ -10,6 +10,8 @@ topics: redirect_from: - /copilot/how-tos/context/use-mcp/configure-toolsets contentType: how-tos +category: + - Configure Copilot --- The {% data variables.product.github %} MCP server includes default toolsets (`repos`, `issues`, and `pull_requests`) that are enabled automatically. You can customize toolset configuration by: diff --git a/content/copilot/how-tos/provide-context/use-mcp/enterprise-configuration.md b/content/copilot/how-tos/provide-context/use-mcp/enterprise-configuration.md index 4470411d4f8b..5defeb78a460 100644 --- a/content/copilot/how-tos/provide-context/use-mcp/enterprise-configuration.md +++ b/content/copilot/how-tos/provide-context/use-mcp/enterprise-configuration.md @@ -8,6 +8,8 @@ defaultTool: vscode topics: - Copilot contentType: how-tos +category: + - Configure Copilot --- The {% data variables.product.github %} MCP server can be configured to work with {% data variables.product.prodname_ghe_server %} and {% data variables.enterprise.data_residency %}. The configuration steps differ depending on whether you are using the remote or local MCP server. diff --git a/content/copilot/how-tos/set-up/index.md b/content/copilot/how-tos/set-up/index.md index fb4044ff53a5..b3b76877d768 100644 --- a/content/copilot/how-tos/set-up/index.md +++ b/content/copilot/how-tos/set-up/index.md @@ -1,7 +1,7 @@ --- title: Setting up GitHub Copilot shortTitle: Set up -intro: 'Learn how to set up {% data variables.product.prodname_copilot %}.' +intro: Learn how to set up {% data variables.product.prodname_copilot %}. topics: - Copilot versions: @@ -12,9 +12,9 @@ children: - /set-up-for-enterprise - /set-up-a-dedicated-enterprise-for-copilot-business - /install-copilot-extension - - /install-copilot-cli redirect_from: - /copilot/setting-up-github-copilot - /copilot/get-started/setting-up-github-copilot contentType: how-tos --- + diff --git a/content/copilot/how-tos/set-up/set-up-a-dedicated-enterprise-for-copilot-business.md b/content/copilot/how-tos/set-up/set-up-a-dedicated-enterprise-for-copilot-business.md index 57ebd093574b..4960ac9f46e6 100644 --- a/content/copilot/how-tos/set-up/set-up-a-dedicated-enterprise-for-copilot-business.md +++ b/content/copilot/how-tos/set-up/set-up-a-dedicated-enterprise-for-copilot-business.md @@ -15,6 +15,9 @@ topics: - Accounts - Copilot shortTitle: Set up a dedicated enterprise +category: + - Configure Copilot + - Manage Copilot for a team --- You can create an enterprise account specifically for managing {% data variables.copilot.copilot_business_short %} licenses, without adopting {% data variables.product.prodname_enterprise %}. With this account, you will have access to enterprise-grade integrations with identity providers for authentication and provisioning, without needing to pay for {% data variables.product.prodname_enterprise %} licenses. See [AUTOTITLE](/copilot/concepts/about-enterprise-accounts-for-copilot-business). diff --git a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-common-issues.md b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-common-issues.md index 94cd025ce4a9..4be80d2b8dcf 100644 --- a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-common-issues.md +++ b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-common-issues.md @@ -15,6 +15,8 @@ redirect_from: - /copilot/how-tos/troubleshoot/troubleshooting-common-issues-with-github-copilot - /copilot/how-tos/troubleshoot/troubleshoot-common-issues contentType: how-tos +category: + - Troubleshooting Copilot --- diff --git a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-firewall-settings.md b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-firewall-settings.md index c6eb9665a51b..2530b50a5b9e 100644 --- a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-firewall-settings.md +++ b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-firewall-settings.md @@ -13,6 +13,8 @@ redirect_from: - /copilot/how-tos/troubleshoot/troubleshooting-firewall-settings-for-github-copilot - /copilot/how-tos/troubleshoot/troubleshoot-firewall-settings contentType: how-tos +category: + - Troubleshooting Copilot --- ## About the problem diff --git a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-network-errors.md b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-network-errors.md index 94a96a788d82..51748b4eacd8 100644 --- a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-network-errors.md +++ b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-network-errors.md @@ -14,6 +14,8 @@ versions: feature: copilot shortTitle: Troubleshoot network errors contentType: how-tos +category: + - Troubleshooting Copilot --- If you're working on company equipment and connecting to a corporate network, you may be connecting to the Internet via a VPN or an HTTP proxy server. In some cases, these types of network setups may prevent {% data variables.product.prodname_copilot %} from connecting to {% data variables.product.prodname_dotcom %}'s server. For more information about the options for setting up proxies with {% data variables.product.prodname_copilot %}, see [AUTOTITLE](/copilot/configuring-github-copilot/configuring-network-settings-for-github-copilot). diff --git a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-spark.md b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-spark.md index 8ea5edac6b98..0ea0b201d1d0 100644 --- a/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-spark.md +++ b/content/copilot/how-tos/troubleshoot-copilot/troubleshoot-spark.md @@ -7,6 +7,8 @@ topics: - Copilot shortTitle: Troubleshoot Spark contentType: how-tos +category: + - Troubleshooting Copilot --- ## Error: "Live preview is interrupted. Try refreshing the page to reconnect." diff --git a/content/copilot/how-tos/troubleshoot-copilot/view-logs.md b/content/copilot/how-tos/troubleshoot-copilot/view-logs.md index f09afe0540aa..b6d2e304a5b5 100644 --- a/content/copilot/how-tos/troubleshoot-copilot/view-logs.md +++ b/content/copilot/how-tos/troubleshoot-copilot/view-logs.md @@ -18,6 +18,8 @@ versions: feature: copilot shortTitle: View logs contentType: how-tos +category: + - Troubleshooting Copilot --- {% jetbrains %} diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents.md index 99ddf1d4e888..cab507467e25 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents.md @@ -7,6 +7,9 @@ versions: feature: copilot topics: - Copilot +category: + - Configure Copilot + - Author and optimize with Copilot --- {% data variables.copilot.custom_agents_caps_short %} allow you to create specialized agents with tailored expertise for specific tasks. For a conceptual overview of {% data variables.copilot.custom_agents_short %}, see [AUTOTITLE](/copilot/concepts/agents/coding-agent/about-custom-agents). diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-linear.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-linear.md index 5a333a1cc481..58f775a1db13 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-linear.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-linear.md @@ -7,6 +7,8 @@ versions: topics: - Copilot contentType: how-tos +category: + - Integrate Copilot with your tools --- > [!NOTE] diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-slack.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-slack.md index 220c5016736e..faff8eb32cc4 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-slack.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/integrate-coding-agent-with-slack.md @@ -5,6 +5,8 @@ intro: 'Provide context to the {% data variables.product.prodname_copilot_short versions: feature: copilot contentType: how-tos +category: + - Integrate Copilot with your tools --- > [!NOTE] diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/make-changes-to-an-existing-pr.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/make-changes-to-an-existing-pr.md index 22941dd26cbe..1c587a32fb8f 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/make-changes-to-an-existing-pr.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/make-changes-to-an-existing-pr.md @@ -9,6 +9,8 @@ versions: topics: - Copilot contentType: how-tos +category: + - Author and optimize with Copilot --- > [!NOTE] diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/test-custom-agents.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/test-custom-agents.md index ccdf4c74d999..152a40a3e56f 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/test-custom-agents.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/test-custom-agents.md @@ -7,6 +7,9 @@ topics: - Copilot shortTitle: Test custom agents contentType: how-tos +category: + - Configure Copilot + - Manage Copilot for a team --- {% data reusables.copilot.custom-agents-preview-note %} diff --git a/content/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks.md b/content/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks.md index a9e549792da4..4f678282e67a 100644 --- a/content/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks.md +++ b/content/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks.md @@ -1,7 +1,7 @@ --- title: Using hooks with GitHub Copilot agents shortTitle: Use hooks -intro: 'Learn how to extend and customize {% data variables.product.prodname_copilot %} agent behavior by executing custom shell commands at key points during agent execution.' +intro: 'Extend and customize {% data variables.product.prodname_copilot %} agent behavior by executing custom shell commands at key points during agent execution.' versions: feature: copilot topics: @@ -11,101 +11,15 @@ category: - Configure Copilot --- -Hooks allow you to extend and customize the behavior of {% data variables.product.prodname_copilot %} agents by executing custom shell commands at key points during agent execution. For a conceptual overview of hooks, see [AUTOTITLE](/copilot/concepts/agents/coding-agent/about-hooks). +{% data reusables.copilot.coding-agent.hooks-intro %} ## Creating a hook in a repository on {% data variables.product.github %} -1. Create a new `hooks.json` file with the name of your choice in the `.github/hooks/` folder of your repository. The hooks configuration file **must be present** on your repository's default branch to be used by {% data variables.copilot.copilot_coding_agent %}. For {% data variables.copilot.copilot_cli %}, hooks are loaded from your current working directory. - -1. In your text editor, copy and paste the following hook template. Remove any hooks you don't plan on using from the `hooks` array. - - ```json copy - { - "version": 1, - "hooks": { - "sessionStart": [...], - "sessionEnd": [...], - "userPromptSubmitted": [...], - "preToolUse": [...], - "postToolUse": [...], - "errorOccurred": [...] - } - } - ``` - -1. Configure your hook syntax under the `bash` or `powershell` keys, or directly reference script files you have created. - - * This example runs a script that outputs the start date of the session to a log file using the `sessionStart` hook: - - ```json copy - "sessionStart": [ - { - "type": "command", - "bash": "echo \"Session started: $(date)\" >> logs/session.log", - "powershell": "Add-Content -Path logs/session.log -Value \"Session started: $(Get-Date)\"", - "cwd": ".", - "timeoutSec": 10 - } - ], - ``` - - * This example calls out to an external `log-prompt` script: - - ```json copy - "userPromptSubmitted": [ - { - "type": "command", - "bash": "./scripts/log-prompt.sh", - "powershell": "./scripts/log-prompt.ps1", - "cwd": "scripts", - "env": { - "LOG_LEVEL": "INFO" - } - } - ], - ``` - - For a full reference on the input JSON from agent sessions along with sample scripts, see [AUTOTITLE](/copilot/reference/hooks-configuration). - -1. Commit the file to the repository and merge it into the default branch. Your hooks will now run during agent sessions. +{% data reusables.copilot.coding-agent.create-hooks-instructions %} ## Troubleshooting -If you run into problems using hooks, use the following table to troubleshoot. - -| Issue | Action | -| --- | --- | -| Hooks are not executing | | -| Hooks are timing out |