CLI Options
jko provides a set of options that allow you to configure the process's input and output, including:
- Optional input files for
jko, jkoconsole output,- Environment settings for your scripts.
Available options are:
-
--config-file: Specifies a custom configuration file forjko. -
--env-file: Allowsjkoto load environment variables from a specified file, supplementing the system’s environment. This is particularly useful for testing environments or when runningjkoin different, predefined setups. -
--log: Sets the log level forjko. Depending on the provided value ("error", "warn" or "info"),jkowill display messages according to the desired verbosity, helping to manage output detail during execution. -
--package-manager: Determines which package manager should be used for dependency installations. By specifying a package manager (npmoryarn), users can ensure thatjkoemploys the correct tool for managing packages.
Each option must be assigned a value:
$ jko --option1=value1 ... --option5=value5 yourScript
Each option has a short version:
-c=--config-file.-e=--env-file.-l=--log.-p=--package-manager.
e.g.
Instead of:
$ jko --log=error yourScript
You can use:
$ jko -l=error yourScript
To review available options from command line, execute:
$ jko --help
--config-file
--config-file allows the user to specify a custom configuration file for jko, overriding the default settings defined in jko.js (or package.json).
--config-filecan specified any.js,.mjs,.cjsor.jsonfile.- The file path must start with
/,./, or `.
- The file path must start with
$ jko -c=./path/to/config.js ...
--config-filecan specified a package.- The package must be available, i.e. it must be installed first.
$ jko --config-file=somePackageName ...
--config-file is the only option available exclusively via the CLI; all other options can be set in configuration files
(for example, in jko.js, package.json, or even the file specified using --config-file), e.g. the --env-file option can be defined using the envFile field.
Options vs Arguments
- Options are values that you pass to the
jko. - Arguments are values passed to your script.
- Options are defined after
jko. - Arguments are defined after your script.
⬇️
$ jko --option1=value1 ... --option5=value5 yourScript arg1 ... argN
- Options are used internally by
jko. - Arguments are used internally by your script.