Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ For complete style guidance, see our [style guide](https://docs.github.com/en/co

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

**Make changes in a codespace:** See "[Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md)" for documentation-specific setup.
**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.

**Make changes locally:**
1. Fork the repository (see [official forking guide](https://docs.github.com/en/contributing))
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/sync-llms-txt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,17 @@ jobs:
git config user.name "docs-bot"
git config user.email "77750099+docs-bot@users.noreply.github.com"
git add data/llms-txt/docs.md
git commit -m "Update data/llms-txt/docs.md from popularity data"
git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
# diff_docs compares against main, but the sync branch may already
# exist with this exact content (open PR from a prior run). In that
# case there is nothing new to stage, and `git commit` would exit 1
# and fail the whole workflow. Skip the commit and push when the
# branch is already up to date.
if git diff --cached --quiet; then
echo "Sync branch already has the latest generated docs.md; nothing to commit."
else
git commit -m "Update data/llms-txt/docs.md from popularity data"
git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
fi

- name: Create or update docs-internal PR
if: steps.diff_docs.outputs.changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion assets/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
The `/assets/images` directory holds all the site's images.


See [imaging and versioning](https://github.com/github/docs/blob/main/contributing/images-and-versioning.md) from the contributing docs for more information.
See [Creating screenshots](https://docs.github.com/en/contributing/writing-for-github-docs/creating-screenshots) from the contributing docs for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: About extensions for {% data variables.copilot.copilot_cli %}
shortTitle: CLI extensions
allowTitleToDifferFromFilename: true
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.'
product: '{% data reusables.gated-features.copilot-cli %}'
versions:
feature: copilot
contentType: concepts
category:
- Learn about Copilot # Copilot discovery page
- Learn about Copilot CLI # Copilot CLI bespoke page
docsTeamMetrics:
- copilot-cli
---

{% data reusables.copilot.copilot-cli.cli-extensions-experimental %}

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:

* **Tools** that {% data variables.product.prodname_copilot_short %} can call while it works on your behalf.
* **Slash commands** that you run yourself.

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.

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).

> [!WARNING]
> 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.

## How extensions are discovered

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.

The name of the subdirectory becomes the name of the extension.

| Source | Location | Availability |
| --- | --- | --- |
| **Project** | `.github/extensions/NAME/` in the current repository | Available to anyone working in that repository. |
| **User** | `~/.copilot/extensions/NAME/` | Available in all your CLI sessions, in every directory. |
| **Plugin** | An installed plugin | Available wherever the plugin is enabled. |

## Choosing where an extension lives

Where you put the extension directory determines who can use it:

* 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.
* 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.

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.

## Enabling extensions

Extensions are currently an experimental feature, so you need to turn on experimental features. You can do this by doing either of the following:

* Start the CLI with the `--experimental` flag.
* Run the `/experimental on` slash command inside an interactive session.

## Changing how the CLI handles extensions

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:

* **Load & Augment** (the default)—the CLI runs your extensions, _and_ {% data variables.product.prodname_copilot_short %} can manage them.
* **Load Only**—the CLI runs your extensions, but {% data variables.product.prodname_copilot_short %} cannot manage them.
* **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.

Any change you make takes effect immediately in the current session:

* Switching **to Disabled** stops any extensions that are currently running. Their processes are shut down and their tools are no longer available.
* Switching **from Disabled** to either of the other settings starts your extensions.
* Switching between **Load Only** and **Load & Augment** just changes whether {% data variables.product.prodname_copilot_short %} can manage your extensions.

### What "managing extensions" means

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:

* **List** the extensions it has discovered and see their status.
* **Inspect** an extension, including a tail of its log file, to help diagnose one that has failed or is misbehaving.
* **Scaffold** a new extension—generate a starter `extension.mjs` file for you to build on.
* **Reload** extensions, so that code it (or you) has just written takes effect without restarting the session.

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.

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.

## Extensions compared with plugins

Both extensions and plugins add functionality to {% data variables.copilot.copilot_cli_short %}, but they serve different purposes:

* An **extension** is a single JavaScript module that you write to add tools and slash commands, backed by code that runs in your session.
* A **plugin** is an installable package that bundles reusable components—such as agents, skills, hooks, and integrations—and can be distributed through a marketplace.

For more information about plugins, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-cli-plugins).

## Further reading

* [AUTOTITLE](/copilot/tutorials/create-an-extension)
* [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-command-reference#slash-commands-in-the-interactive-interface)
* [AUTOTITLE](/copilot/how-tos/copilot-cli)
3 changes: 2 additions & 1 deletion content/copilot/concepts/agents/copilot-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ children:
- /comparing-cli-features
- /copilot-cli-in-github-actions
- /cancel-and-roll-back
- /context-management
- /about-remote-control
- /about-custom-agents
- /autopilot
Expand All @@ -18,7 +19,7 @@ children:
- /chronicle
- /rubber-duck
- /lsp-servers
- /context-management
- /about-cli-extensions
- /tool-search
contentType: concepts
docsTeamMetrics:
Expand Down
1 change: 1 addition & 0 deletions content/copilot/get-started/enterprise-ai-governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ journeyTracks:
- href: '/copilot/tutorials/roll-out-at-scale/govern-at-scale/maintain-codebase-standards'
- href: '/copilot/how-tos/administer-copilot/manage-for-enterprise/review-audit-logs'
- href: '/copilot/concepts/preparing-for-new-features-and-models'
- href: '/copilot/tutorials/roll-out-at-scale/govern-at-scale/pilot-a-feature-or-model'
- id: 'adopting_agents'
title: 'Adopting agents'
description: 'Roll out agentic features within secure guardrails.'
Expand Down
1 change: 1 addition & 0 deletions content/copilot/how-tos/copilot-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ children:
- /content/copilot/concepts/agents/copilot-cli/lsp-servers
- /content/copilot/concepts/agents/copilot-cli/research
- /content/copilot/concepts/agents/copilot-cli/rubber-duck
- /content/copilot/concepts/agents/copilot-cli/about-cli-extensions
- /content/copilot/reference/copilot-cli-reference/acp-server
- /content/copilot/reference/copilot-cli-reference/cli-command-reference
- /content/copilot/reference/copilot-cli-reference/cli-plugin-reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@

## Create an enterprise account

> [!IMPORTANT]
> 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.
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.

Check failure on line 25 in content/copilot/how-tos/copilot-on-github/set-up-copilot/enable-copilot/set-up-a-dedicated-enterprise-for-copilot-business.md

View workflow job for this annotation

GitHub Actions / lint-content

CTA URLs must conform to the schema

Missing required parameter: ref_style.

Check failure on line 25 in content/copilot/how-tos/copilot-on-github/set-up-copilot/enable-copilot/set-up-a-dedicated-enterprise-for-copilot-business.md

View workflow job for this annotation

GitHub Actions / lint-content

CTA URLs must conform to the schema

Missing required parameter: ref_style.

Start a trial of {% data variables.product.prodname_ghe_cloud %} to create your enterprise account.

<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>

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 %}.

## Add users to your enterprise

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.
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.

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 %}.
### Enterprise with personal accounts

Invite users directly to your enterprise. For detailed steps, see [AUTOTITLE](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/invite-users-directly).
Expand All @@ -58,7 +54,6 @@

1. Ensure you are signed in as an enterprise administrator on {% data variables.product.github %}.
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).
1. A member of the Sales team will work with you to set up {% data variables.product.prodname_copilot_short %} for your enterprise.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ When diff mode is open (entered via `/diff`):
| `/resume [SESSION-ID]`, `/continue [SESSION-ID]` | Switch to a different session by choosing from a list (optionally specify a session ID). |
| `/review [PROMPT]` | Run the code review agent to analyze changes. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/agentic-code-review). |
| `/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). |
| `/sandbox [enable\|disable]` | Configure shell command sandboxing. |
| `/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. |
| `/search [QUERY]`, `/find [QUERY]` | Search the conversation timeline. {% data reusables.copilot.experimental %} |
| `/security-review [PROMPT]` | Run the security review agent to analyze changes for vulnerabilities. |
| `/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`. |
Expand Down
Loading
Loading