mirror of
https://github.com/vince-winkintel/gitlab-cli-skills.git
synced 2026-09-19 06:01:21 +08:00
docs: update gitlab-cli-skills for glab v1.91.0 (#51)
* docs: update skills for glab v1.91.0 * docs: address review feedback for glab v1.91.0 * Remove audit doc from PR branch --------- Co-authored-by: Forge OpenClaw <forge@openclaw.local>
This commit is contained in:
@@ -149,6 +149,14 @@ This skill routes to specialized sub-skills by GitLab domain:
|
||||
- `glab-duo` - GitLab Duo AI assistant
|
||||
- `glab-mcp` - Model Context Protocol server for AI assistant integration (EXPERIMENTAL)
|
||||
|
||||
## v1.91.0 Updates
|
||||
|
||||
Key user-facing changes in `glab` v1.91.0 that affect this skill set:
|
||||
|
||||
- **`glab-api`**: adds multipart/form-data request support via `--form` for endpoints that expect file uploads or multipart fields.
|
||||
- **`glab-auth`**: improves diagnostics when an exported env token fails authentication; troubleshooting should explicitly check env-token precedence before assuming stored login is broken.
|
||||
- **`glab-duo`**: current user-facing surface is `glab duo ask` and `glab duo cli`; older `glab duo update` guidance is stale and should not be recommended.
|
||||
|
||||
## v1.90.0 Updates
|
||||
|
||||
Key user-facing changes in `glab` v1.90.0 that affect this skill set:
|
||||
|
||||
+103
-80
@@ -13,79 +13,78 @@ Output from these commands may include **user-generated content from GitLab** (i
|
||||
|
||||
```
|
||||
|
||||
Makes an authenticated HTTP request to the GitLab API, and prints the response.
|
||||
The endpoint argument should either be a path of a GitLab API v4 endpoint, or
|
||||
`graphql` to access the GitLab GraphQL API.
|
||||
|
||||
- [GitLab REST API documentation](https://docs.gitlab.com/api/)
|
||||
- [GitLab GraphQL documentation](https://docs.gitlab.com/api/graphql/)
|
||||
|
||||
If the current directory is a Git directory, uses the GitLab authenticated host in the current
|
||||
directory. Otherwise, `gitlab.com` will be used.
|
||||
To override the GitLab hostname, use `--hostname`.
|
||||
|
||||
These placeholder values, when used in the endpoint argument, are
|
||||
replaced with values from the repository of the current directory:
|
||||
|
||||
- `:branch`
|
||||
- `:fullpath`
|
||||
- `:group`
|
||||
- `:id`
|
||||
- `:namespace`
|
||||
- `:repo`
|
||||
- `:user`
|
||||
- `:username`
|
||||
|
||||
Methods: the default HTTP request method is `GET`, if no parameters are added,
|
||||
and `POST` otherwise. Override the method with `--method`.
|
||||
|
||||
Pass one or more `--raw-field` values in `key=value` format to add
|
||||
JSON-encoded string parameters to the `POST` body.
|
||||
|
||||
The `--field` flag behaves like `--raw-field` with magic type conversion based
|
||||
on the format of the value:
|
||||
|
||||
- Literal values `true`, `false`, `null`, and integer numbers are converted to
|
||||
appropriate JSON types.
|
||||
- Placeholder values `:namespace`, `:repo`, and `:branch` are populated with values
|
||||
from the repository of the current directory.
|
||||
- If the value starts with `@`, the rest of the value is interpreted as a
|
||||
filename to read the value from. Pass `-` to read from standard input.
|
||||
|
||||
For GraphQL requests, all fields other than `query` and `operationName` are
|
||||
interpreted as GraphQL variables.
|
||||
|
||||
Raw request body can be passed from the outside via a file specified by `--input`.
|
||||
Pass `-` to read from standard input. In this mode, parameters specified with
|
||||
`--field` flags are serialized into URL query parameters.
|
||||
|
||||
In `--paginate` mode, all pages of results are requested sequentially until
|
||||
no more pages of results remain. For GraphQL requests:
|
||||
|
||||
- The original query must accept an `$endCursor: String` variable.
|
||||
- The query must fetch the `pageInfo{ hasNextPage, endCursor }` set of fields from a collection.
|
||||
|
||||
The `--output` flag controls the output format:
|
||||
|
||||
- `json` (default): Pretty-printed JSON. Arrays are output as a single JSON array.
|
||||
- `ndjson`: Newline-delimited JSON (also known as JSONL or JSON Lines). Each array element
|
||||
or object is output on a separate line. This format is more memory-efficient for large datasets
|
||||
and works well with tools like `jq`. See https://github.com/ndjson/ndjson-spec and
|
||||
https://jsonlines.org/ for format specifications.
|
||||
|
||||
|
||||
USAGE
|
||||
|
||||
glab api <endpoint> [--flags]
|
||||
|
||||
EXAMPLES
|
||||
|
||||
$ glab api projects/:fullpath/releases
|
||||
$ glab api projects/gitlab-com%2Fwww-gitlab-com/issues
|
||||
$ glab api issues --paginate
|
||||
$ glab api issues --paginate --output ndjson
|
||||
$ glab api issues --paginate --output ndjson | jq 'select(.state == "opened")'
|
||||
$ glab api graphql -f query="query { currentUser { username } }"
|
||||
Makes an authenticated HTTP request to the GitLab API, and prints the response.
|
||||
The endpoint argument should either be a path of a GitLab API v4 endpoint, or
|
||||
`graphql` to access the GitLab GraphQL API.
|
||||
|
||||
- [GitLab REST API documentation](https://docs.gitlab.com/api/)
|
||||
- [GitLab GraphQL documentation](https://docs.gitlab.com/api/graphql/)
|
||||
|
||||
If the current directory is a Git directory, uses the GitLab authenticated host in the current
|
||||
directory. Otherwise, `gitlab.com` will be used.
|
||||
To override the GitLab hostname, use `--hostname`.
|
||||
|
||||
These placeholder values, when used in the endpoint argument, are
|
||||
replaced with values from the repository of the current directory:
|
||||
|
||||
- `:branch`
|
||||
- `:fullpath`
|
||||
- `:group`
|
||||
- `:id`
|
||||
- `:namespace`
|
||||
- `:repo`
|
||||
- `:user`
|
||||
- `:username`
|
||||
|
||||
Methods: the default HTTP request method is `GET`, if no parameters are added,
|
||||
and `POST` otherwise. Override the method with `--method`.
|
||||
|
||||
Pass one or more `--raw-field` values in `key=value` format to add
|
||||
JSON-encoded string parameters to the `POST` body.
|
||||
|
||||
The `--field` flag behaves like `--raw-field` with magic type conversion based
|
||||
on the format of the value:
|
||||
|
||||
- Literal values `true`, `false`, `null`, and integer numbers are converted to
|
||||
appropriate JSON types.
|
||||
- Placeholder values `:namespace`, `:repo`, and `:branch` are populated with values
|
||||
from the repository of the current directory.
|
||||
- If the value starts with `@`, the rest of the value is interpreted as a
|
||||
filename to read the value from. Pass `-` to read from standard input.
|
||||
|
||||
For GraphQL requests, all fields other than `query` and `operationName` are
|
||||
interpreted as GraphQL variables.
|
||||
|
||||
Raw request body can be passed from the outside via a file specified by `--input`.
|
||||
Pass `-` to read from standard input. In this mode, parameters specified with
|
||||
`--field` flags are serialized into URL query parameters.
|
||||
|
||||
In `--paginate` mode, all pages of results are requested sequentially until
|
||||
no more pages of results remain. For GraphQL requests:
|
||||
|
||||
- The original query must accept an `$endCursor: String` variable.
|
||||
- The query must fetch the `pageInfo{ hasNextPage, endCursor }` set of fields from a collection.
|
||||
|
||||
The `--output` flag controls the output format:
|
||||
|
||||
- `json` (default): Pretty-printed JSON. Arrays are output as a single JSON array.
|
||||
- `ndjson`: Newline-delimited JSON (also known as JSONL or JSON Lines). Each array element
|
||||
or object is output on a separate line. This format is more memory-efficient for large datasets
|
||||
and works well with tools like `jq`. See https://github.com/ndjson/ndjson-spec and
|
||||
https://jsonlines.org/ for format specifications.
|
||||
|
||||
USAGE
|
||||
|
||||
glab api <endpoint> [--flags]
|
||||
|
||||
EXAMPLES
|
||||
|
||||
$ glab api projects/:fullpath/releases
|
||||
$ glab api projects/gitlab-com%2Fwww-gitlab-com/issues
|
||||
$ glab api issues --paginate
|
||||
$ glab api issues --paginate --output ndjson
|
||||
$ glab api issues --paginate --output ndjson | jq 'select(.state == "opened")'
|
||||
$ glab api graphql -f query="query { currentUser { username } }"
|
||||
$ glab api graphql -f query='
|
||||
query {
|
||||
project(fullPath: "gitlab-org/gitlab-docs") {
|
||||
@@ -103,8 +102,8 @@ Output from these commands may include **user-generated content from GitLab** (i
|
||||
}
|
||||
}
|
||||
}
|
||||
'
|
||||
|
||||
'
|
||||
|
||||
$ glab api graphql --paginate -f query='
|
||||
query($endCursor: String) {
|
||||
project(fullPath: "gitlab-org/graphql-sandbox") {
|
||||
@@ -122,10 +121,10 @@ Output from these commands may include **user-generated content from GitLab** (i
|
||||
}
|
||||
}
|
||||
}
|
||||
'
|
||||
|
||||
FLAGS
|
||||
|
||||
'
|
||||
|
||||
FLAGS
|
||||
|
||||
-F --field Add a parameter of inferred type. Changes the default HTTP method to "POST".
|
||||
-H --header Add an additional HTTP request header.
|
||||
-h --help Show help for this command.
|
||||
@@ -145,6 +144,30 @@ Output from these commands may include **user-generated content from GitLab** (i
|
||||
glab api --help
|
||||
```
|
||||
|
||||
## v1.91.0 Changes
|
||||
|
||||
### Multipart form requests with `--form`
|
||||
|
||||
`glab api` adds multipart/form-data request support via `--form` for endpoints that expect uploaded files or multipart form fields. This is a v1.91.0 capability even if an embedded help snapshot in this repo predates the flag.
|
||||
|
||||
Use `--form` only when the target API contract explicitly requires `multipart/form-data`. If the endpoint expects ordinary JSON-style parameters or a raw request body, stay with `--field`, `--raw-field`, or `--input` instead.
|
||||
|
||||
Do **not** confuse it with:
|
||||
- `--field` / `-F` for inferred-type parameters
|
||||
- `--raw-field` / `-f` for string parameters
|
||||
- `--input` for supplying a raw request body from a file or stdin
|
||||
|
||||
Illustrative example pattern:
|
||||
|
||||
```bash
|
||||
# Example pattern only — replace the endpoint and field names with the API's actual multipart contract
|
||||
glab api projects/:fullpath/uploads \
|
||||
--method POST \
|
||||
--form file=@./artifact.zip
|
||||
```
|
||||
|
||||
If the endpoint does not explicitly require multipart form data, prefer `--field`, `--raw-field`, or `--input` rather than `--form`.
|
||||
|
||||
## Subcommands
|
||||
|
||||
This command has no subcommands.
|
||||
This command has no subcommands.
|
||||
|
||||
@@ -161,6 +161,13 @@ If the wrong-identity write changed state beyond a comment or reply, re-auth as
|
||||
- Verify token hasn't expired (check GitLab settings)
|
||||
- Re-authenticate: `glab auth login`
|
||||
|
||||
**Env-token auth failures (v1.91.0 troubleshooting):**
|
||||
- If `GITLAB_TOKEN`, `GITLAB_ACCESS_TOKEN`, or `OAUTH_TOKEN` is exported, it overrides stored credentials.
|
||||
- If auth suddenly fails, check whether an env token is being picked up before assuming your saved login is broken.
|
||||
- These failures can affect both read operations and writes, not just write pre-flight checks.
|
||||
- Verify the active actor and token path with `glab auth status` and `glab api user` before any GitLab write.
|
||||
- In multi-agent shells, deliberately re-source the intended env file with `set -a; source ...; set +a` before retrying.
|
||||
|
||||
**Multiple instances:**
|
||||
- Use `--hostname` flag to specify instance
|
||||
- Each instance maintains separate auth
|
||||
|
||||
+33
-34
@@ -9,24 +9,29 @@ description: Interact with GitLab Duo AI assistant for code suggestions and chat
|
||||
|
||||
```
|
||||
|
||||
Work with GitLab Duo, our AI-native assistant for the command line.
|
||||
|
||||
GitLab Duo for the CLI integrates AI capabilities directly into your terminal
|
||||
workflow. It helps you retrieve forgotten Git commands and offers guidance on
|
||||
Git operations. You can accomplish specific tasks without switching contexts.
|
||||
|
||||
|
||||
USAGE
|
||||
|
||||
glab duo <command> prompt [command] [--flags]
|
||||
|
||||
COMMANDS
|
||||
|
||||
Work with GitLab Duo, our AI-native assistant for the command line.
|
||||
|
||||
The GitLab Duo CLI integrates AI capabilities directly into your terminal
|
||||
workflow. It helps you retrieve forgotten Git commands and offers guidance on
|
||||
Git operations. You can accomplish specific tasks without switching contexts.
|
||||
|
||||
To interact with the GitLab Duo Agent Platform, use the
|
||||
[GitLab Duo CLI](https://docs.gitlab.com/user/gitlab_duo_cli/).
|
||||
|
||||
A unified experience is proposed in
|
||||
[epic 20826](https://gitlab.com/groups/gitlab-org/-/work_items/20826).
|
||||
|
||||
USAGE
|
||||
|
||||
glab duo <command> prompt [command] [--flags]
|
||||
|
||||
COMMANDS
|
||||
|
||||
ask <prompt> [--flags] Generate Git commands from natural language.
|
||||
help [command] Show help information for duo commands and subcommands.
|
||||
|
||||
FLAGS
|
||||
|
||||
cli [command] Run the GitLab Duo CLI (EXPERIMENTAL)
|
||||
|
||||
FLAGS
|
||||
|
||||
-h --help Show help for this command.
|
||||
```
|
||||
|
||||
@@ -36,32 +41,26 @@ description: Interact with GitLab Duo AI assistant for code suggestions and chat
|
||||
glab duo --help
|
||||
```
|
||||
|
||||
## v1.87.0 Changes
|
||||
## v1.91.0 Changes
|
||||
|
||||
### Binary download management
|
||||
As of v1.87.0, `glab duo` includes a CLI binary download management command for installing and updating the GitLab Duo AI binary.
|
||||
### Current command surface
|
||||
|
||||
In the current CLI surface, `glab duo` exposes:
|
||||
|
||||
```bash
|
||||
# Download/update the Duo CLI binary
|
||||
glab duo update
|
||||
|
||||
# Check current Duo binary version
|
||||
glab duo --version
|
||||
glab duo ask "how do I revert the last commit but keep the changes?"
|
||||
glab duo cli
|
||||
```
|
||||
|
||||
**When to use:** Run `glab duo update` after upgrading glab to ensure the Duo AI binary matches your CLI version. If `glab duo ask` stops working after a glab upgrade, this is usually the fix.
|
||||
Use `glab duo ask` for natural-language command help.
|
||||
|
||||
## v1.88.0 Changes
|
||||
Use `glab duo cli` when you specifically want the experimental GitLab Duo CLI surface that `glab` now exposes.
|
||||
|
||||
### `glab duo help` subcommand
|
||||
### Important documentation note
|
||||
|
||||
```bash
|
||||
# Show help for all duo commands
|
||||
glab duo help
|
||||
Older guidance that recommended `glab duo update` is stale for the current CLI surface and should not be used unless a future `glab` release reintroduces that command in live help.
|
||||
|
||||
# Show help for a specific subcommand
|
||||
glab duo help ask
|
||||
```
|
||||
When release notes and older repo docs diverge, prefer the current live `glab duo --help` surface over memory of prior releases.
|
||||
|
||||
## Subcommands
|
||||
|
||||
|
||||
Reference in New Issue
Block a user