sht / short / 🩳
A concise cli launcher / project manager using env files.
The main goal it's readability and time saving with commands use in your project. Short it's command-line tool that allow to run program (usually sh script) with environment variables mapping from .env files. It take care to synchronize and to check the format of all env files to each others. Allow to store critical environment files in private paths that not shared in the project source code. You can apply a mapping in order to select, group and add custom format / cases on the fly on the variables. The result of mapping will be inject as environment variables in the output .sh script that will be executed.
It's include an index/registry that allow to share project templates: 🎁 template-index.
Install
cargo install short
Configure prompt
Example with PS1 configure by .bashrc
export PS1="$(sht show -f):\w\$ "
Example with custom pre-prompt : starship.
Here the custom script that starship run before display prompt.
#!/bin/bash
starship_precmd_user_func=blastoff
Quick start with template
Generate an simply aws sam project base on this template aws-node-sam.
Requirement : You have installed SAM and AWS_CLI.
$> sht init
$> sht generate aws-node-sam -d -t
$> sht run
-t
: generate from template.
-d
: create a sub directory.
Quick start blank
Generate a simply bash script who display variables. You can use this base for do as you want.
$> sht init
$> sht generate setup_1 test -d
$> sht run
-d
: create a sub directory.
⚠️ wip ...
- TODO : tutorials step by step.
- TODO : command documentations.
Help
USAGE:
sht [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
init Init project, create an empty "short.yaml" configuration file.
generate Generate empty setup or from template setup repository.
run Run setup [ARGS...].
rename Rename setup.
new Create env file ".<env>", in public directory by default.
sync Sync env files.
edit Edit env file.
dir Public env directory, [.] by default.
pdir Private env directory, unset by default.
show Show your current setup.
use Switch of current setup or/and environment.
ls Display setups and environments available.
vars Display mapping environment variables.
envs Display environment variables.
help Prints this message or the help of the given subcommand(s)