Skip to content

Hlambda CLI

$ npm install -g hlambda-cli

How to use Hlambda CLI

$ hlambda

Image title

To ge the version:

$ hlambda --version

create new directory with the default codebase

$ hlambda init my-first-hlambda-app
$ cd my-first-hlambda-app

Change the admin_secret in the config.yaml manually or just run

$ hlambda config save --admin-secret "demo"

this will edit the config.yaml file and save admin secret value in that file (please take extra care when commiting config.yaml file to not leak secrets)

You can then export the existing metadata from the running server use

$ hlambda metadata export

or you can apply the changes by running

$ hlambda metadata apply
or run the hlambda metadata apply with option --admin-secret which is a prefered option to do this action instead of saving secret it in config.yaml

$ hlambda metadata apply --admin-secret <your_secret>

to export existing data from the hlambda server run

$ hlambda metadata export --admin-secret <your_secret>

Reloading metadata

By default metadata apply should also automatically reload the metadata on the server unless --no-auto-reload option is set

$ hlambda metadata apply --no-auto-reload

to do it manually you can run:

$ hlambda metadata reload

Clearing metadata

If you want to clear all the metadata from the server

$ hlambda metadata clear

Project layout

config.yaml                # The configuration file.
metadata/                  # Folder containing all the metadata.
  package.json             # List of your NPM packages used in your project.
  apps/                    # Folder containing mini apps
    example_demo_app/      # Sub folder for your demo app (totally optional, you can put your router. anywhere, even in metadata root)
      hlambda-config.yaml  # Mini app configuration, including env overrides
      router.index.js      # The entry point of your server.
      errors.demo.js       # Hlambda offers way to easily manage errors, you are never forced to use it.
      ...                  # other files...
  node_modules/            # Optional
    ...                    # other files...

To run this documentation locally

docker run --rm -it -p 8777:8000 -v ${PWD}:/docs squidfunk/mkdocs-material


docker run --rm -it -p 8777:8000 -v "%cd%":/docs squidfunk/mkdocs-material

to build the docs run:

docker run --rm -it -p 8777:8000 -v ${PWD}:/docs squidfunk/mkdocs-material build


docker run --rm -it -p 8777:8000 -v "%cd%":/docs squidfunk/mkdocs-material build
Back to top