gitlab-duo-acp

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 2 Imported by: 0

README

gitlab-duo-acp

An Agent Client Protocol (ACP) agent that provides access to GitLab Duo AI features for compatible code editors.

Overview

[!WARNING] This is an unofficial project. It is not endorsed or supported by GitLab Inc. and is not recommended for use in production environments. For official editor integration with GitLab Duo, see GitLab's gitlab-lsp project.

This project implements an ACP agent that bridges GitLab Duo AI capabilities to any ACP-compatible client (code editors, IDEs, etc.). The agent communicates over stdio using JSON-RPC, following the ACP specification.

What's Supported
  • Chatting with Duo, with workflow creation
  • Reading files within the project without confirmation
  • Writing and updating files through the ACP-client.
What's Planned
  • #1+
  • #3+
  • #4+
  • #5+
  • #6+
  • #7+
  • #8+
  • #9+

Have a feature request? Feel free to create an issue in the issue tracker.

Installation

brew tap reprazent/gitlab-duo-acp
brew install gitlab-duo-acp
Go Install
go install gitlab.com/reprazent/gitlab-duo-acp@latest
From Source
git clone https://gitlab.com/reprazent/gitlab-duo-acp.git
cd gitlab-duo-acp
go build -o gitlab-duo-acp .

Configuration

Configuration can be provided via a YAML file and/or environment variables. Environment variables take precedence over file values.

Environment Variables
Variable Description Default
GITLAB_URL GitLab instance URL https://gitlab.com
GITLAB_AUTH_TOKEN GitLab personal access token (none)
Config File

Default location: ~/.config/gitlab-duo-acp/config.yml

# GitLab instance URL
gitlab_url: "https://gitlab.example.com"

# GitLab personal access token
gitlab_auth_token: "glpat-xxxxxxxxxxxxxxxxxxxx"
CLI Flags
Flag Description
--config Path to config file (overrides default location)
--debug Enable debug logging

Usage

Running the Agent
# Using default config location
gitlab-duo-acp start

# Using custom config file
gitlab-duo-acp start --config /path/to/config.yml

# Using environment variables
GITLAB_AUTH_TOKEN=glpat-xxx gitlab-duo-acp start

# With debug logging
gitlab-duo-acp start --debug
Configuring in Zed

Add the following to your Zed settings (~/.config/zed/settings.json):

{
  "agent_servers": {
    "GitLab Duo": {
      "command": "gitlab-duo-acp start",
      "type": "custom",
      "env": {
        "GITLAB_AUTH_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Tip: Zed passes on environment variables from its parent process. For better security, consider loading GITLAB_AUTH_TOKEN from a secrets manager (like 1Password) when starting Zed, rather than storing it in the settings file.

Development

Building
go build -o gitlab-duo-acp .
Running Tests
go test ./...
Development Wrapper Script

For development with ACP clients like Zed, use the wrapper script that automatically builds and redirects logs:

./scripts/run-dev.sh [args...]

This script:

  • Automatically rebuilds the binary if source files have changed
  • Redirects stderr (logs) to tmp/log/gitlab-duo-acp.log
  • Keeps stdin/stdout connected for ACP protocol communication
  • Enables debug logging by default

Zed Development Configuration (~/.config/zed/settings.json):

{
  "agent_servers": {
    "GitLab Duo (Dev)": {
      "command": "/path/to/gitlab-duo-acp/scripts/run-dev.sh",
      "type": "custom",
      "env": {
        "GITLAB_AUTH_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

To tail the logs in another terminal:

tail -f tmp/log/gitlab-duo-acp.log
Connecting from an ACP Client

The agent communicates over stdio:

  • stdin: Receives JSON-RPC messages from the client
  • stdout: Sends JSON-RPC messages to the client
  • stderr: Logs (not part of ACP protocol)

Example with the acp-go-sdk example client:

go run github.com/coder/acp-go-sdk/example/client gitlab-duo-acp start
Project Structure
gitlab-duo-acp/
├── main.go              # Entry point
├── cmd/                 # CLI commands (root, start, version)
├── agent/               # ACP Agent implementation
├── config/              # Configuration loading
├── duo/                 # GitLab Duo API client (workflow, websocket, messages, checkpoint)
├── git/                 # Git repository utilities
├── version/             # Version information (set via ldflags at build time)
├── scripts/             # Development scripts
├── .gitlab/             # GitLab-specific configuration
├── go.mod
├── go.sum
└── README.md

Architecture

┌─────────────────┐     stdio      ┌──────────────────┐     API      ┌─────────────┐
│   ACP Client    │◄──────────────►│  gitlab-duo-acp  │◄────────────►│ GitLab Duo  │
│ (Editor/IDE)    │   JSON-RPC     │     (Agent)      │              │     API     │
└─────────────────┘                └──────────────────┘              └─────────────┘

License

See LICENSE file.

References

Documentation

Overview

gitlab-duo-acp is an ACP (Agent Client Protocol) agent that provides access to GitLab Duo AI features for compatible code editors.

Directories

Path Synopsis
Package agent provides the ACP agent implementation for GitLab Duo.
Package agent provides the ACP agent implementation for GitLab Duo.
Package cmd provides the command-line interface for gitlab-duo-acp.
Package cmd provides the command-line interface for gitlab-duo-acp.
Package config provides configuration loading for gitlab-duo-acp.
Package config provides configuration loading for gitlab-duo-acp.
Package duo provides a client for interacting with GitLab Duo API.
Package duo provides a client for interacting with GitLab Duo API.
Package git provides utilities for interacting with git repositories.
Package git provides utilities for interacting with git repositories.
Package version provides build version information for gitlab-duo-acp.
Package version provides build version information for gitlab-duo-acp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL