Lenra cli
The Lenra's command line interface.
Getting Started
Prerequisites
To build and run the Lenra elements that handle your app, the Lenra CLI needs Docker and Docker Compose.
You can also install the Docker buildx command to use the Buildkit optimization given by Dofigen.
Install the Lenra CLI using one of the next possibilities.
Download the binary
You can download the binary from the release page and add it to your path environment variable.
Cargo install
First install Cargo, the Rust package manager: https://doc.rust-lang.org/cargo/getting-started/installation.html
Then use the next command to install the Lenra's cli:
Build it from sources
First install Cargo, the Rust package manager: https://doc.rust-lang.org/cargo/getting-started/installation.html
Then clone this repository and install it with Cargo:
How to use it
Use the help options to understand how to use it:
)
Subcommands
This tools contains many subcommands to help you doing what you need.
- new: creates a new Lenra app project
- build: builds the Lenra app of the current directory
- start: starts your app previously built with the build command
- stop: stops your app previously started with the start command
new
This subcommand creates a new Lenra app project from a given template and in a given directory. The target directory must not exist.
<TEMPLATE> The
https://github.com/orgs/lenra-io/repositories?q=&type=template&language=&sort=stargazers
<PATH> The
build
This subcommand builds the Lenra app of the current directory. The app configuration are defined by a configuration file.
start
This subcommand starts the Lenra app of the current directory previously built.
stop
This subcommand stops the Lenra app of the current directory and removes the Docker Compose elements.
Configuration file
The Lenra's configuration file describes your Lenra app configurations, like API versions or how to build it.
Here is an example using a Dofigen file:
componentsApi: "1.0"
generator:
dofigen: dofigen.yml
Configuration
The configuration is the main element of the file:
| Field | Type | Description |
|---|---|---|
componentsApi |
String | The components API version |
generator |
Generator The generator configuration |
Generator
The generator define your application is built. There are many configurators:
Dofigen
The Dofigen generator use a Dofigen configuration to generate the Docker image.
The Dofigen configuration can be the path to a Dofigen file or it content directly.
Docker
The Docker generator use a Dockerfile to generate the Docker image.
The Dockerfile can be the path to a file or it content directly.
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please open an issue with the tag "enhancement" or "bug". Don't forget to give the project a star! Thanks again!
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Lenra - @lenra_dev - contact@lenra.io
Project Link: https://github.com/lenra-io/lenra_cli