Crates.io | setuprs |
lib.rs | setuprs |
version | 0.1.6 |
source | src |
created_at | 2024-07-20 07:17:07.437746 |
updated_at | 2024-07-27 06:55:13.326962 |
description | setuprs is a versatile CLI and TUI application designed to streamline project management by enabling quick creation and cloning of project snapshots. Utilizing clap.rs for command-line functionality and ratatui.rs for an interactive text interface, setuprs offers a user-friendly solution for managing and replicating project scaffolds efficiently. |
homepage | https://github.com/vitordeoliveira/setuprs |
repository | https://github.com/vitordeoliveira/setuprs |
max_upload_size | |
id | 1309282 |
size | 100,064 |
setuprs
is a powerful command-line interface (CLI) and text user interface
(TUI) application designed to simplify and accelerate the process of creating
snapshots of projects. By leveraging clap.rs
for CLI functionality and
ratatui.rs
for TUI features, setuprs
allows users to easily "clone"
scaffolds of snapshots, streamlining project setup and management.
clap.rs
.ratatui.rs
.
(in beta)It is not done yet, not possible to install
if you want to test the beta of the beta just clone and run
Usage: setuprs [OPTIONS] [COMMAND]
Commands:
snapshot Snapshot commands
config Configuration options
init Prepare folder to create a snapshot
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <TOML FILE> Sets a custom config file
-h, --help Print help
-V, --version Print version
# to initialize the folder that will be a snapshot
setuprs snapshot init
# to create a snapshot of your current dir
setuprs snapshot create
# to clone a snapshot of your current dir
setuprs snapshot clone <snapshot_name_tag> -d <path_to_clone>
setuprs
allows you to define variables in a setuprs.toml
file. This makes
it easy to customize your project templates. Define your variables as follows:
For example:
[[variables]]
name = "variable_name"
default = "default_value"
You can use these variables in your project files by enclosing the variable name in double curly braces. For instance, if you have defined a variable project_name, you can use it in your files like this:
{{project_name}}
When you clone a snapshot, the CLI will prompt you to enter values for these
variables. If you don't provide a value, the default value specified in
setuprs.toml
will be used.
Define the tag of the snapshot (snapshot name) && variables in setuprs.toml
:
[project]
name = "example_snapshot"
[[variables]]
name = "project_name"
default = "my_project"
[[variables]]
name = "author"
Use these variables in your project files:
// main.rs
fn main() {
println!("Project: {{project_name}}, Author: {{author}}");
}
// random_file.txt
Project: {{project_name}}, Author: {{author}}
Create the snapshot
setuprs snapshot create .
Clone a snapshot:
setuprs snapshot clone example_snapshot -d ./new_project
The CLI will prompt you:
Enter value for project_name [default: my_project]:
Enter value for author:
This feature ensures that you can easily and quickly customize your project scaffolds during the cloning process.