yage
f3e70c61cb
===================================================================== --- Changes ------------------------------ - scwrypts runner has new arguments -q/--quiet allows quiet-mode operation while still logging to logfiles -v/--verbose forces verbose mode --version longform required (-v is now for "verbose" mode) - scwrypts runner now auto-detects certain CLI usage, running in quiet, logged mode if pattern match successfully identifies a single scwrypt (or when using --name); use --verbose to override this behavior - 'k exec' no longer requires double '--' if a '--' comes after - old : k exec -it my-pod-0 -- -- /bin/sh + new : k exec -it my-pod-0 -- /bin/sh + still works : k -- exec -it my-pod-0 -- /bin/sh --- Bug Fixes ---------------------------- - fixed various plugins/kubectl auto-completion settings; arguments after '--' or profile number (e.g. 'k 1 get deployments') will now appropriately autocomplete in the indicated profile - helm template functions now work on related .tpl files as well (renders from chart root) - fixed some goofy UTF-8 icons in zsh/lib/utils/io --- New Features ------------------------- - (experimental) scwrypts zsh plugin for interactive command selection (like CTRL+SPACE), but allows you to build command arguments, providing help dialogue for the selected command --- New Scripts -------------------------- - zsh/misc/tally ) helps keep tally-counts of things; helpful when running long scripts "what iteration am I on" |
||
---|---|---|
.config | ||
.github/workflows | ||
docs | ||
plugins | ||
py | ||
zsh | ||
zx | ||
.gitattributes | ||
.gitignore | ||
action.yaml | ||
LICENSE | ||
README.md | ||
run | ||
scwrypts | ||
scwrypts.plugin.zsh |
Scwrypts (Wryn + Scripts)
Scwrypts is a friendly CLI / API for quickly running sandboxed scripts in the terminal.
In modern developer / dev-ops workflows, scripts require a complex configurations. Without a better solution, the developer is cursed to copy lines-upon-lines of variables into terminals, create random text artifacts, or maybe even commit secure credentials into source. Scwrypts leverages ZSH to give hot-key access to run scripts in such environments.
Dependencies
Due to the wide variety of resources used by scripting libraries, the user is expected to manually resolve dependencies. Dependencies are lazy-loaded, and more information can be found by command error messages or in the appropriate README.
Because Scwrypts relies on Scwrypts (see Meta Scwrypts), zsh
must be installed and junegunn/fzf
must be available on your PATH.
Usage
Install Scwrypts by cloning this repository and sourcing scwrypts.plugin.zsh
in your zshrc
.
You can now run Scwrypts using the ZLE hotkey bound to SCWRYPTS_SHORTCUT
(default CTRL + W
).
% cd <path-to-cloned-repo>
% echo "source $(pwd)/scwrypts.plugin.zsh >> $HOME/.zshrc"
Check out Meta Scwrypts to quickly set up environments and adjust configuration.
No Install / API Usage
Alternatively, the scwrypts
API can be used directly:
./scwrypts [--env environment-name] (...script-name-patterns...) [-- ...passthrough arguments... ]
Given one or more script patterns, Scwrypts will filter the commands by pattern conjunction. If only one command is found which matches the pattern(s), it will immediately begin execution. If multiple commands match, the user will be prompted to select from the filtered list. Of course, if no commands match, Scwrypts will exit with an error.
Given no script patterns, Scwrypts becomes an interactive CLI, prompting the user to select a command.
After determining which script to run, if no environment has been specified, Scwrypts prompts the user to choose one.
Using in CI/CD or Automated Workflows
Set environment variable CI=true
(and use the no install method) to run in an automated pipeline.
There are a few notable changes to this runtime:
- The Scwrypts sandbox environment will not load. All variables will be read from context.
- User yes/no prompts will always be YES
- Other user input will default to an empty string
- Logs will not be captured
- Setting the environment variable
SCWRYPTS_GROUP_LOADER__[a-z_]\+
will source the file indicated in the variable (this allows custom groups without needing to modify theconfig.zsh
directly)- In GitHub actions,
*.scwrypts.zsh
groups are detected automatically from the$GITHUB_WORKSPACE
; setSCWRYPTS_GITHUB_NO_AUTOLOAD=true
to disable
- In GitHub actions,
Contributing
Before contributing an issue, idea, or pull request, check out the super-brief contributing guide