According to the python-gitlab documentation, I need a gitlab.cfg file that should look something like this:
[global]
default = gitlabcom
ssl_verify = true
timeout = 30
[gitlabcom]
url = https://gitlab.com/
private_token = PERSONAL_ACCESS_TOKEN
api_version = 4
and then I should be able to list my projects with
gitlab -c gitlab.cfg project list
however, this gives me a list of projects that are not mine, e.g. (the list varies):
id: 13784565
path: 2019-08-25-form-from-classes
id: 13784562
path: faq
id: 13784561
path: curso-web-playground
id: 13784560
...
If I use curl I get the expected results:
curl --header "PRIVATE-TOKEN: PERSONAL_ACCESS_TOKEN" "https://gitlab.com/api/v4/groups/42424242/projects"
(where 42424242
is my group id).
I can't find any documentation on how to do this with gitlab.com (as opposed to a privately hosted gitlab instance).