vcspull import gitlab¶
Import repositories from GitLab or a self-hosted GitLab instance.
Command¶
Import repositories from GitLab (gitlab.com or self-hosted).
Usage¶
usage: vcspull import gitlab [-h] [-w DIR] [-l LANG] [--topics TOPICS] [--min-stars N] [--archived] [--forks] [--limit N] [-f FILE] [--dry-run] [--yes] [--json] [--ndjson] [--https] [--color {auto,always,never}] [--token TOKEN] [-m {user,org,search}] [--url URL] [--flatten-groups] TARGET
Positional Arguments¶
- target TARGET¶
User, org name, or search query. For GitLab, supports subgroups with slash notation (e.g., parent/child).
Options¶
- -w, --workspace DIR¶
Workspace root directory (REQUIRED)
- --token TOKEN¶
API token (overrides env var; prefer env var for security)
- -m, --mode¶
Import mode: user (default), org, or search
- --url URL¶
Base URL for self-hosted GitLab (optional)
- --flatten-groups¶
For ``--mode org``, flatten subgroup repositories into the base workspace instead of preserving subgroup paths
Filtering¶
Output¶
- -f, --file FILE¶
Config file to write to (default: ~/.vcspull.yaml)
- --dry-run, -n¶
Preview without writing to config file
- --yes, -y¶
Skip confirmation prompt
- --json¶
Output as JSON
- --ndjson¶
Output as NDJSON (one JSON per line)
- --https¶
Use HTTPS clone URLs instead of SSH (default: SSH)
- --color¶
When to use colors (default: auto)
Group flattening¶
When importing a GitLab group with --mode org, vcspull preserves subgroup
structure as nested workspace directories by default. Use --flatten-groups to
place all repositories directly in the base workspace:
$ vcspull import gl my-group \
--mode org \
--workspace ~/code/ \
--flatten-groups
Authentication¶
Env vars:
GITLAB_TOKEN(primary),GL_TOKEN(fallback)Token type: Personal access token
Scope:
read_api(minimum for listing projects; required for search mode)Create at: https://gitlab.com/-/user_settings/personal_access_tokens (self-hosted:
https://<instance>/-/user_settings/personal_access_tokens)
Set the token:
$ export GITLAB_TOKEN=glpat-...
Then import:
$ vcspull import gl myuser --workspace ~/code/