feat(api): add api command to allow access to GitLab API
Description
This PR adds api
command to glab
core commands to allow users make authenticated requests to the GitLab API v4 endpoints and GitLab GraphQL endpoints.
It prints a pretty formatted JSON response.
Motivation and Context
The GitLab CLI tool (gh
) has the api
command that allows user to easily make authenticated requests to GitHub.
This is useful for cases where there are no commands available to perform specific tasks.
How Has This Been Tested?
Added a couple of tests and also manually tested as shown in the screenshot
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change)