用于检查多个项目 Git 状态的 CLI 工具
CLI tool to check the Git status of multiple projects

原始链接: https://github.com/uralys/check-projects

## Check-Projects: 一个 Git 状态 CLI **Check-Projects** 是一个快速、跨平台的 CLI 工具,旨在快速检查多个项目的 Git 状态,并按可定制的类别进行组织。它可以并行识别未提交的更改、与远程分支的差异以及未跟踪的文件。 **主要特性:** * **分类:** 按团队、客户或任何所需标准对项目进行分组。 * **灵活配置:** 使用 YAML 文件(支持本地和全局)来定义项目列表或自动扫描目录。 * **智能过滤:** 默认隐藏干净的项目,专注于需要操作的项目。 * **跨平台:** 适用于 macOS、Linux 和 Windows。 * **状态指示器:** 使用符号清晰地显示项目状态(例如,*M* 表示已修改,⬆ 表示领先于远程,✔ 表示干净)。 **安装:** 简单的 shell 脚本安装(macOS/Linux)或手动下载/提取。配置涉及在 YAML 文件中定义类别和项目。运行 `check-projects` 查看状态,并提供详细程度、类别过滤和自定义配置文件等选项。包含自动更新检查。

## 多仓库 Git 状态工具 - 黑客新闻讨论总结 一场黑客新闻讨论围绕着用于检查多个项目 Git 状态的命令行工具。原始帖子重点介绍了一个新的基于 Go 的工具“check-projects”,旨在快速识别具有未提交更改或落后于远程仓库的项目。 对话迅速发展成为现有解决方案的展示。多位用户推荐了诸如 `mani`(一个项目命令运行器)、`mr`(一个多仓库通用管理器)、`mu-repo`、`garden`、`git-map`、`gita`,甚至谷歌的 `repo` 等工具。许多人也分享了他们自己使用 `git status` 和 shell 命令实现类似功能的自定义脚本。 一个关键的争论点在于表示 Git 状态——特别是与远程仓库的差异。有些人更喜欢简洁的数字表示(例如,"-4+5" 表示落后/领先的提交),而另一些人则偏爱符号指示器。讨论还涉及使用 LLM 生成此类工具的趋势,一些人对“感觉编程”缺乏足够知识表示担忧。最终,该帖子展示了管理和监控多个 Git 仓库的多种方法。
相关文章

原文

A fast, cross-platform CLI tool to check the git status of multiple projects organized by categories.

Run check-projects to see which of your projects have uncommitted changes, are ahead of remote, or have other git status indicators.

x mozilla
  * M firefox
  ✱ ✚ thunderbird

✔ godot

x gamedev
  ⬆ flying-ones
  * M avindi
  • - Clean (synced with remote)
  • - Ahead of remote
  • ⬆⬆ - Diverged from remote
  • * M - Modified files
  • * D - Deleted files
  • ✱ ✚ - Untracked files
  • - Error
  • Multi-category organization: Group your projects by team, client, or any category
  • Nested project discovery: Automatically scan nested folder structures
  • Concurrent scanning: Fast parallel git status checks
  • Flexible configuration: YAML-based config with local and global support
  • Smart filtering: Hide clean projects by default, show only what needs attention
  • Cross-platform: Single binary for macOS, Linux, and Windows

Quick Install (macOS/Linux)

curl -fsSL https://raw.githubusercontent.com/uralys/check-projects/main/install.sh | sh

This will download the latest release and install it to ~/.local/bin/check-projects.

show manual Installation
  1. Download the latest release for your platform from GitHub Releases

  2. Extract and install:

# macOS/Linux
tar -xzf check-projects-*.tar.gz
chmod +x check-projects
sudo mv check-projects /usr/local/bin/

# Or install to user directory (no sudo required)
mkdir -p ~/.local/bin
mv check-projects ~/.local/bin/
# Add ~/.local/bin to your PATH if not already done
# Windows (PowerShell as Administrator)
Move-Item check-projects.exe C:\Windows\System32\
git clone https://github.com/uralys/check-projects.git
cd check-projects
make install
  1. Create a configuration file:
cp check-projects.example.yml ~/check-projects.yml
  1. Edit ~/check-projects.yml to match your project structure

  2. Run the tool:

Configuration files are searched in this order:

  1. Path specified with --config flag
  2. ./check-projects.yml (current directory)
  3. ~/check-projects.yml (home directory)
categories:
  # Mode 1: Explicit project list (using 'projects' field)
  # Use full paths to specific git repositories
  - name: core
    projects:
      - ~/fox
      - ~/cherry

  # Mode 2: Auto-scan directory (using 'root' field)
  # Recursively scans for all git repositories in the directory
  - name: godot
    root: ~/Projects/godot

  # Mode 2 with ignore patterns
  # Projects listed in 'ignore' will be skipped in this category
  - name: uralys
    root: ~/Projects/uralys
    ignore:
      - deprecated-project        # Exact match
      - _archives/*              # Wildcard: ignore all projects in _archives/
      - "*-old"                  # Pattern: ignore all projects ending with -old

# Display options
display:
  hide_clean: true      # Hide projects with ✔ status by default
  hide_ignored: true    # Hide ignored projects from output

You can ignore specific projects in a category using the ignore field. Supported patterns:

  • Exact match: project-name - ignores the exact project name
  • Wildcard prefix: _archives/* - ignores all projects in the _archives/ directory
  • Glob patterns: *-deprecated - ignores all projects ending with -deprecated

Common ignore patterns are automatically applied:

  • node_modules - always skipped during scanning
  • .DS_Store - always skipped during scanning
# Check all projects
check-projects

# Show all projects including clean ones
check-projects --verbose
check-projects -v

# Check only specific category
check-projects --category gamedev

# Use custom config file
check-projects --config /path/to/config.yml

# Show version
check-projects --version

check-projects automatically checks for new versions on startup. When a new version is available, you'll see:

⚠ New version available: 1.0.0 → 1.1.0
Install update? [Y/n]:
  • Press Enter or type Y to automatically download and install the update
  • Type n to skip and continue with your current version

The update check is non-blocking and will silently fail if GitHub is unreachable.

# Install dependencies
make deps

# Run without building
make dev

# Build binary
make build

# Run tests
make test

# Build for all platforms
make release
联系我们 contact @ memedata.com