Published on: April 7, 2026

4 min read

GitLab Duo CLI: Agentic AI for the development lifecycle, now in the terminal

Developers who work outside the IDE and GitLab UI can access GitLab Duo Agent Platform in the terminal with built-in security controls and headless mode support.

Debugging a broken pipeline at the end of a sprint, or wiring AI into a CI/CD workflow that runs without anyone watching, is exactly where today's AI assistants fall short given their focus on coding – which is only a portion of the software lifecycle. They're built for interactive coding sessions, not automation across different stages of software development. GitLab Duo CLI, now in public beta, is built for both.

GitLab Duo CLI brings agentic AI powered by Duo Agent Platform to the terminal with full support for automated workflows, alongside an interactive chat mode when you need a human in the loop. This article highlights what Duo CLI does, how its two operating modes work, and the security model behind it.

How to install GitLab Duo CLI

If you already have GLab (the GitLab CLI) installed, enter:

      glab duo cli

    

Then follow the prompts.

If you don't have GLab yet, you can install it here or use GitLab Duo CLI as a standalone tool.

Why the terminal, and why now

The first wave of AI assistants for software development lived in the IDE, and focused solely on coding. That made sense when the job was autocomplete. But as AI agents start doing things across every stage of the software lifecycle, e.g. running tests, triggering pipelines, monitoring vulnerability scans, and more, the IDE may no longer be the only abstraction needed to get the job done.

The best developer tools are ones that work for both humans and machines. CLIs have had decades of design iteration toward that goal. They're composable. You can pipe output, chain commands, and drop them into scripts. They're debuggable: when something goes wrong, you run the same command yourself and see exactly what the agent saw. And they're transparent. No background processes, no initialization dance, no protocol to decode when things break.

Terminal interfaces are better for automation, scripting, and environment portability. IDE interfaces are better for interactive, context-rich development. GitLab Duo CLI is designed for the former, while Duo Agentic Chat in the IDE and UI covers the latter.

What GitLab Duo CLI can do

With GitLab Duo CLI, developers can build, modify, refactor, and modernize code — similar to other AI-powered coding assistants built for the terminal. But that’s not where they stop. Any agent and flow defined within GitLab Duo Agent Platform is accessible via Duo CLI, whether it is to automate CI/CD configuration and optimize pipelines, or to perform multi-step development tasks autonomously across the entire software development lifecycle.

GitLab Duo CLI runs in two modes:

  • Interactive mode, an editor-agnostic terminal chat experience with human-in-the-loop approval before any action is taken. Use it to understand codebase structure, create code, fix errors, or troubleshoot broken pipelines.
  • Headless mode, non-interactive, designed for runners, scripts, and automated workflows. Drop it into CI/CD and let it work without handholding.

AI with guardrails

Agentic AI that can take actions creates real security exposure. GitLab Duo CLI addresses this at the platform level, not as an afterthought:

  • Human-in-the-loop by default in interactive mode, so no action is taken without approval.
  • Prompt injection detection is built into the GitLab Duo Agent Platform, not bolted on.
  • Composite identity limits what the agent can access and makes every AI-driven action auditable.

GitLab Duo CLI also supports custom instruction files, e.g. chat-rules.md, AGENTS.md, and SKILL.md, that define which tasks, resources, context, knowledge, and actions your agents are permitted to take. This is the principle of least privilege applied to AI: Your agent does exactly what you've authorized, and nothing more.

Watch GitLab Duo CLI in action:

Use GitLab Duo CLI today

You can experience the benefits of GitLab Duo CLI by starting a free trial of GitLab Duo Agent Platform.

If you are already using GitLab in the free tier, you can sign up for GitLab Duo Agent Platform by following a few simple steps.

And if you are an existing subscriber to GitLab Premium or Ultimate, you can take advantage of GitLab Duo CLI by simply turning on Duo Agent Platform and start using the GitLab Credits that are included with your subscription.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum.

Share your feedback

Start building faster today

See what your team can do with the intelligent orchestration platform for DevSecOps.