Skip to content

Edwinws/edcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edcli

Personal CLI tool for Edwin's daily workflows.

Setup

  1. Build the binary:
go build -o edcli .
  1. Copy .env.example to .env and fill in your values:
cp .env.example .env

Alternatively, export environment variables directly in your shell.

Project Structure

internal/
  config/     Configuration loading (.env + env vars)
  cmd/        Cobra command definitions (thin wiring layer)
    gitlab/   GitLab subcommands
  gitlab/     GitLab API client (pure domain logic)
  git/        Git CLI operations
  cache/      File-based cache (.cache/)
  tui/        Shared Bubble Tea styles and helpers

Commands

GitLab

All GitLab commands require GITLAB_TOKEN and GITLAB_URL (set in .env or as environment variables).

gitlab list-repos

Recursively list all repositories in a GitLab group and its subgroups.

edcli gitlab list-repos mygroup
edcli gitlab list-repos 12345
edcli gitlab list-repos mygroup/subgroup
edcli gitlab list-repos mygroup --verbose
edcli gitlab list-repos mygroup --format json
edcli gitlab list-repos mygroup --format urls

Flags:

  • -v, --verbose - Show detailed information about repositories
  • -f, --format - Output format: table (default), json, or urls
  • --no-cache - Ignore cached data and fetch fresh from GitLab
  • --debug - Show debug information

gitlab clone-repos

Recursively clone all repositories in a GitLab group and its subgroups.

Repositories are cloned preserving the GitLab group structure. If a repository directory already exists, it will be updated with git pull instead.

edcli gitlab clone-repos mygroup
edcli gitlab clone-repos mygroup --branch develop
edcli gitlab clone-repos mygroup --https
edcli gitlab clone-repos mygroup --output-dir ./my-repos
edcli gitlab clone-repos mygroup --workers 5
edcli gitlab clone-repos mygroup --dry-run

Flags:

  • -b, --branch - Branch to clone (defaults to repository's default branch)
  • -o, --output-dir - Directory to clone into (default: current directory)
  • -w, --workers - Parallel workers for cloning (1-20, default: 3)
  • --https - Use HTTPS URLs instead of SSH
  • --dry-run - Show what would be cloned without doing it
  • --no-cache - Ignore cached data and fetch fresh from GitLab
  • --debug - Show debug information

gitlab clear-cache

Clear all cached repository data, forcing the next command to fetch fresh data from GitLab.

edcli gitlab clear-cache

gitlab protected-branches check

Check which repositories in a group have a specific branch protected. Supports exact names and wildcard patterns.

edcli gitlab protected-branches check mygroup main
edcli gitlab protected-branches check mygroup "release-*"
edcli gitlab pb check 12345 develop --verbose

Flags:

  • -v, --verbose - Show all repositories including non-matches
  • --debug - Show debug information

Other Commands

bclear

Remove the badge in iTerm2 created by the tabset utility.

edcli bclear

About

CLI for my own usage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages