Skip to content

Bluk Repo clone by org/user #34

Description

@Boomatang

Bulk repo clone by org/user

Clone all repositories for a given org or user in a single command. Useful for onboarding new team members or reviewing student projects.

Usage

grab --org boomatang

Queries both GitHub and Codeberg APIs for the user's repositories and clones them using the default clone mode.

Flags

grab --org boomatang                                          # query all platforms
grab --org boomatang --site github.com                        # GitHub only
grab --org boomatang --site codeberg.org                      # Codeberg only
grab --org boomatang --site github.com --site codeberg.org    # both explicitly
grab --org boomatang --limit 5                                # clone the 5 most recently updated repos
grab --org boomatang --limit -1                               # explicitly unlimited (overrides config)
grab --org boomatang --dryrun                                 # show what would be cloned without cloning

All existing clone flags compose with --org:

grab --org boomatang -s                 # standard clone
grab --org boomatang -S                 # shallow clone
grab --org boomatang -t                 # clone to temp directory

Platform support

GitHub and Codeberg are supported from the start. Both APIs are queried by default unless --site restricts it.

  • --site accepts full domains (github.com, codeberg.org), consistent with the tool's existing site naming
  • --site is repeatable to select multiple platforms
  • Default sites can be configured via the config file (Configuration file #16)

Sorting

Repos are sorted by most recently updated, set explicitly via sort=updated on both APIs. This may become configurable later.

Limit

  • No config, no flag: unlimited — clone everything found
  • Config file sets a limit: that's the default
  • --limit N: overrides config
  • --limit -1: explicitly unlimited, overrides config
  • Existing repos count against the limit (the limit applies to the API response, not to what actually gets cloned)

Authentication

Uses standard environment variables:

  • GITHUB_TOKEN for GitHub
  • GITEA_TOKEN for Codeberg

If a token is not found, a warning is logged about possible rate limiting. If a platform rate limits during use, the error is logged and the tool continues to the next platform.

Configuration file changes (#16)

This feature adds the following settings to the config file:

Setting Type Default Description
sites list ["github.com", "codeberg.org"] Platforms to query when --site is not provided
limit ?i32 null (unlimited) Default repo limit for --org

Example config:

.{
    .path = "/home/boomatang/source",
    .sites = .{ "github.com" },
    .limit = 10,
}

Error handling

  • Platform has no repos for that user → log "nothing found", continue
  • Platform rate limits → log the error, continue to next platform
  • Repo already exists locally → skip with log, no error
  • One platform fails entirely → log, continue with the other

Dry run

--dryrun lists the repos that would be cloned without cloning them. Scoped to --org only for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions