A CLI and an API to manage GitLab user accounts, based on python-gitlab.
- List users and groups from a GitLab instance
- Export users to CSV
- Bulk create/delete users from CSV
- Export SSH keys
pip install gitlab-usersRequires Python 3.9+ and a valid python-gitlab configuration (~/.python-gitlab.cfg).
Get help and list all commands:
gitlab-users -hList all users:
gitlab-users list-usersList all groups:
gitlab-users list-groupsExport all users to a CSV file:
gitlab-users export-users users.csvCreate users from a CSV file (see example format below):
gitlab-users create-from-csv users.csvDelete users from a CSV/text file (usernames in first column):
gitlab-users delete-from-csv users.csvDelete a single user (asks for confirmation):
gitlab-users delete-user USERNAMEExport SSH keys of a user:
gitlab-users export-ssh-keys USERNAME# username, name, email, [organization], [location], [group], [access_level]
# Note: The fields in square brackets are optional and can be omitted if not needed.
ww,Diana Prince,wonder.woman@themyscira.org,,Themyscira
wayne,Bruce Wayne,bruce.wayne@wayne-enterprises.com,Wayne Enterprises,Gotham City,board,owner
- See CONTRIBUTING.md for dev setup, linting, testing, and release instructions.
- Run all tests:
pytest - Lint and format:
ruff check .andblack .
- Full API and usage documentation: Sphinx HTML docs
- To build locally:
cd docs make html
MIT License