Skip to content

Command Line Interface

Param Siddharth edited this page Aug 12, 2021 · 2 revisions

Command-Line Interface

The Jugaadu Rema CLI is the central tool used

The CLI can be accessed using either jrema or jugaadu-rema.

Quickstart:

jrema -l records.csv -t stock/templates/brilliance.json -d visible

The following options are available in the CLI:

Options Description
--help Shows usage help.
--version Shows the version number.
-b, --base-route [/] The base route on which the build will be mounted (default: /).
-l, --list [records.csv] The CSV file to use for generating the certificates in bulk (default: records.csv).
-k, --output [output.csv] The CSV file to be generated with the updated records (default: output.csv).
-t, --template [template.json] The exported JSON file representing the template (default: template.json). It can be
-d, --directory [absent|visible|hidden] Defines whether or not include the directory page i. e. A listing of all certificates (default: absent).
-s, --static-dir [static] The static directory to be used for static resources (images) if any (default: static).
-o, --build-dir [build] The build directory i. e. Where the static site is generated.
--no-minify Setting this turns off minification.
--preview Setting this generates a template preview along with the certificates.

--help

Shows usage help.

jrema --help
...
Welcome to Jugaadu Rema. 🔥
Generates a deployable Jugaadu static build of Rema.

Usage: jrema <options>

Options:
...

--version

Display the application version.

jrema --version
...
Welcome to Jugaadu Rema. 🔥
x.0.0

-b, --base-route

This flag is used to specify the base route on which the static build will be mounted while hosting.

This is useful, especially in cases where the certificates are to be mounted onto a different base route. For example, while deploying to GitHub Pages, the base route may not be / unless the repository is of the form username.github.io or a custom domain is connected. Also, it might be the customary need to use a route like /certificates or /event for mounting the build.

The default value is /, which means all absolute URLs will take / as the base route in the final build.

jrema -b /

-l, --list

This flag points to the CSV file containing the records to be used for certificate genetation.

The record file follows a format similar to the one accepted in the bulk certificate generation route in the original Rema, which has each column representing a value for a particular field in the template and may or may not contain bulk placeholders.

The default value is records.csv (in the present working directory).

-k, --output

This flag represents the output list to be generated with updated records.

The output CSV file contains all records from the original input CSV, with an addition of the uid column and a few others representing additional metadata.

The default value is output.csv (in the present working directory).

-t, --template

This flag names the exported template JSON file to be used for generating all certificates using the given records.

The JSON file may be exported from Rema or written by hand. In either case, the resources may either be embedded as data URIs or provided a path/URL to, in which case Jugaadu Rema would look for it in the following (in the same order):

  • URL
    • The Internet or the available network.
  • Path
    • The current working directory.
    • The provided static directory.
    • The internal static directory.

To use a stock template, say the template named of the form stock-<name>, you may use stock/tempaltes/<name>.json, which is nothing but the path to the stock template JSON relative to the internal static directory.

The default value is tempalte.json (in the present working directory).

-d, --directory

This flag can be used to decide the visibility of the certificate directory page, a page that lists all certificates with their respective UIDs.

The following values are allowed:

  • absent (default) : The directory page will not be generated.
  • visible : The directory page will be generated and a link to it will be added to the homepage.
  • hidden : The directory page will be generated but a link to it will not be added to the homepage.

-s, --static-dir

This flag can be used to point to the directory containing static resources (images) relatively referenced by the template JSON. One such directory may or may not be needed, depending on whether or not any static files are referenced.

E. g. If the template references images/mybg.png as the background image, then images/mybg.png must be located within the static directory.

The default value is static (in the present working directory). Specifying a static directory is not required and not necessary for certificate generation, depending on the template used.

-o, --build-dir

This flag specifies the directory where the static site is outputted after generation.

The default value is build (in the present working directory).

--no-minify

This boolean flag, when set, turns off minification for the generated build.

Minification is turned on by default.

--preview

This boolean flag, if set, generates a preview of the template inside the static site.