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).

Default
None
Required

Options

-w, --workspace DIR

Workspace root directory (REQUIRED)

Default
None
--token TOKEN

API token (overrides env var; prefer env var for security)

Default
None
-m, --mode

Import mode: user (default), org, or search

Default
user
Choices
user, org, search
--url URL

Base URL for self-hosted GitLab (optional)

Default
None
--flatten-groups

For ``--mode org``, flatten subgroup repositories into the base workspace instead of preserving subgroup paths

Default
False

Filtering

-l, --language LANG

Filter by programming language

Default
None
--topics TOPICS

Filter by topics (comma-separated)

Default
None
--min-stars N

Minimum stars (for search mode)

Default
0
Type
int
--archived

Include archived repositories

Default
False
--forks

Include forked repositories

Default
False
--limit N

Maximum repositories to fetch (default: 100)

Default
100
Type
int

Output

-f, --file FILE

Config file to write to (default: ~/.vcspull.yaml)

Default
None
--dry-run, -n

Preview without writing to config file

Default
False
--yes, -y

Skip confirmation prompt

Default
False
--json

Output as JSON

Default
False
--ndjson

Output as NDJSON (one JSON per line)

Default
False
--https

Use HTTPS clone URLs instead of SSH (default: SSH)

Default
False
--color

When to use colors (default: auto)

Default
auto
Choices
auto, always, never

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/