A command line interface for developing Coherent Gameface and Prysm projects
npm install -g coherent-cli
Or you can use:
npx coherent-cli <COMMAND>
To view a list of all available commands you can do:
coherent-cli help
To see a list of available options for a command you can do:
coherent-cli <COMMAND> --help
Creates boilerplates for Vanilla JS and React projects
coherent-cli create <PROJECT_NAME>
For example:
coherent-cli create my-app
When started it will prompt you to choose from a number of options to customize your project. After the command is done it will generate your boilerplate in the <PROJECT_NAME>
folder.
An important thing to note is that this CLI will create a config file called coh-config.json
which will be used by all of the other commands in the CLI.
Chooses the type of project you want to create and shows the appropriate prompts. This flag is optional, not providing it will prompt you to choose the type when creating the project.
Available options are no-framework
and react
coherent-cli create my-app --type react
Creates a default boilerplate. This flag only works in conjuction with the --type
flag. When you create a default boilerplate you will be prompted to choose if you want this to be a Gameface/Prysm UI project. Afterwards it will skip all of the other prompts.
coherent-cli create my-app --type react --default
This flag allows you to pass the path to a coh-config.json
file in order to copy the configuration of a boilerplate. When choosing to use a config all other flags will be ignored.
coherent-cli create my-app --config ./coh-config.json
This command allows you to create mock Gameface/Prysm models quickly. For more information about mocking models you can read here
Note: This command requires a valid coh-config.json with a correct path to a Gameface/Prysm package
coherent-cli create-mock-model <MODEL_NAME>
For example
coherent-cli create-mock-model MockedModel
will create a file called model.js
in the root of your project and add the following code inside
engine.on("Ready", () => {
engine.createJSModel("MockedModel", {});
engine.synchronizeModels();
});
which you can then edit to add your model properties
If you use the create-mock-model
command with a different name, it will add the new model to the model.js
file
Warning: If you have moved the generated model file to another location, a new model.js
file will be created when using the command.
Runs the Coherent CSS and HTML linter in your project, without needing to configure them locally
Note: This command requires a valid coh-config.json with a correct path to a Gameface/Prysm package
coherent-cli lint <FILE_TYPE>
You can lint either css
or html
file types
For example:
coherent-cli lint css
Watches selected file types for changes and lints them afterwards
coherent-cli lint css --watch
Allows you to lint a single file instead. This flag doesn't work if it's used alongside the --watch
flag
coherent-cli lint css --fileName ./style.css
Opens the Player.exe with a file or URL
Note: This command requires a valid coh-config.json with a correct path to a Gameface/Prysm package.
coherent-cli player <FILE_NAME|URL>
You need to provide a HTML file or valid URL(must start with the http or https protocol) which will be opened by the Player
For example:
coherent-cli player ./index.html
coherent-cli player http://localhost:8080
This flag allows you to update the package location in the coh-config.json
file.
coherent-cli player --update
You can use this flag without providing a file or URL, however if you choose to add them you will first be prompted to change the package location and then they will be opened from the new location
This flag allows you to pass a path to the coh-config.json
file.
coherent-cli player --config ./coh-config.json ./index.html