Crates.io | loco-cli |
lib.rs | loco-cli |
version | 0.12.0 |
source | src |
created_at | 2023-11-23 12:05:19.30992 |
updated_at | 2024-10-28 06:42:49.758522 |
description | loco cli website generator |
homepage | https://docs.rs/loco-cli |
repository | |
max_upload_size | |
id | 1046048 |
size | 114,181 |
Loco CLI is a powerful command-line tool designed to streamline the process of generating Loco websites.
To install Loco CLI, execute the following command in your terminal:
cargo install loco-cli
This command generates a website in your current working directory:
loco new
To generate the website in a different directory, use the following command:
loco new --path /my-work/websites/
When working with loco-cli against the local Loco repository, you can utilize the STARTERS_LOCAL_PATH
environment variable to point the generator to a local starter instead of fetching from GitHub.
cd loco-cli
$ STARTERS_LOCAL_PATH=[FULL_PATH]/loco-rs/loco cargo run new --path /tmp
This CLI depends on a folder with starters. Each starter is a folder with a generator.yaml
in its root.
The generator.yaml
file describes:
For example:
...
rules:
- pattern: loco_starter_template
kind: LibName
file_patterns:
- rs
- toml
- trycmd
- pattern: PqRwLF2rhHe8J22oBeHy
kind: JwtToken
file_patterns:
- config/test.yaml
- config/development.yaml
The options are picked up in generation, for each option a selection is made for the user to pick.
For example:
---
description: SaaS app (with DB and user auth)
options:
- db
- bg
- assets
rules:
# ...
As an example, for the db
option: postgres
or sqlite
is offered as a selection.
The source of truth of which options exist and which selection for each option is based on 2 factors:
Enabling or disabling options are done by:
(block-name-start)
, etc)