@gitlab/duo-cli 8.62.1 → 8.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -91
- package/dist/index.js +597 -600
- package/dist/index.js.map +44 -40
- package/dist/version-guard.cjs +17 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,122 +1,60 @@
|
|
|
1
1
|
# GitLab Duo CLI (experimental)
|
|
2
2
|
|
|
3
|
-
GitLab Duo for your command line. An AI-powered CLI tool that brings
|
|
3
|
+
GitLab Duo for your command line. An AI-powered CLI tool that brings
|
|
4
|
+
[GitLab Duo Chat (Agentic)](https://docs.gitlab.com/user/gitlab_duo_chat/agentic_chat/) to your
|
|
5
|
+
terminal.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
The GitLab Duo CLI can help you:
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
npm install -g @gitlab/duo-cli
|
|
13
|
-
```
|
|
9
|
+
- Understand your codebase structure, cross-file functionality, and individual code snippets.
|
|
10
|
+
- Build, modify, refactor, and modernize code.
|
|
11
|
+
- Troubleshoot errors and fix code issues.
|
|
12
|
+
- Automate CI/CD configuration, troubleshoot pipeline errors, and optimize pipelines.
|
|
13
|
+
- Perform multi-step development tasks autonomously.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This tool is [experimental](https://docs.gitlab.com/policy/development_stages_support/#experiment)
|
|
16
|
+
and some features might not work as expected.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
You can run the CLI directly without installing it globally:
|
|
18
|
+
## Installation
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
npx -y @gitlab/duo-cli
|
|
23
|
-
```
|
|
20
|
+
Prerequisites:
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
- Node.js 22 or later.
|
|
23
|
+
- A [personal access token](https://docs.gitlab.com/user/profile/personal_access_tokens/) with `api`
|
|
24
|
+
scope.
|
|
26
25
|
|
|
27
|
-
To
|
|
26
|
+
To install the GitLab Duo CLI globally, run:
|
|
28
27
|
|
|
29
28
|
```shell
|
|
30
|
-
npm install -g @gitlab/duo-cli
|
|
29
|
+
npm install -g @gitlab/duo-cli
|
|
31
30
|
```
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### Interactive Mode (TUI)
|
|
36
|
-
|
|
37
|
-
Start the interactive terminal UI:
|
|
32
|
+
After installation, start the GitLab Duo CLI in interactive mode:
|
|
38
33
|
|
|
39
34
|
```shell
|
|
40
35
|
duo
|
|
41
36
|
```
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Headless Mode
|
|
46
|
-
|
|
47
|
-
The run command is ideal for non-interactive CI environments or integration with scripts and automated workflows. For example, you can run an eslint command and pipe any errors to Duo: `duo run --goal "Fix these errors: $eslint_output"`
|
|
48
|
-
|
|
49
|
-
Note that each time you execute `duo run` it will start a fresh workflow, so GitLab Duo won't know what the previous conversation or context was.
|
|
50
|
-
|
|
51
|
-
Run a workflow in non-interactive mode:
|
|
38
|
+
Alternatively, you can run the GitLab Duo CLI without installing:
|
|
52
39
|
|
|
53
40
|
```shell
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Additional options for headless mode:
|
|
58
|
-
|
|
59
|
-
- `--ai-context-items <contextItems>` - JSON encoded array of additional context items
|
|
60
|
-
- `--existing-session-id <sessionId>` - Resume an existing session
|
|
61
|
-
|
|
62
|
-
### Configuration
|
|
63
|
-
|
|
64
|
-
Edit the CLI configuration:
|
|
65
|
-
|
|
66
|
-
```shell
|
|
67
|
-
duo config edit
|
|
41
|
+
npx -y @gitlab/duo-cli
|
|
68
42
|
```
|
|
69
43
|
|
|
70
|
-
|
|
44
|
+
To run a workflow in headless mode, use the command `duo run`:
|
|
71
45
|
|
|
72
|
-
|
|
46
|
+
> [!warning]
|
|
47
|
+
> Headless mode bypasses manual tool approval. Use this mode with caution and in a controlled
|
|
48
|
+
> sandbox environment.
|
|
73
49
|
|
|
74
50
|
```shell
|
|
75
|
-
duo
|
|
76
|
-
duo log list # List all log files
|
|
77
|
-
duo log tail [args...] # Tail the last log file (supports standard tail arguments)
|
|
78
|
-
duo log clear # Remove all existing log files
|
|
51
|
+
duo run --goal "Your goal or prompt here"
|
|
79
52
|
```
|
|
80
53
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### `duo` command
|
|
84
|
-
|
|
85
|
-
- `-C, --cwd <path>` - Change working directory
|
|
86
|
-
- `--log-level <level>` - Set logging level (debug, info, warn, error)
|
|
87
|
-
|
|
88
|
-
### `duo run` command
|
|
89
|
-
|
|
90
|
-
- `--gitlab-base-url <url>` - Base URL of GitLab instance (default: `https://gitlab.com`)
|
|
91
|
-
- `--gitlab-auth-token <token>` - Authentication token for GitLab instance
|
|
92
|
-
|
|
93
|
-
### Other options
|
|
54
|
+
## Documentation
|
|
94
55
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
#### MCP
|
|
99
|
-
|
|
100
|
-
The GitLab Duo CLI supports connecting to local or remote MCP servers using the same MCP configuration as the GitLab IDE extensions. Configuration instructions can be found at [MCP Documentation](https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_clients/#configure-mcp-servers)
|
|
101
|
-
|
|
102
|
-
### Environment Variables
|
|
103
|
-
|
|
104
|
-
You can also configure the CLI using environment variables:
|
|
105
|
-
|
|
106
|
-
- `GITLAB_URL` or `GITLAB_BASE_URL` - GitLab instance URL
|
|
107
|
-
- `GITLAB_TOKEN` or `GITLAB_OAUTH_TOKEN` - Authentication token
|
|
108
|
-
- `LOG_LEVEL` - Logging level
|
|
109
|
-
- `DUO_WORKFLOW_GIT_HTTP_USER` - Git HTTP authentication username
|
|
110
|
-
- `DUO_WORKFLOW_GIT_HTTP_PASSWORD` - Git HTTP authentication password
|
|
111
|
-
|
|
112
|
-
### Getting Help
|
|
113
|
-
|
|
114
|
-
Display help for any command:
|
|
115
|
-
|
|
116
|
-
```shell
|
|
117
|
-
duo --help # Global help
|
|
118
|
-
duo run --help # Help for a specific command
|
|
119
|
-
```
|
|
56
|
+
For detailed setup, usage, troubleshooting, and configuration instructions, see the
|
|
57
|
+
[GitLab Duo CLI documentation](https://docs.gitlab.com/user/gitlab_duo_cli/).
|
|
120
58
|
|
|
121
59
|
## Contributing
|
|
122
60
|
|