@tertium/hlpr
v0.5.8
Published
Windows and *Nix utility for typical programming activity
Downloads
149
Readme
hlpr
A CLI utility for running shell scripts with variable substitution and TypeScript-based commands.
Platform Support
hlpr works on all major operating systems:
- ✅ Linux - Fully supported
- ✅ macOS - Fully supported
- ✅ Windows - Requires Git for Windows (includes Git Bash)
Note for Windows users: Shell script commands (.sh files) require Bash, which is included with Git for Windows. TypeScript commands work on all platforms.
Installation
# Install globally
npm install -g @tertium/hlpr
# Or with yarn
yarn global add @tertium/hlpr
# Or locally in your project
npm install @tertium/hlprUsage
# Basic usage
hlpr <category> <command>
# Examples
hlpr git fodd
hlpr hello world
hlpr ssh init dir
# TypeScript commands (nested structure)
hlpr file rename <directory> <style> [--dry|-n]
# Continue execution even if commands fail
hlpr -f ssh init dirAvailable Commands
TypeScript Commands
file rename
Recursively rename files and folders according to a specific case style.
Supported styles:
title_underscore- Title_Case_With_Underscoressnake- snake_case_lowercasekebab- kebab-case-lowercasecamel- camelCaseLowerFirstpascal- PascalCaseUpperFirstupper- UPPER_CASE_WITH_UNDERSCORESlower- lower_case_with_underscores
Usage:
# Dry run (preview changes without applying)
hlpr file rename ./my-project kebab --dry
hlpr file rename ./src snake -n
# Apply changes
hlpr file rename ./my-project kebab
hlpr file rename ./docs pascalFeatures:
- ✅ Recursive directory traversal
- ✅ Extension preservation
- ✅ Leading dot file support (e.g.,
.gitignore) - ✅ Case-only rename handling (Windows compatibility)
- ✅ Conflict resolution (adds
_Nsuffix) - ✅ Dry-run mode (
--dryor-n)
See: src/commands/file/rename/README.md for full documentation.
help
Display help information about hlpr commands.
Usage:
hlpr helpShell Script Commands
Shell scripts support variable substitution using {{variable}} syntax.
git
Helpful git utilities for common development workflows.
Usage:
hlpr git <command>Commands:
fodd- Fetch and update develop branch from originprecommit- Run build and stage binaries before commitswitch-clean- Safely switch to a branch and delete the previous one (local & remote)
See: src/commands/git/README.md for full documentation.
hello
Example/demo commands for testing the hlpr CLI tool.
Usage:
hlpr hello worldPrompts for input and prints a personalized greeting with variable substitution.
See: src/commands/hello/README.md for full documentation.
nvm
Node Version Manager utilities for managing Node.js versions.
Usage:
hlpr nvm <command>Commands:
install- Install Node Version Manager (nvm)lts- Install and use Node.js LTS version
See: src/commands/nvm/README.md for full documentation.
ssh
SSH configuration and setup utilities.
Usage:
hlpr ssh init-dirInitializes SSH directory with proper permissions:
~/.ssh/directory with 700 permissions~/.ssh/known_hostswith 644 permissions~/.ssh/configwith 644 permissions
Portable across Unix/Linux/macOS and Git Bash on Windows.
See: src/commands/ssh/README.md for full documentation.
How It Works
Shell Scripts
- The command
hlpr hello worldlooks for a script atcommands/hello/world.sh - If the script contains variables like
{{name}}, you'll be prompted to enter values - Each line of the script is executed with the variables replaced
TypeScript Commands
- The command
hlpr file renamelooks for a script atcommands/file/rename/rename.ts - Arguments are passed directly to the TypeScript module
- The module is executed with Bun runtime
Directory Structure
commands/
├── file/
│ └── rename/
│ ├── rename.ts
│ ├── rename.test.ts
│ └── README.md
├── git/
│ └── fodd.sh
├── hello/
│ └── world.sh
├── nvm/
│ ├── install.sh
│ └── lts.sh
└── ssh/
└── initdir.shAdding Your Own Scripts
Shell Scripts
- Create a directory structure in
commands/<category>/ - Add your
.shscript files - Use
{{variable}}syntax for user inputs
Example script (commands/hello/world.sh):
echo "Hello World, {{name}}"TypeScript Commands
- Create a nested directory structure in
commands/<category>/<command>/ - Add your TypeScript file named
<command>.ts - Implement CLI argument parsing and logic
- Optionally add tests in
<command>.test.ts
Example structure:
commands/
└── file/
└── rename/
├── rename.ts # Main implementation
├── rename.test.ts # Tests
└── README.md # DocumentationCommand Naming
The utility maps command arguments to script files:
Shell Scripts:
hlpr git fodd→ runscommands/git/fodd.shhlpr hello world→ runscommands/hello/world.shhlpr ssh init dir→ runscommands/ssh/initdir.sh
TypeScript Commands:
hlpr file rename <args>→ runscommands/file/rename/rename.ts
Error Handling
By default, the utility stops execution if any command fails. Use the -f flag to continue execution despite failures:
# Stop on first failure (default)
hlpr ssh init dir
# Continue despite failures
hlpr -f ssh init dirDevelopment
# Clone the repository
git clone https://github.com/tertiumnon/hlpr.git
# Install dependencies
npm install
# Build the project
bun run build
# Link for local development
npm linkLicense
MIT
