@builden/git-src
v2.0.0
Published
Git source code manager for AI Agents
Readme
git-src
Git source code manager for AI Agents - manage local Git repositories for easy reference
Installation
# Clone and install
git clone https://github.com/your-repo/git-src.git
cd git-src
bun install
# Build
bun run build
# Link globally
npm link
# or
bun link运行时要求 Node.js 22.12+;开发命令使用 Bun。
Usage
# Add repository
git-src add react
git-src add facebook/react
git-src add https://github.com/vuejs/vue
git-src add react --tag important # Add with tag
git-src add react --link # Add and link to current directory
# List repositories
git-src ls
git-src ls --tag skills # Filter by tag
git-src ls -s # Simple output (repo name only)
# Search
git-src query react
git-src q react # Short alias
git-src s react # Short alias
git-src search react # Full alias
git-src query --tag important
git-src query "re*" --simple # Wildcard search with simple output
git-src query "*react*" -s -t ui # Combine options
# Check outdated
git-src outdated
git-src outdated react
git-src outdated --tag skills # Filter by tag
git-src outdated --concurrency 8 # Limit concurrent remote checks
git-src outdated --json # Machine-readable result
# Open in editor
git-src open vue
git-src open re* # Wildcard with interactive selection
git-src open re* -a # Open all matches
git-src open re* -d # Open directory instead of editor
# Update
git-src update
git-src update react
git-src update react -f # Transactional shallow re-clone
git-src update --concurrency 4
git-src update --json
# Tags
git-src tag react important
git-src tag react # List tags
git-src tag react important --delete
# Remove
git-src rm react # Shows a plan and asks for confirmation
git-src rm 'facebook/*' # Wildcard removal, also asks for confirmation
git-src rm 'facebook/*' --dry-run # Preview only
git-src rm 'facebook/*' --yes # Non-interactive removal
# Link repository
git-src link react # Create symlink in current directory
# Print path
git-src cd # Print config directory (~/.git-src)
git-src cd react # Print repo path (supports wildcards: *, ?)Features
- Clone and normal updates use
--depth 1; deeper history is fetched only when explicitly requested through Git outdateduses one machine-readable dry-run fetch per repository and bounded concurrency; it does not mutate local refs- Update failures include the Git command, exit code, working directory, and Git's stderr
- Force updates clone into a temporary sibling and atomically replace the old repository after validation
- Removal always shows the affected repositories and links before confirmation
- Auto-extract owner from GitHub URLs
- Interactive selection for multiple matches
- Wildcard support in search and open
- Tag-based organization and filtering
- Bun-style colorful output
- Table display with repo URL links
- Version read from package.json
- Symlink support: link repos to project directories
- Automatic symlink cleanup when removing repos
