CLI interface for Swish
npm install @swishjs/coreThis is a command line tool which provides the power of Swish to your terminal.
``bash`
npm install -g @swish/core
You can also run Swish without installing it by using npx:
`bash`
npx @swishjs/core --help
You can get details on how to use Swish by running swish --help.
`bash`
swish --list
You can do one of the following to pass some data from a file:
- cat file.txt | swish plugin-id _(Pipe the file contents in from Cat)_swish plugin-id < file.txt
- _(Redirect the file contents in from the file)_swish plugin-id --file file.txt
- _(Have Swish read the file)_
Where file.txtis the file you want to process and plugin-id is the id of the plugin you want to run.
If you don't want to pass any input (some plugins like uuid-generate don't need input), you need to pass a -0 or --noinput flag so Swish knows not to wait for input on stdin.
Firstly, run with the -v` flag to get verbose output. This will print out useful logs including:
- If a plugin isn't available, why it wasn't loaded - this could be because:
- It's broken and failed to load
- It took too long to load (more than 200ms) and was skipped
- It requires something Swish Core doesn't provide
- Swish is looking in the wrong place for it
- If the plugin did something bad and was terminated