Go to file
yage 76a746a53e v3.0.0 "The Great Overhaul"
=====================================================================

Notice the major version change which comes with breaking changes to
2.x! Reconstructs "library" functions for both python and zsh scwrypts,
with changes to virtualenv naming conventions (you'll need to refresh
all virtualenv with the appropriate scwrypt).

--- Changes ------------------------------

- changed a naming convention across zsh scripts, particularly
  removing underscores where there is no need to avoid naming clash
  (e.g. 'zsh/lib/utils/io.zsh' renames '__STATUS' to 'STATUS')

- moved clients reliant on py.lib.http to the py.lib.http module

- python scripts now rely on py.lib.scwrypts.execute

- updated package.json in zx scripts to include `type = module`

- 'scwrypts --list' commandline argument now includes additional
  relevant data for each scwrypt

- environment variables no longer add themselves to be staged in the
  '.env.template'

--- New Features -------------------------

- new 'use' syntax for disjoint import within zsh scripts; took me
  a very long time to convince myself this would be necessary

- introduced scwrypt "groups" to allow portable module creation;
  (i.e. ability add your own scripts from another repo!)

- py.lib.scwrypts.io provides a combined IO stream for quick, hybrid
  use of input/output files and stdin/stdout

- py.lib.fzf provides a wrapper to provide similar functionality to
  zsh/utils/io.zsh including fzf_(head|tail)

- improved efficiency of various scwrypts; notably reducing runtime
  of scwrypts/environment sync

- improved scwrypts CLI by adding new options for exact scwrypt
  matching, better filtering, and prettier/more-detailed interfaces

--- New Scripts --------------------------

- py/twilio )
    basic SMS integration with twilio
     - send-sms

- py/directus )
    interactive directus GET query
     - get-items

- py/discord )
    post message to discord channel or webhook
     - post-message
2023-06-21 20:04:30 -06:00
docs v1.0.0 2022-07-01 22:16:50 -06:00
py v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
zsh v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
zx v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
.env.template v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
.env.template.descriptions v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
.gitattributes v2.0.0 2022-07-01 22:17:15 -06:00
.gitignore v1.0.0 2022-07-01 22:16:50 -06:00
LICENSE v1.0.0 2022-07-01 22:16:50 -06:00
README.md v2.5.0 2022-08-16 18:26:55 -06:00
run v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00
scwrypts v2.5.0 2022-08-16 18:26:55 -06:00
scwrypts.plugin.zsh v3.0.0 "The Great Overhaul" 2023-06-21 20:04:30 -06:00

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

Contributing

Before contributing an issue, idea, or pull request, check out the super-brief contributing guide