gzh-cli

module
v0.0.0-...-592e5ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2025 License: MIT

README

Gizzahub Manager (gzh-cli)

통합 개발 환경 CLI 도구

Test Status Lint Status GoDoc Code Coverage Latest Release


개요

gzh-cli (바이너리: gz)는 개발자를 위한 종합 CLI 도구로, Git 플랫폼 통합 관리, IDE 모니터링, 코드 품질 관리, 개발 환경 설정을 하나의 명령어로 통합합니다.

핵심 가치:

  • 🔗 다중 플랫폼 통합: GitHub, GitLab, Gitea, Gogs를 하나의 인터페이스로
  • 🛠️ 개발 워크플로우 자동화: IDE, 코드 품질, 패키지 매니저 통합 관리
  • 📦 확장 가능한 아키텍처: Integration Libraries Pattern으로 모듈화
  • 🔌 사용자 확장 시스템: 별칭, 워크플로우, 외부 명령어 통합 지원
  • 🚦 라이프사이클 관리: 안정/베타/실험적 기능 단계별 제어

빠른 시작

설치
# Go로 설치 (권장)
go install github.com/Gizzahub/gzh-cli/cmd/gz@latest

# 소스에서 빌드
git clone https://github.com/Gizzahub/gzh-cli.git
cd gzh-cli
make bootstrap  # 빌드 의존성 설치
make build      # gz 바이너리 생성
make install    # $GOPATH/bin에 설치
첫 명령어
# 시스템 상태 진단
gz doctor

# IDE 스캔 및 관리
gz ide scan
gz ide status

# Git 리포지토리 관리
gz git repo clone-or-update https://github.com/user/repo.git
gz git repo pull-all ~/workspace --parallel 5

# 코드 품질 검사
gz quality run
다음 단계

주요 기능

기능 설명 상세 문서
Git 플랫폼 통합 GitHub/GitLab/Gitea/Gogs 리포지토리 관리, 크로스 플랫폼 동기화 📖 Docs
IDE 관리 JetBrains/VS Code 스캔, 상태 모니터링, 프로젝트 열기 📖 Docs
코드 품질 다중 언어 린팅/포매팅 (Go, Python, JS, Rust 등) 📖 Docs
성능 프로파일링 Go pprof 기반 CPU/메모리 프로파일링 📖 Docs
패키지 매니저 asdf, Homebrew, SDKMAN, npm, pip 통합 업데이트 📖 Docs
쉘 설정 빌더 .zshrc/.bashrc 모듈화 및 의존성 관리 📖 Docs
개발 환경 관리 AWS, Docker, Kubernetes, SSH 설정 통합 📖 Docs
네트워크 환경 WiFi, VPN, DNS, 프록시 자동 전환 📖 Docs
명령어 구조
gz [command] [subcommand] [flags]

# 주요 명령어
git         # Git 플랫폼 통합 (repo, webhook, event)
ide         # IDE 모니터링 및 관리
quality     # 코드 품질 도구 (포매팅 + 린팅)
profile     # 성능 프로파일링
pm          # 패키지 매니저 관리
shellforge  # 쉘 설정 빌더
synclone    # 대량 리포지토리 클론
dev-env     # 개발 환경 관리
net-env     # 네트워크 환경 관리
repo-config # GitHub 리포지토리 설정
doctor      # 시스템 진단

전체 명령어: gz --help


🧩 하위 프로젝트 (Subprojects)

gzh-cli는 핵심 기능을 독립 라이브러리로 분리하여 개발합니다. 각 라이브러리는 독립적으로 사용 가능합니다.

프로젝트 목적 독립 사용 문서
gzh-cli-git 로컬 Git 작업 관리 (clone, pull, push) 📖
gzh-cli-quality 다중 언어 코드 품질 도구 📖
gzh-cli-package-manager 패키지 매니저 통합 관리 📖
gzh-cli-shellforge 모듈형 쉘 설정 빌더 📖

통합 아키텍처: Integration Libraries Pattern

코드 감소 효과: 6,702줄 (92.0% 감소율)


사용 예제

Git 리포지토리 관리
# 스마트 클론/업데이트 (6가지 전략)
gz git repo clone-or-update https://github.com/user/repo.git
gz git repo clone-or-update https://github.com/user/repo.git --strategy rebase --branch develop

# 재귀적 일괄 업데이트 (하위 디렉토리 모든 Git 리포지토리)
gz git repo pull-all ~/workspace --parallel 10 --verbose

