--- title: '`glab duo cli`' stage: AI Clients group: Developer Clients info: To determine the technical writer assigned to the Stage/Group associated with this page, see --- Run the GitLab Duo CLI. ## Synopsis Run the GitLab Duo CLI (`duo`) through `glab`. The GitLab Duo CLI brings the GitLab Duo Agent Platform to your terminal. Ask GitLab Duo questions about your codebase and use it to autonomously perform actions on your behalf. The GitLab Duo CLI runs in two modes: - Interactive (default): `glab duo cli` opens a session for multiple prompts, with build and plan modes. - Headless: `glab duo cli run --goal ""` runs a single prompt and exits. For use in runners, scripts, and automated workflows. When you use the GitLab Duo CLI through `glab`, `glab` handles authentication for you. You authenticate only once. Prerequisites: - Use GitLab 19.2 or later. - Run `glab auth login` to authenticate. - Meet the [prerequisites for GitLab Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/#prerequisites). - Set a [default GitLab Duo namespace](https://docs.gitlab.com/user/profile/preferences/#namespace-resolution-in-your-local-environment), or run the command in a project that has GitLab Duo access. - For GitLab Self-Managed and GitLab Dedicated on 19.2 or later, turn on [GitLab Duo CLI access](https://docs.gitlab.com/user/gitlab_duo_cli/#manage-gitlab-duo-cli-access). It is on by default. If you are on GitLab 18.11 to 19.1, you can use the GitLab Duo CLI by turning on [beta and experimental features](https://docs.gitlab.com/user/duo_agent_platform/turn_on_off/#turn-on-beta-and-experimental-features). Configuration options: - `duo_cli_auto_run`: Skip the run confirmation prompt. - `duo_cli_auto_download`: Skip the download confirmation prompt. Except for the `update` command, `glab` passes all other arguments and flags through to the GitLab Duo CLI binary. To see the GitLab Duo CLI commands and flags, run `glab duo cli help`. For more information, see the [GitLab Duo CLI documentation](https://docs.gitlab.com/user/gitlab_duo_cli/). ```plaintext glab duo cli [command] [flags] ``` ## Examples ```console # Start an interactive GitLab Duo CLI session glab duo cli # Use the GitLab Duo CLI in headless mode with a single prompt glab duo cli run --goal "Fix the failing tests in this project" # Pass any command or flag through to the GitLab Duo CLI binary (for example: model, version, run) glab duo cli glab duo cli --model claude_sonnet_4_6 # Show GitLab CLI help content glab duo cli --help # Show GitLab Duo CLI help content, including commands and flags glab duo cli help # Run without prompts (for use in scripts and non-interactive environments) glab duo cli --yes # Install the GitLab Duo CLI binary glab duo cli --install # Install the GitLab Duo CLI binary without prompts glab duo cli --install --yes # Check for and install updates glab duo cli update ``` ## Environment variables ```plaintext - `GLAB_DUO_CLI_BINARY_PATH`: Use a local binary instead of the managed one. Skips download, version checks, and updates. Can also be set through the `duo_cli_binary_path` configuration key. ``` ## Options ```plaintext --install Install the GitLab Duo CLI binary without running it. --update Check for and install updates to the binary. Same as the update command. -y, --yes Skip confirmation prompts. ``` ## Options inherited from parent commands ```plaintext -h, --help Show help for this command. ``` ## Subcommands - [`update`](update.md)