JsonScripts CLI. Run scripts/shell snippets from JSON file definition.
Download executable from releases.
Tip: Consider using gspm to download and install assets from GitHub releases!
USAGE: jnss <command> [--file <file>] [--verbose] [<arguments> ...] [-var <var> ...]
ARGUMENTS:
<command> init|list|<alias> Specify a builtin command or a command alias from scripts.json
<arguments> Command arguments
OPTIONS:
-f, --file <file> Specify the json file, default is "./scripts.json"
--verbose Verbose mode
-var <var> Specify multiple key-value pairs in the format 'key=value'.
--version Show the version.
-h, --help Show help information.
{
"version": 1,
"variables": {
"name": "JsonScripts"
},
"scripts": {
"hello": "echo 'Hello from {{name}}'"
}
}
# Generate a scripts.json
jnss init
# List available scripts
jnss list
# Run a command by alias
jnss hello
# Run a command from a scripts.json placed in another location
jnss hello --file /path/to/scripts.json
# Passing command line args
jnss foo -- --bar
# Passing variables (will override one if already exists in .json file)
jnss hello -var 'name=world'
swift run jnss hello
# Build for release
swift run jnss build
# Deploy GitHub release
swift run jnss release -var 'tag=<tag here>' -- .build/release/jnss*.tar.gz