# 크로스 플랫폼 동기화
gz git repo sync --from github:org/repo --to gitlab:group/repo
IDE 관리
# IDE 스캔 및 감지
gz ide scan                  # 24시간 캐시
gz ide scan --refresh        # 캐시 무시

# IDE 상태 확인
gz ide status
gz ide status --running      # 실행 중인 IDE만

# IDE로 프로젝트 열기
gz ide open /path/to/project
gz ide open . --ide goland
코드 품질
# 전체 품질 검사 및 수정
gz quality run

# 변경된 파일만 처리
gz quality run --changed

# 린팅만 (수정 없이 검사)
gz quality check
대량 리포지토리 클론
# GitHub 조직 전체 클론
gz synclone github --orgName myorg --targetPath ~/repos --token $GITHUB_TOKEN

# GitLab 그룹 클론
gz synclone gitlab --groupName mygroup --targetPath ~/repos --token $GITLAB_TOKEN

# 설정 파일로 실행
gz synclone --config synclone.yaml

문서

사용자 가이드
개발자 가이드
추가 리소스

설정

기본 설정 파일

설정 파일 위치 (우선순위 순):

  1. $GZH_CONFIG_PATH (환경 변수)
  2. ./gzh.yaml (현재 디렉토리)
  3. ~/.config/gzh-manager/gzh.yaml (사용자 설정)
  4. /etc/gzh-manager/gzh.yaml (시스템 설정)
설정 예제
global:
  clone_base_dir: "$HOME/repos"
  default_strategy: reset

providers:
  github:
    token: "${GITHUB_TOKEN}"
    organizations:
      - name: "myorg"
        clone_dir: "$HOME/repos/github/myorg"

  gitlab:
    token: "${GITLAB_TOKEN}"
    groups:
      - name: "mygroup"
        clone_dir: "$HOME/repos/gitlab/mygroup"

상세 설정: Configuration Guide


🔌 확장 시스템 (Extensions)

gz는 소스 코드 수정 없이 사용자 정의 별칭, 워크플로우, 외부 명령어를 추가할 수 있는 강력한 확장 시스템을 제공합니다.

확장 설정 파일

위치: ~/.config/gzh-manager/extensions.yaml

간단한 별칭 (Simple Aliases)

자주 사용하는 명령어에 짧은 이름을 부여:

aliases:
  update-all:
    command: "pm update --all"
    description: "Update all package managers"

사용: gz update-all

다단계 워크플로우 (Multi-Step Workflows)

여러 명령어를 순차적으로 실행:

aliases:
  full-sync:
    description: "Full synchronization workflow"
    steps:
      - "synclone run"
      - "pm update --all"
      - "git repo pull-all"

실행 시 각 단계의 진행 상황이 표시됩니다:

🔄 Step 1/3: synclone run
✅ Step 1/3 completed

🔄 Step 2/3: pm update --all
✅ Step 2/3 completed

🔄 Step 3/3: git repo pull-all
✅ Step 3/3 completed

🎉 All steps completed successfully!
파라미터화된 별칭 (Parameterized Aliases)

변수를 사용하는 재사용 가능한 명령어:

aliases:
  clone-and-setup:
    command: "git repo clone-or-update ${url} && dev-env bootstrap"
    description: "Clone repository and setup environment"
    params:
      - name: url
        description: "Repository URL to clone"
        required: true

사용: gz clone-and-setup https://github.com/user/repo.git

외부 명령어 통합 (External Commands)

외부 도구를 gz 서브커맨드로 통합:

external:
  - name: terraform
    command: /usr/local/bin/terraform
    description: "Terraform infrastructure management"
    passthrough: true

사용: gz terraform plan

실험적 기능 활성화

일부 명령어는 실험적 기능으로 표시되며 기본적으로 비활성화됩니다:

# 환경 변수로 활성화
export GZ_EXPERIMENTAL=1
gz experimental-command

# 또는 플래그로 활성화
gz --experimental experimental-command

상세 예제: examples/extensions.yaml


아키텍처

Integration Libraries Pattern

gzh-cli는 공통 기능을 외부 라이브러리로 분리하여 **단일 정보 소스(Single Source of Truth)**를 확립합니다.

