GitLabgitlab-org

cli

main
ply8 git calls31 ms99 KiB6 cachedprotocol v2
107 lines3.7 KiBRaw

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 "<prompt>" 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:

If you are on GitLab 18.11 to 19.1, you can use the GitLab Duo CLI by turning 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.

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

1---
2title: '`glab duo cli`'
3stage: AI Clients
4group: Developer Clients
5info: To determine the technical writer assigned to the Stage/Group associated with this page, see <https://handbook.gitlab.com/handbook/marketing/product-and-technical-marketing/technical-writing/#assignments>
6---
8<!--
9This documentation is auto generated by a script.
10Please do not edit this file directly. Run `make gen-docs` instead.
11-->
13Run the GitLab Duo CLI.
15## Synopsis
17Run the GitLab Duo CLI (`duo`) through `glab`.
19The 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.
21The GitLab Duo CLI runs in two modes:
23- Interactive (default): `glab duo cli` opens a session for multiple prompts, with build and plan modes.
24- Headless: `glab duo cli run --goal "<prompt>"` runs a single prompt and exits. For use in runners, scripts, and automated workflows.
26When you use the GitLab Duo CLI through `glab`, `glab` handles authentication for you. You authenticate only once.
28Prerequisites:
30- Use GitLab 19.2 or later.
31- Run `glab auth login` to authenticate.
32- Meet the [prerequisites for GitLab Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/#prerequisites).
33- 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.
34- 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.
36If 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).
38Configuration options:
40- `duo_cli_auto_run`: Skip the run confirmation prompt.
41- `duo_cli_auto_download`: Skip the download confirmation prompt.
43Except 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`.
45For more information, see the [GitLab Duo CLI documentation](https://docs.gitlab.com/user/gitlab_duo_cli/).
47```plaintext
48glab duo cli [command] [flags]
49```
51## Examples
53```console
54# Start an interactive GitLab Duo CLI session
55glab duo cli
57# Use the GitLab Duo CLI in headless mode with a single prompt
58glab duo cli run --goal "Fix the failing tests in this project"
60# Pass any command or flag through to the GitLab Duo CLI binary (for example: model, version, run)
61glab duo cli <command>
62glab duo cli --model claude_sonnet_4_6
64# Show GitLab CLI help content
65glab duo cli --help
67# Show GitLab Duo CLI help content, including commands and flags
68glab duo cli help
70# Run without prompts (for use in scripts and non-interactive environments)
71glab duo cli --yes
73# Install the GitLab Duo CLI binary
74glab duo cli --install
76# Install the GitLab Duo CLI binary without prompts
77glab duo cli --install --yes
79# Check for and install updates
80glab duo cli update
81```
83## Environment variables
85```plaintext
86- `GLAB_DUO_CLI_BINARY_PATH`: Use a local binary instead of the managed one.
87 Skips download, version checks, and updates. Can also be set through the
88 `duo_cli_binary_path` configuration key.
89```
91## Options
93```plaintext
94 --install Install the GitLab Duo CLI binary without running it.
95 --update Check for and install updates to the binary. Same as the update command.
96 -y, --yes Skip confirmation prompts.
97```
99## Options inherited from parent commands
101```plaintext
102 -h, --help Show help for this command.
103```
105## Subcommands
107- [`update`](update.md)
Diagnostics8 git calls · 31 ms
CallStatusSizeTime031 ms
discover200185 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=185
git.server.agent=git/2.56.g1891de4-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=185
git.pkt.payload.max=35
ls-refs20058 KiB3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=59849
git.response.cache=UPDATING
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=731
git.pkt.data=730
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=59849
git.pkt.payload.max=143
git.ls_refs.count=730
git.ls_refs.head=refs/heads/main
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=4273
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4273
git.pkt.payload.max=4173
git.sideband.band1.bytes=4173
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=11
git.pack.bytes=4173
git.fetch.wide.objects=11
git.fetch.wide.extra_bytes=3930
git.fetch.wide.blobs=0
fetchtree:0 · deepen 1020032 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=32926
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=22
git.pkt.data=20
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=32926
git.pkt.payload.max=32046
git.sideband.band1.bytes=32046
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=80
git.pack.bytes=32046
git.pack.ofs_delta=36
git.pack.ref_delta=0
git.pack.chain.max=2
git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91
git.pack.full=44
Open pack map
fetchtree:02001.7 KiB · hit1 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=1
git.response.bytes=1744
git.response.cache=HIT
git.response.duration_ms=1
git.fetch.filter=tree:0
git.fetch.wants=5e4007a5673eb3bf5d0d7f1a1463c3b2ca3fb3bd
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1744
git.pkt.payload.max=1717
git.sideband.band1.bytes=1717
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=1717
git.pack.trailer=3f1b9ccc7756e8941d6705e8187c87fd922113e6
Open pack map
fetchtree:0200139 B · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=139
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=1c037a2f8be759c9a35df4ecd602a27ed140cb85
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=139
git.pkt.payload.max=112
git.sideband.band1.bytes=112
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=112
git.pack.trailer=d796ca2a0f8998558595ca6362d21c03b1e7a9f0
Open pack map
fetchtree:0200139 B · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=139
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=e9793c7b3836b6e70de628a999c7aee8b875bf23
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=139
git.pkt.payload.max=112
git.sideband.band1.bytes=112
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=112
git.pack.trailer=c745210ca2901fbc73b8936d7082ca76bcf88925
Open pack map
fetch2001.6 KiB · hit16 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=16
git.response.bytes=1610
git.response.cache=HIT
git.response.duration_ms=16
git.fetch.wants=a5ba7fcdbd4f87a6e2ffc3602820621e365c0d51
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1610
git.pkt.payload.max=1583
git.sideband.band1.bytes=1583
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://gitlab.com/gitlab-org/cli
Ref
refs/heads/main
Commit
0dd7574dce9e385c5c30540e6c15657adc6bdce9
cf-ray
a5e1f8394d9cefe9
Request
fc98699e…
Protocol
v2 · sha1
Agent
git/2.56.g1891de4-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format