diff --git a/doc/editor_extensions/gitlab_cli/_index.md b/doc/editor_extensions/gitlab_cli/_index.md index fcda02ac1e00b83b82b53f5adc083e08df6b3679..4ceb39aea54c5c271e1d61e9683c25c76a26456b 100644 --- a/doc/editor_extensions/gitlab_cli/_index.md +++ b/doc/editor_extensions/gitlab_cli/_index.md @@ -95,12 +95,16 @@ glab mr merge - Changed to require GitLab Duo add-on in GitLab 17.6 and later. - Changed to include Premium in GitLab 18.0. +- Authentication with third-party AI developer CLI tools [added]() in GitLab 18.4. {{< /history >}} -The GitLab CLI includes features powered by [GitLab Duo](../../user/gitlab_duo/_index.md). These include: +The GitLab CLI includes features powered by [GitLab Duo](../../user/gitlab_duo/_index.md): - [`glab duo ask`](https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/duo/ask.md) +- `glab duo ` + +### `glab duo ask` To ask questions about `git` commands while you work, type: @@ -109,6 +113,18 @@ To ask questions about `git` commands while you work, type: The `glab duo ask` command can help you remember a `git` command you forgot, or provide suggestions on how to run `git` commands to perform other tasks. +### `glab duo ` + +To use GitLab as an authentication provider to access third-party AI developer CLI tools, type: + +```plaintext +glab duo +``` + +Third-party AI developer CLI tools integrate AI assistance directly into your development workflow. + +For more information, see [use the GitLab CLI with third-party AI CLI tools](../../user/duo_agent_platform/duo_cli_third_party.md). + ## Install the CLI Installation instructions are available in the `glab` diff --git a/doc/user/duo_agent_platform/agent_assistant.md b/doc/user/duo_agent_platform/agent_assistant.md index 4e458c297180f7eab116e443fc3d53754f35c0bb..cccfb2d70b098e878720cbadc28d23d0b4add069 100644 --- a/doc/user/duo_agent_platform/agent_assistant.md +++ b/doc/user/duo_agent_platform/agent_assistant.md @@ -576,3 +576,7 @@ Prerequisites: is displayed. You can select **here** to see the pipeline in progress. 1. After the CLI agent has completed the task, you see a confirmation, and either a ready-to-merge change or an inline comment. + +## Related topics + +- [Use the GitLab CLI with third-party AI CLI tools](duo_cli_third_party.md) diff --git a/doc/user/duo_agent_platform/duo_cli_third_party.md b/doc/user/duo_agent_platform/duo_cli_third_party.md new file mode 100644 index 0000000000000000000000000000000000000000..7d691ab091e88233581ddab17524be51f96e1303 --- /dev/null +++ b/doc/user/duo_agent_platform/duo_cli_third_party.md @@ -0,0 +1,69 @@ +--- +stage: AI-powered +group: Agent Foundations +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +title: Use the GitLab CLI with third-party AI CLI tools +--- + +{{< details >}} + +- Tier: Ultimate +- Add-on: GitLab Duo Enterprise, GitLab Duo with Amazon Q +- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated +- Status: Experiment +- Available on [GitLab Duo with self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md): No + +{{< /details >}} + +{{< history >}} + +- [Introduced]() in GitLab 18.4 [with a flag](../../administration/feature_flags/_index.md) named `agent_platform_claude_code`. Disabled by default. + +{{< /history >}} + +Third-party AI developer command-line interface (CLI) tools integrate +AI assistance directly into your development workflow. +These tools help AI understand your codebase context and execute tasks +without you having to switch between different interfaces. + +You can use GitLab as an authentication provider to access +these tools directly through the GitLab.com AI gateway. +This method is an alternative to creating a +[CLI agent](agent_assistant.md) for a third-party integration. + +[Anthropic Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) has been tested +and is available as a third-party CLI tool. + +## Use third-party AI developer CLI tools + +Prerequisites: + +- Install the third-party tool on your local machine + (for example, [Anthropic Claude Code](https://docs.anthropic.com/en/docs/claude-code/setup)). +- [Create a personal access token](../profile/personal_access_tokens.md#create-a-personal-access-token) + with the following scopes: + - `api` + - `ai_features` + +To use third-party CLI tools: + +1. [Authenticate with GitLab](../../editor_extensions/gitlab_cli/_index.md#authenticate-with-gitlab): + + ```shell + glab auth login + ``` + + Enter your personal access token when prompted. + +1. Start the third-party CLI tool: + + ```shell + glab duo + ``` + + For example, to start Anthropic Claude Code, run `glab duo claude`. + +## Related topics + +- [GitLab Duo for the CLI](../../editor_extensions/gitlab_cli/_index.md#gitlab-duo-for-the-cli) +- [AI gateway](../../administration/gitlab_duo/gateway.md)