@gitlab/duo-cli 8.41.0 → 8.43.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 CHANGED
@@ -1,18 +1,20 @@
1
- # GitLab CLI Development
1
+ # GitLab Duo CLI
2
2
 
3
- GitLab Duo CLI (`@gitlab/duo-cli`) - GitLab Duo for your command line.
3
+ GitLab Duo for your command line. An AI-powered CLI tool that brings GitLab Duo's capabilities to your terminal.
4
4
 
5
- ## Installing
5
+ ## Installation
6
6
 
7
- The Duo CLI can be installed from the npm registry using `npm`, `bun`, `yarn` etc:
7
+ Install globally using npm:
8
8
 
9
9
  ```shell
10
10
  npm install -g @gitlab/duo-cli
11
11
  ```
12
12
 
13
- After installing, the CLI can be run with `duo`.
13
+ After installation, the CLI can be run using the `duo` command.
14
14
 
15
- Alternatively, the CLI can be directly run without an explicit install:
15
+ ### Alternative: Run without installing
16
+
17
+ You can run the CLI directly without installing it globally:
16
18
 
17
19
  ```shell
18
20
  npx -y @gitlab/duo-cli
@@ -20,71 +22,104 @@ npx -y @gitlab/duo-cli
20
22
 
21
23
  ### Updating
22
24
 
23
- The CLI can be updated the same way you installed it, specifying `@latest` to ensure the latest version is installed:
25
+ To update to the latest version:
24
26
 
25
27
  ```shell
26
28
  npm install -g @gitlab/duo-cli@latest
27
29
  ```
28
30
 
29
- ### Usage
31
+ ## Usage
30
32
 
31
- Run `duo` to start the CLI terminal UI. You will be prompted for an [authentication token](https://docs.gitlab.com/user/profile/personal_access_tokens/) on first run. Your token must have the `api` scope granted.
33
+ ### Interactive Mode (TUI)
32
34
 
33
- The CLI help text can be displayed with the `--help` flag, globally or per-command for more details:
35
+ Start the interactive terminal UI:
34
36
 
35
37
  ```shell
36
- duo --help
37
- duo run --help
38
+ duo
38
39
  ```
39
40
 
40
- This will provide details of all available commands and flags.
41
+ On first run, you'll be prompted for a [GitLab authentication token](https://docs.gitlab.com/user/profile/personal_access_tokens/). Your token must have the `api` scope granted.
41
42
 
42
- ## Contributing
43
+ ### Headless Mode
44
+
45
+ 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"`
43
46
 
44
- ### Prerequisites
47
+ Note that each time you execute `duo run` it will start a fresh workflow, so Duo won't know what the previous conversation or context was.
45
48
 
46
- This CLI project is built using [bun](https://bun.sh/). Make sure you have the following installed:
49
+ Run a workflow in non-interactive mode:
50
+
51
+ ```shell
52
+ duo run --goal "Your goal or prompt here"
53
+ ```
47
54
 
48
- 1. Install mise and bun: `mise install`
49
- 1. Install dependencies using bun package manager: `npm run install:bun`
55
+ Additional options for headless mode:
50
56
 
51
- in order to continue working with the language server, install dependencies with npm package manager: `npm run install:npm`
57
+ - `--ai-context-items <contextItems>` - JSON encoded array of additional context items
58
+ - `--existing-session-id <sessionId>` - Resume an existing session
52
59
 
53
- ### Compilation
60
+ ### Configuration
54
61
 
55
- To create standalone executables for distribution, use the compilation script:
62
+ Edit the CLI configuration:
56
63
 
57
64
  ```shell
58
- npm run build:binary
65
+ duo config edit
59
66
  ```
60
67
 
61
- This will create cross-platform executables in the `./bin` directory:
68
+ ### Log Management
62
69
 
63
- - `duo-linux-x64` - Linux 64-bit
64
- - `duo-linux-arm64` - Linux ARM64
65
- - `duo-darwin-x64` - macOS Intel
66
- - `duo-darwin-arm64` - macOS Apple Silicon
67
- - `duo-windows-x64.exe` - Windows 64-bit
70
+ View and manage logs:
68
71
 
69
- #### Development
72
+ ```shell
73
+ duo log last # Open the last log file
74
+ duo log list # List all log files
75
+ duo log tail [args...] # Tail the last log file (supports standard tail arguments)
76
+ duo log clear # Remove all existing log files
77
+ ```
70
78
 
71
- There are a few handy commands available for development:
79
+ ### Global Options
72
80
 
73
- - `dev:watch` - starts the application with bun in watch mode. The application will be automatically restarted if code changes are made
74
- - `dev:watch-tools` - as above, but react devtools will be started alongside connected to the application
75
- - `start` - compiles the application to js and starts it. This is exactly the version of the app that will be packaged to the npm package. It is recommended to test your changes with it before creating an MR
81
+ ### Duo command
76
82
 
77
- When using the `package.json` scripts, use `--` to separate flags between npm/CLI. For example:
83
+ - `-C, --cwd <path>` - Change working directory
84
+ - `--log-level <level>` - Set logging level (debug, info, warn, error)
78
85
 
79
- ```shell
80
- cd packages/cli
81
- npm run dev:watch -- --cwd /foo/bar # this passes through --cwd to the CLI, rather than npm itself getting the flag
82
- ```
86
+ ### Duo run command
87
+
88
+ - `--gitlab-base-url <url>` - Base URL of GitLab instance (default: `https://gitlab.com`)
89
+ - `--gitlab-auth-token <token>` - Authentication token for GitLab instance
90
+
91
+ ### Other options
83
92
 
84
- ### Troubleshooting
93
+ - `-v, --version` - Display version number
94
+ - `--help` - Display help information
85
95
 
86
- If you have issues with Bun not resolving installed node_modules in the packages, you may need to clear node_modules folders and reinstall:
96
+ #### MCP
97
+
98
+ 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)
99
+
100
+ ### Environment Variables
101
+
102
+ You can also configure the CLI using environment variables:
103
+
104
+ - `GITLAB_URL` or `GITLAB_BASE_URL` - GitLab instance URL
105
+ - `GITLAB_TOKEN` or `GITLAB_OAUTH_TOKEN` - Authentication token
106
+ - `LOG_LEVEL` - Logging level
107
+ - `DUO_WORKFLOW_GIT_HTTP_USER` - Git HTTP authentication username
108
+ - `DUO_WORKFLOW_GIT_HTTP_PASSWORD` - Git HTTP authentication password
109
+
110
+ ### Getting Help
111
+
112
+ Display help for any command:
87
113
 
88
114
  ```shell
89
- npm run install:bun
115
+ duo --help # Global help
116
+ duo run --help # Help for a specific command
90
117
  ```
118
+
119
+ ## Contributing
120
+
121
+ See [Development Guide](./docs/development.md) for information on contributing to this project.
122
+
123
+ ## License
124
+
125
+ See the [License](../../LICENSE) for details.