gzh-cli (통합 CLI)
├── cmd/*_wrapper.go (45-473줄) - 얇은 래퍼
└── 외부 라이브러리 통합
    ├── gzh-cli-git (로컬 Git 작업)
    ├── gzh-cli-quality (코드 품질)
    ├── gzh-cli-package-manager (패키지 관리)
    └── gzh-cli-shellforge (쉘 설정)

이점:

  • ✅ 코드 중복 제거 (92% 감소)
  • ✅ 독립 사용 가능
  • ✅ 단일 정보 소스
  • ✅ 유지보수 간소화

상세 아키텍처: Integration Documentation


개발

빌드 및 테스트
# 개발 환경 설정
make bootstrap      # 빌드 의존성 설치 (최초 1회)

# 빌드
make build          # gz 바이너리 생성

# 코드 품질 (커밋 전 필수)
make fmt            # 코드 포매팅
make lint           # 린팅 검사
make test           # 테스트 실행

# 전체 품질 검사
make lint-all       # 포맷 + 린트 + pre-commit
Pre-commit 훅
# 설치 (최초 1회)
make pre-commit-install

# 수동 실행
make pre-commit
make pre-push
모듈별 테스트
# 특정 패키지 테스트
go test ./cmd/git/repo -v
go test ./cmd/ide -v
go test ./pkg/github -v

# 특정 테스트 함수
go test ./cmd/git -run "TestCloneOrUpdate" -v

기여하기

기여 프로세스
  1. 이슈 확인: Issues
  2. Fork & 브랜치: feature/your-feature or fix/issue-number
  3. 구현: 코드 작성 + 테스트
  4. 품질 검사: make lint-all 통과
  5. PR 제출: 상세 설명 포함
품질 기준
  • make test 통과
  • make lint 통과
  • make fmt 적용
  • ✅ 문서 업데이트 (필요시)
  • ✅ 커밋 메시지 규칙 준수

자세한 내용: Contributing Guide


시스템 요구사항

  • Go: 1.23.0+
  • Git: 2.0+
  • OS: Linux, macOS, Windows (WSL 권장)

라이선스

MIT License - LICENSE 파일 참조


링크


Made with ❤️ by the Gizzahub Team

Directories

Path Synopsis
cmd
Package cmd provides the command line interface and root commands for gzh-manager.
Package cmd provides the command line interface and root commands for gzh-manager.
dev-env
Package devenv provides development environment management commands.
Package devenv provides development environment management commands.
doctor
Package doctor provides system diagnostics and health check commands.
Package doctor provides system diagnostics and health check commands.
git
Package git provides repository lifecycle management commands.
Package git provides repository lifecycle management commands.
git-sync
패키지 gitsync는 `gzh-cli-git-sync`의 공용 Cobra 커맨드 트리를 `gz git-sync`로 노출합니다.
패키지 gitsync는 `gzh-cli-git-sync`의 공용 Cobra 커맨드 트리를 `gz git-sync`로 노출합니다.
gz command
ide
Package ide provides IDE settings monitoring and synchronization commands.
Package ide provides IDE settings monitoring and synchronization commands.
net-env
Package netenv provides network environment management commands.
Package netenv provides network environment management commands.
registry
Package registry provides command registration and lifecycle management.
Package registry provides command registration and lifecycle management.
repo-config
Package repoconfig provides repository configuration management commands.
Package repoconfig provides repository configuration management commands.
shell
Package shell provides shell integration and command execution functionality.
Package shell provides shell integration and command execution functionality.
synclone
Package synclone provides commands for synchronizing and cloning repositories from GitHub, GitLab, Gitea, and other Git platforms.
Package synclone provides commands for synchronizing and cloning repositories from GitHub, GitLab, Gitea, and other Git platforms.
internal
analysis
Package analysis provides shared quality analysis types and interfaces for repository analysis
Package analysis provides shared quality analysis types and interfaces for repository analysis
analysis/godoc
Package godoc provides API documentation analysis capabilities
Package godoc provides API documentation analysis capabilities
app
apprunner
Package apprunner provides application bootstrapping and lifecycle management.
Package apprunner provides application bootstrapping and lifecycle management.
auth
Package auth provides common authentication utilities for Git platforms.
Package auth provides common authentication utilities for Git platforms.
cli
Package cli provides common CLI patterns and utilities for building consistent command-line interfaces across the gzh-cli application.
Package cli provides common CLI patterns and utilities for building consistent command-line interfaces across the gzh-cli application.
config
Package config provides internal configuration management services and utilities.
Package config provides internal configuration management services and utilities.
constants
Package constants provides common constants for timeouts, limits, and configuration values throughout the application to avoid magic numbers and ensure consistency.
Package constants provides common constants for timeouts, limits, and configuration values throughout the application to avoid magic numbers and ensure consistency.
env
Package env provides environment variable management and abstraction.
Package env provides environment variable management and abstraction.
errors
Package errors provides advanced error handling and recovery capabilities.
Package errors provides advanced error handling and recovery capabilities.
extensions
Package extensions provides user-extensible alias and external command integration.
Package extensions provides user-extensible alias and external command integration.
git
Package git provides Git operations abstraction and utilities for repository management within the GZH Manager system.
Package git provides Git operations abstraction and utilities for repository management within the GZH Manager system.
git/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
gitplatform
Package gitplatform provides a common interface for different Git hosting platforms.
Package gitplatform provides a common interface for different Git hosting platforms.
httpclient
Package httpclient provides HTTP client functionality with advanced features.
Package httpclient provides HTTP client functionality with advanced features.
httpclient/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
idecore
Package idecore provides core types and interfaces for IDE detection and management
Package idecore provides core types and interfaces for IDE detection and management
logger
Package logger provides simple terminal output logging capabilities.
Package logger provides simple terminal output logging capabilities.
pm/bootstrap
Package bootstrap provides automatic installation and configuration of package managers.
Package bootstrap provides automatic installation and configuration of package managers.
services
Package services provides business logic services separated from CLI handlers.
Package services provides business logic services separated from CLI handlers.
simpleprof
Package simpleprof provides simplified profiling using standard Go pprof.
Package simpleprof provides simplified profiling using standard Go pprof.
testutil
Package testutil provides testing utilities and helper functions.
Package testutil provides testing utilities and helper functions.
testutil/builders
Package builders provides test builder patterns for creating test data structures.
Package builders provides test builder patterns for creating test data structures.
testutil/fixtures
Package fixtures provides test fixtures and mock data for unit tests.
Package fixtures provides test fixtures and mock data for unit tests.
testutil/helpers
Package helpers provides reusable testing helper functions and utilities.
Package helpers provides reusable testing helper functions and utilities.
testutil/mocks
Package mocks provides mock implementations for testing purposes.
Package mocks provides mock implementations for testing purposes.
validation
Package validation provides comprehensive input validation and sanitization for security purposes throughout the application.
Package validation provides comprehensive input validation and sanitization for security purposes throughout the application.
workerpool
Package workerpool provides concurrent worker pool functionality for processing jobs.
Package workerpool provides concurrent worker pool functionality for processing jobs.
wrapper
Package wrapper provides standard interface and utilities for integrating external libraries.
Package wrapper provides standard interface and utilities for integrating external libraries.
pkg
cloud
Package cloud provides cloud provider configuration synchronization and management.
Package cloud provides cloud provider configuration synchronization and management.
config
Package config provides unified configuration management and integration services.
Package config provides unified configuration management and integration services.
git/provider
Package provider provides a unified abstraction layer for Git hosting platforms.
Package provider provides a unified abstraction layer for Git hosting platforms.
gitea
Package gitea provides Gitea API integration for repository management and cloning operations.
Package gitea provides Gitea API integration for repository management and cloning operations.
github
Package github provides a comprehensive client library for interacting with GitHub's API.
Package github provides a comprehensive client library for interacting with GitHub's API.
github/largescale
Package largescale provides efficient large-scale repository operations for GitHub.
Package largescale provides efficient large-scale repository operations for GitHub.
github/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
gitlab
Package gitlab provides a client library for interacting with GitLab's API.
Package gitlab provides a client library for interacting with GitLab's API.
gzhclient
Package gzhclient provides HTTP client functionality for gzh-manager services.
Package gzhclient provides HTTP client functionality for gzh-manager services.
synclone
Package bulkclone provides legacy bulk-clone configuration handling and repository management.
Package bulkclone provides legacy bulk-clone configuration handling and repository management.
types/repoconfig
Package repoconfig provides repository configuration schema definitions and types.
Package repoconfig provides repository configuration schema definitions and types.
scripts
test
e2e/helpers
Package helpers provides testing utilities and helper functions for end-to-end tests.
Package helpers provides testing utilities and helper functions for end-to-end tests.
integration/github
Package github_test provides integration test fixtures and scenarios for GitHub operations.
Package github_test provides integration test fixtures and scenarios for GitHub operations.
integration/testcontainers
Package testcontainers provides test container utilities for integration testing
Package testcontainers provides test container utilities for integration testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL