The Inso config file supports scripts, similar to NPM scripts defined in a package.json
file. These scripts can be executed by running inso script <name>
, or inso <name>
. Any options passed to this command will be forwarded to the script being executed.
inso script <name>
name
is required, and must be a script defined in the loaded configuration file.
Option | Alias | Description |
---|---|---|
--output <path> |
-o | Save the specification to a file in the working directory. |
--workingDir <path> |
-w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml |
The following commands work when running in the example git-repo directory with the sample yaml file.
# .insorc.yaml
scripts:
lint: lint spec "Sample Specification"
Run commands with or without the script
prefix:
inso script gen-conf
inso gen-conf
If a conflict exists with another command (such as lint
), you must prefix the command with script
.
inso script lint
inso lint # will not work
Any options passed during script execution will be forwarded to the script:
inso gen-conf # generates declarative config (default)
inso gen-conf:k8s # generates kubernetes config
inso gen-conf:k8s -t declarative # generates declarative config
inso gen-conf:k8s -o output.yaml # generates kubernetes config to output.yaml