mkscript creates complete, editable command-script, Bash, Dockerfile, Docker Compose, Kubernetes, Terraform, Ansible, and Helm starters without overwriting existing paths. It uses native Bash on Linux/macOS and a native PowerShell implementation on Windows.
Quick links: INSTALL.md | Public install site | Releases | Checksums | Official packaging guide
macOS with Homebrew:
brew install seriousCoding/tap/mkscriptDebian and Ubuntu:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.deb
sudo apt install ./mkscript.debWindows (PowerShell):
winget install --id seriousCoding.mkscript --exact
# or
choco install mkscript -yThe catalog commands become available after their initial WinGet and Chocolatey submissions are approved. The direct installer works immediately from a published GitHub release:
irm https://raw.githubusercontent.com/seriousCoding/mkscript/main/install.ps1 | iexOpen a new terminal after a direct installation, then run mkscript --version. To remove it later, run %LOCALAPPDATA%\Programs\mkscript\uninstall.cmd.
Fedora:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.rpm
sudo dnf install ./mkscript.rpmRHEL, Rocky Linux, AlmaLinux, and other yum-based systems:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.rpm
sudo yum install ./mkscript.rpmVerify the install:
mkscript --version
mkscript --helpFor versioned package links, checksum verification, and platform-specific notes, see INSTALL.md and the public install page.
- On Linux and macOS, creates Bash starter files by default with
#!/usr/bin/env bashand the standard metadata header. - On Windows, creates
.cmdstarter files by default with@echo offand the same metadata header rendered asremcomments. -sand--strictaddset -euo pipefailfor Bash on Linux/macOS andsetlocal EnableExtensions EnableDelayedExpansionfor.cmdon Windows.--template terraform,--template ansible,--template dockerfile(ordocker),--template docker-compose, and--template helmwork on every platform.- Built-in Kubernetes starter templates work on every platform for
k8s-namespace,k8s-pod,k8s-deployment,k8s-service,k8s-configmap,k8s-secret,k8s-ingress,k8s-networkpolicy,k8s-serviceaccount,k8s-role,k8s-rolebinding,k8s-clusterrole,k8s-clusterrolebinding,k8s-persistentvolume,k8s-persistentvolumeclaim,k8s-storageclass,k8s-statefulset,k8s-daemonset,k8s-job,k8s-cronjob, andk8s-horizontalpodautoscaler. - Windows supports
cmdplus the non-script templates above. It does not support--template bash. -g,-c,-r, and-mvmanage Bash symlinks on Linux/macOS and managed.cmdwrappers on Windows.-fand--fileslist or look up platform-native commands and files.- Omitted template targets use a standard name and require confirmation. Explicit extensionless targets add the template extension except Dockerfiles and Helm chart directories.
- Refuses to overwrite existing files, chart directories, symlinks, directories, or managed wrapper paths.
- Ships with tests, a man page, Debian packaging, RPM packaging, Homebrew support, and GitHub Actions automation.
- Generates WinGet and Chocolatey metadata and can publish catalog updates from tagged releases when repository credentials are configured.
When no target is supplied, mkscript prompts before creating the standard target and prints the explicit alternative. For example, mkscript -t docker creates Dockerfile after confirmation and prints mkscript -t docker Dockerfile. Declining leaves the filesystem unchanged.
| Template | Default target | Extension added to explicit extensionless targets |
|---|---|---|
| Bash (Unix) | script.sh |
.sh when -t bash is selected; the default mkscript NAME keeps the supplied Unix script name for compatibility |
| CMD (Windows) | script.cmd |
.cmd |
| Terraform | main.tf |
.tf |
| Ansible | site.yml |
.yml |
| Dockerfile / Docker | Dockerfile |
none |
| Docker Compose | docker-compose.yml |
.yml |
| Kubernetes | resource name plus .yaml |
.yaml |
| Helm | chart directory |
none |
mkscript hello-worldOn Linux and macOS this creates ./hello-world with:
#!/usr/bin/env bash
# Script: hello-world
# Description:
# Created: YYYY-MM-DD
# Creator: login-userOn Windows the same command creates .\hello-world.cmd with @echo off followed by the same metadata header in rem comments.
Strict mode:
mkscript --strict deploy.shThis creates:
#!/usr/bin/env bash
# Script: deploy.sh
# Description:
# Created: YYYY-MM-DD
# Creator: login-user
set -euo pipefailOn Windows, mkscript --strict deploy creates deploy.cmd and adds setlocal EnableExtensions EnableDelayedExpansion after the metadata header.
Terraform starter:
mkscript --template terraform main.tfThis creates:
# File: main.tf
# Description:
# Created: YYYY-MM-DD
# Creator: login-user
terraform {
required_version = ">= 1.0.0"
}Ansible starter:
mkscript site.yml --template ansibleThis creates:
# File: site.yml
# Description:
# Created: YYYY-MM-DD
# Creator: login-user
---
- name: site.yml
hosts: all
gather_facts: false
tasks: []Dockerfile starter:
mkscript --template dockerDocker Compose starter:
mkscript --template docker-composeKubernetes Deployment starter:
mkscript --template k8s-deployment deployment.yamlHelm chart starter:
mkscript --template helm service-chart
helm lint service-chart
helm template service-chart service-chartThe generated chart includes Chart.yaml, values.yaml, .helmignore, helpers, deployment, service, service account, ingress, autoscaling, network policy, persistent volume claim, config map, secret, notes, and a Helm test pod. Values expose image, service, resources, security contexts, ingress, persistence, autoscaling, network policy, configuration, secret references, and scheduling controls.
Docker Compose includes a service, restart policy, health check, resource limits, named volume, and named bridge network. Kubernetes templates include a complete editable manifest for each supported resource; update cluster-specific values such as ingress classes, storage provisioners, host paths, and credentials before applying them.
Global shortcut:
mkscript test -gOn Linux and macOS this creates ./test and a symlink at ~/.local/bin/test pointing back to it.
On Windows this creates test.cmd plus a command wrapper in %LOCALAPPDATA%\mkscript\bin. Add that directory to PATH once; wrappers do not require symlink privileges.
Flags can be mixed in either order:
mkscript -g test -s
mkscript -s test -gBoth commands create the same strict-mode script and global shortcut or wrapper.
Link an existing local script later:
mkscript -g test
mkscript test.sh -gIf the local path already exists, mkscript asks for confirmation before it creates the shortcut or wrapper and does not rewrite the file.
Check whether a global shortcut or wrapper already exists:
mkscript -c test
mkscript test -cIf the shortcut or wrapper exists, mkscript prints its path and exits successfully.
Remove an existing global shortcut or wrapper later:
mkscript -r test
mkscript test -rmkscript asks for confirmation before it removes the shortcut or wrapper.
List matching files under the current folder tree:
mkscript -fLimit file listing to the current folder only:
mkscript -f 0Limit file listing to one subfolder deep:
mkscript --files 1Look up one or more commands or filenames and print the resolved location plus its parent directory:
mkscript -f bash README.mdLook up names from a pipe:
printf '%s\n' bash README.md | mkscript -fLookup mode prints a table with QUERY, FOUND, TYPE, LOCATION, and DIRECTORY.
On Linux and macOS, listing mode prints a table like:
PATH KIND EXEC GLOBAL
./scripts/build.sh sh+exec yes no
./hooks/pre-commit exec yes yes
./tools/deploy.sh sh no yes
On Windows, listing mode prints PATH and KIND for files such as .cmd, .bat, .ps1, and .sh.
Move an existing script to a new path:
mkscript -mv test deploymkscript asks for confirmation before moving. If the target is an existing directory, it retains the source basename, so mkscript -mv myfile myscripts moves myfile to myscripts/myfile.
If test already had a managed global shortcut or wrapper, mkscript moves the local file, removes the old shortcut or wrapper, and creates a new one for deploy. On Linux and macOS it preserves the source permission mode unless -g is supplied; -mv -g makes the moved target executable before creating its global shortcut.
Create a new global shortcut or wrapper during the move even when the source was not linked before:
mkscript -mv test deploy -gOther commands:
mkscript --help
mkscript --versionTemplate selection also works in either order:
mkscript --template terraform main.tf
mkscript main.tf -t terraform
mkscript -t ansible site.yml
mkscript site.yml --template ansible
mkscript --template dockerfile Dockerfile
mkscript deployment.yaml --template k8s-deployment0: success64: command-line usage error1: checked or removal target was not present, or one or more lookup names were not found73: could not create the requested script safely
- Linux and macOS create POSIX symlinks and otherwise retain their existing behavior.
- Windows creates managed
.cmdwrappers in%LOCALAPPDATA%\mkscript\bin(override withMKSCRIPT_BIN_DIR).-c,-r, and-mvinspect, remove, and update those wrappers. -gand--globaluse the script basename for the shortcut name.- On Linux and macOS, global shortcuts are supported only for the Bash template.
- On Windows, wrapper creation for a new file is supported only for the
cmdtemplate. - If the requested path does not exist yet,
-gcreates the new Bash file and its global shortcut on Linux/macOS, or the new.cmdfile and its wrapper on Windows. - If the requested path already exists locally,
-gswitches to existing-file link mode, prompts for confirmation, and creates only the global shortcut or wrapper. - Existing-file global mode does not rewrite the local file.
- Existing-file global mode requires a local path that already exists and is not a directory.
- Existing-file global mode cannot be combined with
-s. -mv ... -gcreates a new global shortcut or wrapper for the move target even when the source was not linked already. On Linux/macOS it also makes the moved target executable.- Every
-mvoperation asks for confirmation and accepts an existing directory target, retaining the source basename inside that directory. - On Linux,
mkscriptuses~/.local/binfor global shortcuts. - On macOS,
mkscriptprefers a personal*local*/binor~/binentry already onPATH, then falls back to~/.local/bin. - On Windows,
mkscriptuses%LOCALAPPDATA%\mkscript\binunlessMKSCRIPT_BIN_DIRis set. - Existing files, symlinks, or wrappers at that global path are never overwritten.
- The chosen global bin directory needs to be on your
PATHif you want to run the shortcut directly.
-cchecks for the expected global shortcut or wrapper and prints the resolved path when it exists.-rprompts before removing the managed symlink or wrapper.-ronly removes managed symlinks on Linux/macOS and managed wrappers on Windows. It refuses to delete unrelated paths at the global location.-cresolves the Bash symlink name on Linux/macOS and the.cmdwrapper name on Windows.- On Windows,
-ccannot be combined with-gor-s.
-fand--filesscan the current folder and all subdirectories by default.-f 0limits the scan to the current folder only.-f 1through-f 9include that many subfolder levels.-f name1 [name2 ...]switches to lookup mode for one to nine names.printf '%s\n' name1 name2 | mkscript -falso uses lookup mode from newline-separated stdin.- Quoted shell-style glob patterns like
mkscript -f 'install-wifi*'are supported in lookup mode. - Quote glob patterns so your shell passes them to
mkscriptunchanged. - On Linux and macOS, a file is listed if it ends with
.sh, is executable, or is the local target of a managed global symlink. - On Windows, a file is listed if it ends with
.cmd,.bat,.ps1, or.sh. - On Linux and macOS,
PATHshows the relative file path,KINDissh,exec,sh+exec, orfile,EXECshows whether the file is executable, andGLOBALshows whether a managed global symlink points to that local file. - On Windows, listing mode prints
PATHandKIND, whereKINDis the extension without the leading dot. - Unreadable folders are skipped quietly so protected macOS paths do not clutter the output.
- Lookup mode prints
QUERY,FOUND,TYPE,LOCATION, andDIRECTORY. - Lookup mode checks an exact path first, then exact or pattern command matches on
PATH, then current-tree and wider filename matches. - Lookup mode returns the first resolved match for each query.
- Lookup mode returns
0only when every requested name is found, and1when any requested name is missing. - Lookup mode accepts at most nine names total across arguments and piped stdin.
- A single numeric argument from
0to9keeps its depth meaning; if you need lookup input from stdin, do not combine it with a depth argument. -fis read-only and cannot be combined with--template,-g,-mv,-s,-c, or-r.
Quoted glob lookup example:
mkscript -f 'install-wifi*'-mvsupports the Bash template on Linux/macOS and thecmdtemplate on Windows.-mvmoves the existing local file instead of rewriting its contents.- On Linux and macOS,
-mvpreserves the source file's permission mode on the moved target. - If the source had a managed global shortcut or wrapper,
-mvremoves the old one and recreates it for the target basename. -mvcan be combined with-gto create a new global shortcut or wrapper for an unlinked source.-mvcannot be combined with-s,-c, or-r.
- On Linux and macOS,
--template bashis the default behavior. - On Windows,
--template cmdis the default behavior. --template terraformcreates a non-executable.tfstarter file.--template ansiblecreates a non-executable YAML playbook starter file.--template dockerfilecreates a non-executable Dockerfile starter.--template docker-composecreates a non-executable Compose YAML starter.- Built-in Kubernetes templates on every platform are
k8s-namespace,k8s-pod,k8s-deployment,k8s-service,k8s-configmap,k8s-secret,k8s-ingress,k8s-networkpolicy,k8s-serviceaccount,k8s-role,k8s-rolebinding,k8s-clusterrole,k8s-clusterrolebinding,k8s-persistentvolume,k8s-persistentvolumeclaim,k8s-storageclass,k8s-statefulset,k8s-daemonset,k8s-job,k8s-cronjob, andk8s-horizontalpodautoscaler. - On Linux and macOS,
-s,-g,-mv,-c, and-rare Bash-only options. - On Windows,
-sapplies to thecmdtemplate,-g,-mv,-c, and-rapply to the wrapper workflow, and--template bashis not supported.
make testOptional shell linting:
make lintLocal package builds use Linux tooling. On macOS, the supplied scripts run those builds in Docker.
make packageArtifacts are written to dist/:
mkscript-<version>.tar.gzmkscript_<version>-1_all.debmkscript-<version>-1.fc42.noarch.rpmmkscript-<version>-1.fc42.src.rpmmkscript.tar.gzmkscript.debmkscript.rpmmkscript.src.rpmmkscript.rb- Debian build metadata and
.changesfiles - checksums and build metadata
Debian and Ubuntu:
sudo apt install ./mkscript_<version>-1_all.debFedora:
sudo dnf install ./mkscript-<version>-1.fc42.noarch.rpmRHEL, Rocky Linux, AlmaLinux, and systems using yum:
sudo yum install ./mkscript-<version>-1.fc42.noarch.rpmThese alias filenames stay the same across releases, so users can keep the same GitHub download command:
Debian and Ubuntu:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.deb
sudo apt install ./mkscript.debFedora:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.rpm
sudo dnf install ./mkscript.rpmRHEL, Rocky Linux, AlmaLinux, and systems using yum:
curl -LO https://github.com/seriousCoding/mkscript/releases/latest/download/mkscript.rpm
sudo yum install ./mkscript.rpmINSTALL.md: direct install commands for macOS, Debian, Ubuntu, Fedora, RHEL, Rocky Linux, and AlmaLinux- https://seriouscoding.github.io/install/: public install landing page
docs/official-package-inclusion.md: Debian, Ubuntu, Fedora, and EPEL inclusion path- GitHub releases: packaged downloads and source archives
- SHA256SUMS: current release checksums
src/: CLI source templatetest/: automated testsdebian/: Debian packagingpackaging/rpm/: RPM specdocs/: project documentation, including distro inclusion guidancescripts/: build, packaging, and checksum helpers
.github/workflows/ci.ymlruns tests and shell linting..github/workflows/tag-from-version.ymltakes a successfulmainCI result, bumps the patch version, syncs release metadata, commitschore(release): vX.Y.Z, creates the matching tag, and explicitly starts the release workflow..github/workflows/release.ymlbuilds release artifacts, publishes them for the matchingvX.Y.Ztag, and can update the Homebrew tap when a token is configured.