Build CLI apps with YAML
caml allows you to build command line applications using declarative yaml.
caml aims to be like make, but by using descriptive, declarative yaml.
Running the command without any arguments displays the commands defined in the caml.yaml file:
bin/camlcaml reads a file called caml.yaml in the current directory and converts those commands into a unified CLI command.
The basic structure is to have a command, which has a desc and an execute for the bash command to execute.
command:
desc: Command description
execute: script.shThis yaml will create the following command:
bin/caml command # Command descriptionAnd it will run any bash command defined.
Arguments may be added under args in a nested fashion as displayed below.
command:
args:
one:
desc: First argument
type: string
two:
desc: Second argument
type: stringbuild:
desc: Build our project
execute: make
clean:
desc: Clean our project
execute: make cleanbuild:
desc: Bundle
execute: bundle install
migrate:
desc: Migrate the test database
execute: rails db:migrate RAILS_ENV=test
test:
desc: Run tests
execute: rspec