Skip to content

Commit 87037c5

Browse files
authored
Merge pull request #45074 from github/repo-sync
Repo sync
2 parents 75997ac + a5cfe36 commit 87037c5

20 files changed

Lines changed: 717 additions & 21 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ For complete style guidance, see our [style guide](https://docs.github.com/en/co
7878

7979
<img src="/contributing/images/contribution_cta.png" />
8080

81-
**Make changes in a codespace:** See "[Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md)" for documentation-specific setup.
81+
**Make changes in a codespace:** See "[Working on GitHub Docs in a codespace](https://docs.github.com/en/contributing/setting-up-your-environment-to-work-on-github-docs/working-on-github-docs-in-a-codespace)" for documentation-specific setup.
8282

8383
**Make changes locally:**
8484
1. Fork the repository (see [official forking guide](https://docs.github.com/en/contributing))

.github/workflows/sync-llms-txt.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,17 @@ jobs:
105105
git config user.name "docs-bot"
106106
git config user.email "77750099+docs-bot@users.noreply.github.com"
107107
git add data/llms-txt/docs.md
108-
git commit -m "Update data/llms-txt/docs.md from popularity data"
109-
git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
108+
# diff_docs compares against main, but the sync branch may already
109+
# exist with this exact content (open PR from a prior run). In that
110+
# case there is nothing new to stage, and `git commit` would exit 1
111+
# and fail the whole workflow. Skip the commit and push when the
112+
# branch is already up to date.
113+
if git diff --cached --quiet; then
114+
echo "Sync branch already has the latest generated docs.md; nothing to commit."
115+
else
116+
git commit -m "Update data/llms-txt/docs.md from popularity data"
117+
git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
118+
fi
110119
111120
- name: Create or update docs-internal PR
112121
if: steps.diff_docs.outputs.changed == 'true'

assets/images/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
The `/assets/images` directory holds all the site's images.
33

44

5-
See [imaging and versioning](https://github.com/github/docs/blob/main/contributing/images-and-versioning.md) from the contributing docs for more information.
5+
See [Creating screenshots](https://docs.github.com/en/contributing/writing-for-github-docs/creating-screenshots) from the contributing docs for more information.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: About extensions for {% data variables.copilot.copilot_cli %}
3+
shortTitle: CLI extensions
4+
allowTitleToDifferFromFilename: true
5+
intro: 'Extensions let you add your own tools and slash commands to {% data variables.copilot.copilot_cli %}, using only the SDK that ships with the CLI.'
6+
product: '{% data reusables.gated-features.copilot-cli %}'
7+
versions:
8+
feature: copilot
9+
contentType: concepts
10+
category:
11+
- Learn about Copilot # Copilot discovery page
12+
- Learn about Copilot CLI # Copilot CLI bespoke page
13+
docsTeamMetrics:
14+
- copilot-cli
15+
---
16+
17+
{% data reusables.copilot.copilot-cli.cli-extensions-experimental %}
18+
19+
An extension lets you add your own capabilities to {% data variables.copilot.copilot_cli_short %}. Each extension is a small Node.js module that runs as a separate process alongside your interactive session and connects back to it. Through that connection an extension can add:
20+
21+
* **Tools** that {% data variables.product.prodname_copilot_short %} can call while it works on your behalf.
22+
* **Slash commands** that you run yourself.
23+
24+
Because an extension runs real code on your machine, you can add capabilities the built-in tools don't have. For example, an extension can watch what happens in a session and keep a running total across tool calls, which a one-off shell command can't do.
25+
26+
This article explains how extensions work and how {% data variables.copilot.copilot_cli_short %} handles them. For a hands-on guide to building your own extensions, see [AUTOTITLE](/copilot/tutorials/create-an-extension).
27+
28+
> [!WARNING]
29+
> Extensions execute on your computer with your privileges. Only load extension code that you trust, in the same way you would only run any other script you didn't write yourself.
30+
31+
## How extensions are discovered
32+
33+
When {% data variables.copilot.copilot_cli_short %} starts, it looks for extensions in several locations. Each extension lives in its own subdirectory, and that subdirectory must contain an entry file named `extension.mjs`, `extension.cjs`, or `extension.js`. These are all JavaScript files: the {% data variables.copilot.copilot_cli_short %} runs the entry file directly with Node.js, so an extension must be written in JavaScript—TypeScript and other languages are currently not supported.
34+
35+
The name of the subdirectory becomes the name of the extension.
36+
37+
| Source | Location | Availability |
38+
| --- | --- | --- |
39+
| **Project** | `.github/extensions/NAME/` in the current repository | Available to anyone working in that repository. |
40+
| **User** | `~/.copilot/extensions/NAME/` | Available in all your CLI sessions, in every directory. |
41+
| **Plugin** | An installed plugin | Available wherever the plugin is enabled. |
42+
43+
## Choosing where an extension lives
44+
45+
Where you put the extension directory determines who can use it:
46+
47+
* Put it in **`.github/extensions/`** in a repository when the extension is specific to that project and you want to share it with everyone who works there.
48+
* Put it in **`~/.copilot/extensions/`** when you want the extension available in all of your own sessions, regardless of which directory you start the CLI in.
49+
50+
The two locations follow exactly the same structure—a named subdirectory containing an `extension.mjs` file—so you can move an extension from one to the other simply by relocating its folder.
51+
52+
## Enabling extensions
53+
54+
Extensions are currently an experimental feature, so you need to turn on experimental features. You can do this by doing either of the following:
55+
56+
* Start the CLI with the `--experimental` flag.
57+
* Run the `/experimental on` slash command inside an interactive session.
58+
59+
## Changing how the CLI handles extensions
60+
61+
You can limit {% data variables.product.prodname_copilot_short %}'s access to extensions, or turn them off entirely, by using the `/extensions mode` command. When you use this command you get three options:
62+
63+
* **Load & Augment** (the default)—the CLI runs your extensions, _and_ {% data variables.product.prodname_copilot_short %} can manage them.
64+
* **Load Only**—the CLI runs your extensions, but {% data variables.product.prodname_copilot_short %} cannot manage them.
65+
* **Disabled**—extensions are turned off entirely in the current session and will remain disabled in future sessions until you switch to one of the other two settings. Other current sessions are not affected.
66+
67+
Any change you make takes effect immediately in the current session:
68+
69+
* Switching **to Disabled** stops any extensions that are currently running. Their processes are shut down and their tools are no longer available.
70+
* Switching **from Disabled** to either of the other settings starts your extensions.
71+
* Switching between **Load Only** and **Load & Augment** just changes whether {% data variables.product.prodname_copilot_short %} can manage your extensions.
72+
73+
### What "managing extensions" means
74+
75+
In **Load & Augment** mode, {% data variables.product.prodname_copilot_short %} is given a small set of extra tools that let it work on the extension system directly, as part of carrying out your requests. Using these tools, {% data variables.product.prodname_copilot_short %} can:
76+
77+
* **List** the extensions it has discovered and see their status.
78+
* **Inspect** an extension, including a tail of its log file, to help diagnose one that has failed or is misbehaving.
79+
* **Scaffold** a new extension—generate a starter `extension.mjs` file for you to build on.
80+
* **Reload** extensions, so that code it (or you) has just written takes effect without restarting the session.
81+
82+
This is what makes it possible for you to ask {% data variables.product.prodname_copilot_short %} to build an extension for you. {% data variables.product.prodname_copilot_short %} can create the file, write the code, and reload it, all without leaving the session.
83+
84+
Choose **Load Only** when you want to keep a known, trusted set of extensions running but don't want {% data variables.product.prodname_copilot_short %} creating, reloading, or otherwise changing extension code—which runs on your machine—as a side effect of its work. Your existing extensions still run, and {% data variables.product.prodname_copilot_short %} can still call the tools they provide; it simply can't manage the extensions themselves.
85+
86+
## Extensions compared with plugins
87+
88+
Both extensions and plugins add functionality to {% data variables.copilot.copilot_cli_short %}, but they serve different purposes:
89+
90+
* An **extension** is a single JavaScript module that you write to add tools and slash commands, backed by code that runs in your session.
91+
* A **plugin** is an installable package that bundles reusable components—such as agents, skills, hooks, and integrations—and can be distributed through a marketplace.
92+
93+
For more information about plugins, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-cli-plugins).
94+
95+
## Further reading
96+
97+
* [AUTOTITLE](/copilot/tutorials/create-an-extension)
98+
* [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-command-reference#slash-commands-in-the-interactive-interface)
99+
* [AUTOTITLE](/copilot/how-tos/copilot-cli)

content/copilot/concepts/agents/copilot-cli/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ children:
1010
- /comparing-cli-features
1111
- /copilot-cli-in-github-actions
1212
- /cancel-and-roll-back
13+
- /context-management
1314
- /about-remote-control
1415
- /about-custom-agents
1516
- /autopilot
@@ -18,7 +19,7 @@ children:
1819
- /chronicle
1920
- /rubber-duck
2021
- /lsp-servers
21-
- /context-management
22+
- /about-cli-extensions
2223
- /tool-search
2324
contentType: concepts
2425
docsTeamMetrics:

content/copilot/get-started/enterprise-ai-governance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ journeyTracks:
2626
- href: '/copilot/tutorials/roll-out-at-scale/govern-at-scale/maintain-codebase-standards'
2727
- href: '/copilot/how-tos/administer-copilot/manage-for-enterprise/review-audit-logs'
2828
- href: '/copilot/concepts/preparing-for-new-features-and-models'
29+
- href: '/copilot/tutorials/roll-out-at-scale/govern-at-scale/pilot-a-feature-or-model'
2930
- id: 'adopting_agents'
3031
title: 'Adopting agents'
3132
description: 'Roll out agentic features within secure guardrails.'

content/copilot/how-tos/copilot-cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ children:
4141
- /content/copilot/concepts/agents/copilot-cli/lsp-servers
4242
- /content/copilot/concepts/agents/copilot-cli/research
4343
- /content/copilot/concepts/agents/copilot-cli/rubber-duck
44+
- /content/copilot/concepts/agents/copilot-cli/about-cli-extensions
4445
- /content/copilot/reference/copilot-cli-reference/acp-server
4546
- /content/copilot/reference/copilot-cli-reference/cli-command-reference
4647
- /content/copilot/reference/copilot-cli-reference/cli-plugin-reference

content/copilot/how-tos/copilot-on-github/set-up-copilot/enable-copilot/set-up-a-dedicated-enterprise-for-copilot-business.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,15 @@ With a dedicated enterprise account, you get enterprise-grade identity provider
2222

2323
## Create an enterprise account
2424

25-
> [!IMPORTANT]
26-
> If you purchased {% data variables.copilot.copilot_business_short %} through {% data variables.product.company_short %}'s sales team, your enterprise account is already created. Skip to the next section.
25+
To create an enterprise account, contact {% data variables.product.company_short %}'s [sales team](https://github.com/enterprise/contact?ref_product=copilot&ref_type=purchase). They will provision you with a standard enterprise account with {% data variables.product.prodname_copilot_short %} enabled.
2726

28-
Start a trial of {% data variables.product.prodname_ghe_cloud %} to create your enterprise account.
29-
30-
<a href="https://github.com/account/enterprises/new?ref_product=ghec&ref_type=trial&ref_style=button&ref_plan=enterprise" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Set up a trial of {% data variables.product.prodname_ghe_cloud %}</span> {% octicon "link-external" height:16 aria-label="link-external" %}</a>
31-
32-
Do not create any organizations during setup. Adding users to organizations assigns {% data variables.product.prodname_enterprise %} licenses, while adding users directly to the enterprise keeps your setup limited to {% data variables.copilot.copilot_business_short %}.
3327

3428
## Add users to your enterprise
3529

30+
Once you have an enterprise account, add the people who will receive {% data variables.copilot.copilot_business_short %} licenses. How you add users depends on your enterprise type.
3631
Once you have an enterprise account, add the people who will receive {% data variables.copilot.copilot_business_short %} licenses. How you add users depends on your enterprise type.
3732

33+
Do not create any organizations during setup. Adding users to organizations assigns {% data variables.product.prodname_enterprise %} licenses, while adding users directly to the enterprise keeps your setup limited to {% data variables.copilot.copilot_business_short %}.
3834
### Enterprise with personal accounts
3935

4036
Invite users directly to your enterprise. For detailed steps, see [AUTOTITLE](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/invite-users-directly).
@@ -58,7 +54,6 @@ To begin using {% data variables.copilot.copilot_business_short %} after your tr
5854

5955
1. Ensure you are signed in as an enterprise administrator on {% data variables.product.github %}.
6056
1. To purchase {% data variables.product.prodname_copilot %} for your enterprise, [contact {% data variables.product.github %}'s Sales team](https://github.com/enterprise/contact?ref_product=copilot&ref_type=engagement&ref_style=text).
61-
1. A member of the Sales team will work with you to set up {% data variables.product.prodname_copilot_short %} for your enterprise.
6257

6358
## Assign {% data variables.product.prodname_copilot_short %} licenses
6459

content/copilot/reference/copilot-cli-reference/cli-command-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ When diff mode is open (entered via `/diff`):
242242
| `/resume [SESSION-ID]`, `/continue [SESSION-ID]` | Switch to a different session by choosing from a list (optionally specify a session ID). |
243243
| `/review [PROMPT]` | Run the code review agent to analyze changes. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/agentic-code-review). |
244244
| `/rubber-duck [PROMPT]` | Consult the rubber duck agent for a second opinion on plans, code, and tests. See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/rubber-duck). |
245-
| `/sandbox [enable\|disable]` | Configure shell command sandboxing. |
245+
| `/sandbox [enable\|disable]` | Enable, disable, or configure OS-level sandboxing that restricts filesystem and network access for shell commands, MCP/LSP servers, and built-in file/web tools. Run `/sandbox` with no arguments to open the policy dialog. |
246246
| `/search [QUERY]`, `/find [QUERY]` | Search the conversation timeline. {% data reusables.copilot.experimental %} |
247247
| `/security-review [PROMPT]` | Run the security review agent to analyze changes for vulnerabilities. |
248248
| `/session [info\|checkpoints [n]\|files\|plan\|rename [NAME]\|cleanup\|prune\|delete [ID]\|delete-all]`, `/sessions [info\|checkpoints [n]\|files\|plan\|rename [NAME]\|cleanup\|prune\|delete [ID]\|delete-all]` | Show session information and manage sessions. The `info` subcommand shows session details including the session link (when available). Subcommands: `info`, `checkpoints`, `files`, `plan`, `rename`, `cleanup`, `prune`, `delete`, `delete-all`. |

0 commit comments

Comments
 (0)