@haetae/cli v0.0.21
@haetae/cli
CLI for Haetae.
š§ WIP
Commands: haetae <command>
The CLI's commands are dynamically generated at runtime, from config file's Command
s.
Reserved Static Commands
Reserved Static Commands are not generated. Rather, their behavior are statically fixed regardless of config file. Of course, they are reserved by Haetae. Thus, you should NOT define your own Command
whose name is overlapped with Reserved Static Commands.
store
: Currently,haetae store
is the only Reserved Static Commands.
Please note that, Reserved Static Commands are different from Reserved Dynamic Subcommands.
Usage
Commands like test
, lint
and bulid
from the below example are generated at runtime, which means that your result might be different by your config file's setting.
$ haetae --help
Usage: haetae [options] <command> [options] [<subcommand> [options]]
Incremental test, lint, build and more.
For any languages, platforms, and frameworks.
The CLI dynamically (at runtime) produces commands and subcommands by your config file.
Options:
-v, --version Show the version.
-c, --config <path> Config file directory or filename. It can be relative or absolute.
(default: $HAETAE_CONFIG_FILE or ./haetae.config.js)
-j, --json Format output to json if possible. This doesn't affect to commands
which has fixed format, or already json format. (default: false)
--no-color Disable colorized (e.g. red for error) / decorated (e.g. bold text)
output.
-h, --help Show helpful descriptions.
Commands:
store Show content of store file.
test User-defined command from config.
lint User-defined command from config.
build User-defined command from config.
Repo for any issues, questions and contribution(š):
https://github.com/jjangga0214/haetae
Examples:
$ haetae store
$ haetae --config /path/to/haetae.config.js test records # [NOTE] "records" is plural.
$ haetae --no-color lint record # [NOTE] "record" is singular.
$ haetae test target | jest # [NOTE] pipeline to your(any) test runner
$ haetae lint target | eslint # [NOTE] pipeline to your(any) linter/formatter
$ haetae --json test target | your-json-operator | your-test-runner
$ haetae build env
$ haetae lint save
$ haetae build --help
Subcommands: haetae <command> <subcommand>
Like CLI commands, CLI's subcommands are dynamically generated at runtime, from your config file's Subcommand
s.
Reserved Dynamic Subcommands
Unlike Reserved Static Commands, you CAN define Reserved Dynamic Subcommands on your own, in the config file.
They are "reserved", so Haetae expects your definitions to implement specific "contracts".
They are also "dynamic", so you can override default behaviors.
Currently all of them are optional, so if you do not define them, default configuration is used.
Otherwise are not generated. Rather, they are fixed statically and literally reserved by Haetae. Thus, you should NOT create your own Subcommand
whose name is overlapped with Reserved Commands.
target
:- contract: The corresponding function in config file should return an array of string(
string[]
). The array can be empty([]
). Though not required, in general, elements are (absolute) paths to files. - default (when not configured): Prints empthy string as stdout, not stderr.
- behavior: Prints every elements of the array. The output is delimited by
\n
by default, but printed as-is (javascript array) if--json
option is given.
- contract: The corresponding function in config file should return an array of string(
env
:- contract: The corresponding function in config file should return an object(json). The object can be empty(
{}
). - default (when not configured): Prints
{}
as stdout, not stderr. - behavior: Prints env object of your computer. Output is always json format.
- contract: The corresponding function in config file should return an object(json). The object can be empty(
save
:- contract: The corresponding function in config file should return an object(json). The object can be empty(
{}
). Though not required, in general, keys of object are package name for namespace to save their information for next execution. (e.g.{ '@haetae/git': { commit: "1803de" } }
) - default (when not configured): Prints
{}
as stdout, not stderr. - bahavior: This saves a record returned from corresponding function in config file. Store file is modified by this operation.
- contract: The corresponding function in config file should return an object(json). The object can be empty(
Please note that Reserved Dynamic Subcommands are different form Reserved Static Commands.
Usage
Command like test
and Subcommands like foo
from the below example are generated at runtime, which means that your result might be different by your config file's setting.
$ haetae test --help
Usage: haetae test [options] [command]
User-defined command from config.
Options:
-h, --help Show helpful descriptions.
Commands:
target Show targets.
env Show current env object.
save Save a new record to store file and show the new record.
records Show every records of given command.
record Show record of given command and current env.
foo User-defined subcommand from config.
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago