Man page - glab-api(1)
Packages contas this manual
- glab-mr-close(1)
- glab-label(1)
- glab-variable-set(1)
- glab-ci-run(1)
- glab-repo-fork(1)
- glab-mr-approve(1)
- glab-mr-issues(1)
- glab-ssh-key(1)
- glab-job-artifact(1)
- glab-repo-mirror(1)
- glab-config-set(1)
- glab-ssh-key-delete(1)
- glab-repo-transfer(1)
- glab-release-create(1)
- glab-user(1)
- glab-schedule-list(1)
- glab-release(1)
- glab-mr-diff(1)
- glab-stack-sync(1)
- glab-ci(1)
- glab-mr-delete(1)
- glab-issue-create(1)
- glab-repo-contributors(1)
- glab-schedule-create(1)
- glab-auth(1)
- glab-repo-clone(1)
- glab-config(1)
- glab-cluster-agent-update-kubeconfig(1)
- glab-mr(1)
- glab-mr-note(1)
- glab-stack-switch(1)
- glab-ci-lint(1)
- glab-repo-list(1)
- glab-ci-config-compile(1)
- glab-issue-board-view(1)
- glab-incident-close(1)
- glab-cluster-agent-bootstrap(1)
- glab-mr-unsubscribe(1)
- glab-schedule(1)
- glab-variable-delete(1)
- glab-stack-prev(1)
- glab-incident-view(1)
- glab-ci-get(1)
- glab-ci-run-trig(1)
- glab-release-download(1)
- glab-stack-create(1)
- glab-mr-revoke(1)
- glab-completion(1)
- glab-ci-trigger(1)
- glab-token-list(1)
- glab-repo-archive(1)
- glab-stack-first(1)
- glab-issue(1)
- glab-config-get(1)
- glab-ci-list(1)
- glab-release-upload(1)
- glab-cluster-agent-list(1)
- glab-mr-list(1)
- glab-incident-reopen(1)
- glab-cluster-agent(1)
- glab-issue-update(1)
- glab-token-rotate(1)
- glab-mr-create(1)
- glab-stack-list(1)
- glab-snippet(1)
- glab-incident-list(1)
- glab-ci-delete(1)
- glab-variable(1)
- glab-mr-rebase(1)
- glab-duo-ask(1)
- glab-incident-subscribe(1)
- glab-api(1)
- glab-ssh-key-add(1)
- glab-issue-list(1)
- glab-ci-retry(1)
- glab-issue-close(1)
- glab-token-create(1)
- glab-cluster-agent-check_manifest_usage(1)
- glab-repo-delete(1)
- glab-mr-todo(1)
- glab-label-list(1)
- glab-stack-move(1)
- glab-repo-create(1)
- glab-ci-trace(1)
- glab-cluster(1)
- glab-release-delete(1)
- glab-token-revoke(1)
- glab-repo(1)
- glab-user-events(1)
- glab-schedule-update(1)
- glab-variable-list(1)
- glab-stack-save(1)
- glab-issue-view(1)
- glab-incident(1)
- glab-snippet-create(1)
- glab-ci-status(1)
- glab-issue-note(1)
- glab-auth-login(1)
- glab-ci-config(1)
- glab-incident-note(1)
- glab-issue-board(1)
- glab-changelog-generate(1)
- glab-issue-unsubscribe(1)
- glab-token(1)
- glab-alias-list(1)
- glab-issue-delete(1)
- glab-changelog(1)
- glab-alias-set(1)
- glab-mr-update(1)
- glab-schedule-delete(1)
- glab-mr-checkout(1)
- glab-job(1)
- glab-alias-delete(1)
- glab-stack-next(1)
- glab-ci-cancel(1)
- glab-release-list(1)
- glab(1)
- glab-repo-search(1)
- glab-ssh-key-get(1)
- glab-stack-last(1)
- glab-label-create(1)
- glab-ci-cancel-job(1)
- glab-check-update(1)
- glab-duo(1)
- glab-variable-export(1)
- glab-issue-subscribe(1)
- glab-label-delete(1)
- glab-repo-view(1)
- glab-mr-merge(1)
- glab-alias(1)
- glab-mr-subscribe(1)
- glab-variable-get(1)
- glab-version(1)
- glab-auth-status(1)
- glab-variable-update(1)
- glab-mr-view(1)
- glab-schedule-run(1)
- glab-release-view(1)
- glab-mr-reopen(1)
- glab-ssh-key-list(1)
- glab-ci-view(1)
- glab-incident-unsubscribe(1)
- glab-ci-cancel-pipeline(1)
- glab-stack(1)
- glab-issue-reopen(1)
- glab-stack-amend(1)
- glab-issue-board-create(1)
- glab-stack-reorder(1)
- glab-cluster-agent-get-token(1)
- glab-mr-approvers(1)
apt-get install glab
Manual
| glab(1) | glab(1) |
NAME
glab-api - Make an authenticated request to the GitLab API.
SYNOPSIS
glab api [flags]
DESCRIPTION
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/ee/api/index.html⟩
- GitLab GraphQL documentation ⟨https://docs.gitlab.com/ee/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.
OPTIONS
-F, --field=[] Add a parameter of inferred type. Changes the default HTTP method to "POST".
-H, --header=[] Add an additional HTTP request header.
--hostname="" The GitLab hostname for the request. Defaults to "gitlab.com", or the authenticated host in the current Git directory.
-i, --include[=false] Include HTTP response headers in the output.
--input="" The file to use as the body for the HTTP request.
-X, --method="GET" The HTTP method for the request.
--paginate[=false] Make additional HTTP requests to fetch all pages of results.
-f, --raw-field=[] Add a string parameter.
--silent[=false] Do not print the response body.
OPTIONS INHERITED FROM PARENT COMMANDS
--help[=false] Show help for this command.
EXAMPLE
$ glab api projects/:fullpath/releases $ glab api projects/gitlab-com%2Fwww-gitlab-com/issues $ glab api issues --paginate $ glab api graphql -f query='
query {
project(fullPath: "gitlab-org/gitlab-docs") {
name
forksCount
statistics {
wikiSize
}
issuesEnabled
boards {
nodes {
id
name
}
}
}
} ' $ glab api graphql --paginate -f query='
query($endCursor: String) {
project(fullPath: "gitlab-org/graphql-sandbox") {
name
issues(first: 2, after: $endCursor) {
edges {
node {
title
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}'
SEE ALSO
glab(1)
| Jun 2025 | Auto generated by spf13/cobra |