A small CLI toolkit, providing:
init-proj: Create a new folder with the exact structure and files from project-template. The template is fetched from GitHub at runtime (viagit cloneor ZIP download), so no localproject-templatefolder is required.ktype: Types commands into a newcmdwindow at intervals.
Add the project folder to your system PATH so you can call the tools from anywhere.
- Option 1: Current user (no admin)
- Open Start, search "Environment Variables" → "Edit environment variables for your account".
- Under "User variables", select
Path→ Edit → New. - Add the absolute path to the repo folder, e.g.
C:\Repositories\cli-utils. - Save and restart terminals.
- Option 2: All users (admin)
- Open "Edit the system environment variables" → Environment Variables.
- Under "System variables", edit
Path→ New. - Add the repository path, for example
C:\Repositories\cli-utils. - Save and restart terminals.
Add a symlink into a directory already on PATH, typically /usr/local/bin:
sudo ln -s /path/to/your/clone/utils /usr/local/bin/utilsOr add the repo directory to PATH in your shell profile:
echo 'export PATH="/path/to/your/clone:$PATH"' >> ~/.bashrc
source ~/.bashrcRun these scripts to automatically add this repo to your PATH:
- Windows (user PATH):
# From repo root
pwsh setup/add-to-path.ps1
# Or specify a path explicitly
pwsh setup/add-to-path.ps1 "D:\Repositories\cli-utils"- Linux/WSL (bash):
# From repo root
bash setup/add-to-path.sh
# Or specify a path explicitly
bash setup/add-to-path.sh /mnt/d/Repositories/cli-utilsThese commands dispatch to PowerShell scripts. Install PowerShell if needed.
- Winget (recommended):
winget install --id Microsoft.PowerShell --source winget- Manual download:
- Visit https://github.com/PowerShell/PowerShell/releases and install the latest
.msi.
- Visit https://github.com/PowerShell/PowerShell/releases and install the latest
After install, pwsh should be available. If not, use powershell.
- Microsoft apt repository:
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell- Snap (many distros):
sudo snap install powershell --classicRun PowerShell:
pwshNotes:
- On WSL, installing PowerShell inside the Linux distro is recommended for using
utils. utilspreferspwshand falls back topowershell.
After adding the project to PATH (see Setup), you can call the commands directly.
PowerShell (recommended):
# From repo root without PATH: use the Windows dispatcher explicitly
Push-Location d:\Repositories\cli-utils
.\utils.cmd list
.\utils.cmd test-init-proj
.\utils.cmd init-proj MyNewProject
Pop-Location
# With PATH set to include the repo
utils.cmd list
utils.cmd test-init-proj
utils.cmd init-proj MyNewProject
# If `utils` (bash shim) resolves instead of `utils.cmd`, prefer `utils.cmd`
Get-Command utils # Shows which entry is being calledCMD:
utils.cmd list
utils.cmd test-init-proj
utils.cmd init-proj MyNewProjectBash on Windows (Git Bash/WSL) is supported via utils but may require LF line endings. If you see /usr/bin/env: 'bash\r': No such file or directory, convert line endings to LF or use utils.cmd.
- CMD:
utils init-proj MyNewProject
utils init-proj "D:\Projects\MyNewProject"- PowerShell:
utils init-proj MyNewProject
utils init-proj "D:\Projects\MyNewProject"- Bash (Git Bash/WSL):
utils init-proj MyNewProject
utils init-proj /mnt/d/Projects/MyNewProjectCreates the destination folder populated with the exact contents of project-template, fetched from GitHub (excluding the .git folder).
- CMD:
utils ktype 5- PowerShell:
utils ktype 5- Bash (Git Bash/WSL):
utils ktype 5Runs a new cmd window and types echo Hello World <n> every interval.
List available commands and tests:
utils.cmd listYou can run tests via the entrypoints once PATH is set:
- CMD:
utils test-init-proj
utils test-ktype- PowerShell:
utils test-init-proj
utils test-ktype- Bash (Git Bash/WSL):
utils test-init-proj
utils test-ktypeNotes:
test-init-projcreates a temp project via thetests/test-init-proj.ps1script, validates it, and cleans up.test-ktypeis a smoke test viatests/test-ktype.ps1that starts the script briefly and stops it.
This project is licensed under the MIT License. A copy of the license is available at LICENSE in the repository.