> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LaunchDarkly extension for GitHub Copilot

> This topic links to documentation on using the LaunchDarkly extension for GitHub Copilot on Visual Studio Marketplace.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

<Note title="The LaunchDarkly extension for GitHub Copilot is available to customers on select plans">
  The LaunchDarkly extension for GitHub Copilot on Visual Studio Marketplace is available only in conjunction with the LaunchDarkly VSCode extension. The VSCode extension is only available to customers on select plans. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).
</Note>

## Overview

The LaunchDarkly extension for GitHub Copilot on Visual Studio Marketplace provides GitHub Copilot functionality for managing the lifecycle of a feature flag from within [Visual Studio Code (VSCode)](/home/getting-started/vscode).

To enable `@LaunchDarkly` commands in GitHub Copilot, confirm that you are using the latest version of VSCode and that you are using the GitHub Copilot Chat extension for VSCode.

In your GitHub Copilot prompt, you can use the following `@LaunchDarkly` commands:

\| Command

\| Definition

| Example |
| - |

\| ---

\| --- |
\| <code>@LaunchDarkly /createFlag</code>

\| GitHub Copilot creates a LaunchDarkly feature flag based on your prompt

\| <code>@LaunchDarkly /createFlag I need a new feature flag for the account-migration project</code> |
\| <code>@LaunchDarkly /explain</code>

\| GitHub Copilot asks you to select a flag, and then provides a summary of the flag, its variations, and its [release pipeline](/home/releases/release-pipelines) status. If the flag is ready for cleanup, the summary will mention that, and the **Problems** tab will include a message that the flag is ready for cleanup.

\| <code>@LaunchDarkly /explain</code> |
\| <code>@LaunchDarkly /cleanup</code>

\| GitHub Copilot asks you to select a flag, and then determines whether or not the selected flag is ready for cleanup. It provides details on each criteria that must be met. To learn more about when a flag can be archived, read [Archiving flags](/home/flags/archive) .

\| <code>@LaunchDarkly /cleanup</code> |

## Flag Actions command

Use the `LaunchDarkly: Flag Actions` command to bring up a menu of options that you can choose from to interact with your feature flags.

## Dashboard Shortcuts command

Use the `LaunchDarkly: Dashboard Shortcuts` command to open a [list of your shortcuts](https://launchdarkly.com/docs/home/flags/list#save-shortcuts-to-filtered-flags-lists) for the configured project.

## Code references in the VSCode extension

The LaunchDarkly VSCode extension supports code references. If you use code references, configuring aliases makes the informational hover available wherever an alias appears in your code. Aliases appear under the flag entry in the Explorer view. To learn more, read [Find flag aliases](/home/flags/code-references#find-flag-aliases).

Flag searches across the workspace also include flag references.

## Quick targeting in the VSCode extension

The LaunchDarkly VSCode extension supports quick targeting. This is useful if you use a consistent targeting context key or rule when coding with feature flags.

It will look for a yaml file, `rules.yaml`, located in the `.launchdarkly` subdirectory of your home directory. The full path is: `~/.launchdarkly/rules.yaml`.Here's an example:

<CodeGroup>
  ```yaml title="Example Targeting YAML" theme={null}
      targets:
        - name: Target Me in Context
          values: example-context-key
        - name: Target Me in Account Context
          contextKind: account
          values: account-1234
      rules:
        - name: My Test Organization
          clauses:
            - contextKind: user
              attribute: organization
              op: in
              negate: false
              values:
                - org-1234
  ```
</CodeGroup>

### Targets

You can define targets with the following attributes:

* Name: A descriptive name for the target.
* ContextKind (Optional): The kind of context for account-related targeting, for example, `account`. If not provided, defaults to `user`.
* Values: An array of specific keys or identifiers for targeting.

### Rules

Rules are conditions set for targeting. Each rule has:

* Name: A descriptive name for the rule.
* Clauses: Conditions under which this rule applies. Each clause can specify:
  * ContextKind: The context kind, such as `user`, to which the clause applies.
  * Attribute: The specific attribute within the context to evaluate, such as `organization`.
  * Operation (op): Defines the operation to apply for the clause's condition. Supported operations include: `in`, `endsWith`, `startsWith`, `matches`, `contains`, `lessThan`, `semVerEqual`, `semVerLessThan`, `semVerGreaterThan`, `before`, and `after`.
  * Negate: A boolean indicating if the condition should be inverted. If true, the rule applies when the condition is not met.
  * Values: An array of values to compare the attribute against based on the operation.

## Telemetry

LaunchDarkly collects information about your use of this extension in accordance with the [LaunchDarkly privacy policy](https://launchdarkly.com/policies/privacy/).

You can opt out at any time in the extension settings by navigating to `LaunchDarkly > Enable Telemetry` and unchecking the box. We also respect the [VSCode Telemetry setting](https://code.visualstudio.com/docs/configure/telemetry#_disable-telemetry-reporting).
