Features
Installation
Clone Repository
git clone -b master https://github.com/dimaslanjaka/bin bin
NPM Installation
# Install locally
npm install binary-collections
# Install globally
npm install binary-collections -g
# Install from release archive
npm install binary-collections@https://github.com/dimaslanjaka/bin/raw/master/releases/bin.tgz
Direct Run (No Install)
# Yarn berry
yarn dlx binary-collections@https://raw.githubusercontent.com/dimaslanjaka/bin/master/releases/bin.tgz
# NPX
npx --legacy-peer-deps -y binary-collections@https://raw.githubusercontent.com/dimaslanjaka/bin/master/releases/bin.tgz
VSCode Setup
Create or update .vscode/settings.json to add binary tools to your integrated terminal PATH:
{
"terminal.integrated.env.linux": {
"PATH": "${env:PATH}:${workspaceFolder}/node_modules/.bin:${workspaceFolder}/bin"
},
"terminal.integrated.env.windows": {
"PATH": "${env:PATH};${workspaceFolder}\\node_modules\\.bin;${workspaceFolder}\\bin"
}
// ... other settings
}
Available Tools
To list all available executable tools, run:
binary-collections list
Quick Reference
| Category | Commands | Description |
|---|---|---|
| Git | git-purge, git-diff, git-fix, git-reduce-size |
Git repository management and optimization |
| Submodules | submodule-install, submodule-remove |
Git submodule operations |
| NPM Scripts | nrs, run-s, run-series |
Run npm scripts in series |
| Package Mgmt | yarn-reinstall, pkg-res-updater |
Yarn/package resolutions management |
| Process Mgmt | kill-process, nodekill, javakill |
Process management and termination |
| Cleanup | del-nodemodules, del-yarncaches, del-gradle |
Cache and build directory cleanup |
| GitHub Actions | clear-gh-caches |
Remove old GitHub Actions caches |
Git Tools
Git Repository Purge
Cleans and optimizes Git repositories by pruning reflogs.
git-purge
Git Fix Utility
Comprehensive Git configuration fixer for cross-platform development.
git-fix # Apply all fixes
git-fix --lf-only # Force LF line endings only
git-fix --permissions # Ignore file permissions only
git-fix --user # Configure Git user from environment vars
git-fix --user NAME EMAIL # Configure Git user with specific values
git-fix --user --update-remote # Configure user and update remote URL
- Line Endings: Forces LF (
core.autocrlf = false) - Permissions: Ignores file permission changes (
core.filemode = false) - Normalize: Creates/updates
.gitattributeswith proper rules - User Config: Sets user from
GITHUB_USER/GITHUB_EMAILor CLI args
Submodule Management
submodule-install: Install and setup submodulessubmodule-remove: Remove git submodules with interactive selection
NPM Script Runner
Binaries: nrs, run-s, run-series, npm-run-series
Run multiple npm scripts in series with pattern matching support.
| Flag | Description |
|---|---|
--yarn | Use yarn run instead of npm |
--verbose, -v | Enable verbose output |
Example
# In package.json
"scripts": {
"namescript:xx": "echo xx",
"namescript:xy": "echo xy",
"namescript": "nrs --yarn=true --verbose=true \"namescript:**\""
}
Package Management Tools
Yarn Package Reinstaller
yarn-reinstall [--dev|-D|--peer|-P|--optional|-O]
Package Resolutions Manager
Manage package resolutions in package.json. (Aliases: pkg-resolutions-updater, pkg-res-updater)
pkg-resolutions-updater
Cleanup Tools
Node Modules Cleaner
Remove node_modules directories recursively.
del-nodemodules # Primary command
del-node-modules # Alternative
Yarn & Gradle Cleaners
del-yarncaches # Clear yarn cache directories
del-gradle # Delete gradle build folders
GitHub Actions Cache Cleaner
Removes old GitHub Actions caches, keeping only the latest.
clear-gh-caches
Troubleshooting
Submodule Installation Issues
If you encounter this error:
fatal: 'origin/' is not a commit and a branch '' cannot be created from it
Solution: Delete the .git/modules directory before running submodule-install.
Complete Submodule Setup Example
echo "Initializing submodules..."
git submodule init
git submodule foreach "git submodule init"
echo "Syncing submodules..."
git submodule sync
git submodule foreach "git submodule sync"
echo "Updating submodules..."
npx --yes rimraf .git/modules
npx --yes binary-collections submodule-install
Development & Contributing
The list of available binaries is auto-generated by build.mjs. To update the binary list:
yarn run build
# or
node build.mjs
This scans the project and updates package.json. Contributions are welcome!