Short
A concise cli launcher / project manager using env files 🩳
Install / Use
/learn @vincent-herlemont/ShortREADME
sht / short / 🩳
A concise cli launcher / project manager using env files.
:warning: Deprecated branch, this project will be entirely rewritten.
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 is like to run eval $(.env_file) ./script.sh with more options.
- It take care to synchronize and to check the format of all environment files to each other.
- Prompt infos : You always known which is your current setup and environment.
- Allow multiple setups in the same project.
- Allow to store example of no critical environment file in your source code with a public env directory.
- Allow to store prod/stage/etc.. and critical environment file in your source code with a private env directory 🔒.
- You can apply a mapping in order to select, group and add custom formats / cases on the fly on the environment variables.
- The result of mapping will be inject as environment variables in the output .sh script that will be executed.

Install
This product is in alpha but for personal use it is reasonably stable.
ArchLinux AUR : short-git
git clone https://aur.archlinux.org/short-git.git
cd short-git
makepkg -si
Homebrew (OSX,Linux)
brew install vincent-herlemont/tap/short
From sources
Require for compilation : libgit2, openssl.
cargo install short
Configure prompt
It's really recommended to configure the prompt.
That allow to known every time which setup and
environment are selected.
You can see the command show for more details.
Example with PS1 configure by .bashrc
export PS1="$(sht show -f):\w\$ "
Example with PS1 configure by .zshrc
⚠️ TODO ...
</details>
<details>
<summary>✨ starship</summary>
Example with custom pre-prompt : starship.
Here the custom script that starship run before display prompt.
#!/bin/bash
function blastoff(){
sht show -f
}
starship_precmd_user_func=blastoff
Preview:
$> [my_setup:my_env] ~/your_project$
</details>
Quick start blank ✍️
Generate a simply sh script who display variables. You can use this base
for what as you want. See generate for more details.
sht generate <setup_name> <environment_name> <file_kind:sh|bash>
$> sht init
$> sht generate setup_1 test sh -d
$> sht run
-d: create a sub directory (optional).
Quick start with template 🚀
<details> <summary>🌱 Example with <b>Node && ExpressJs</b></summary>Generate a simply aws sam project base on this template node-express.
See generate for more details.
Requirement : You have installed node and npm.
$> sht init
$> sht generate node-express -d -t
$> sht run
-t: generate from template.
-d: create a sub directory (optional).
Generate a simply aws sam project base on this template aws-node-sam.
See generate for more details.
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 (optional).
You can list all templates available with sht generate -l and add a new one here.
- Commands
initproject - create an empty projectgeneratesetup - generate a setup inside a projectrunsetup - 🚀renamesetup - rename a setupnewenv - create new env filesyncenv - sync env fileseditenv - edit an env filedirenv directory - set/unset a public env directorypdirenv private directory - set/unset a private env directoryuseselect/switch your setup/environmentshowyour current setup / environmentlslist all setups and environmentsvarsdisplay/compare mapping environment variablesenvsdisplay/compare environment variables
- Configuration file
short.yaml - Concepts
Commands
init project.
Create an empty short.yaml configuration file. This one define the your project directory.
All short command inside of this folder and child's folders take for references this configuration file.
$> sht init
short.yaml (generated)
setups: {}
generate setup.
Generate an empty setup or a setup from a project templates repository, this command can be also list all available project templates.
<details> <summary><b>✍ Generate an empty setup ️</b></summary>| Arguments | Required | Description | | ---------- | -------- | ----------- | | <setup_name> | yes | Setup name | | <env_name> | yes | Env name | | <kind> | yes | File kind [sh,bash ...] |
| Options | Allow empty* | Default | Description | | ---------- | -------- | ------- | ----------- | | -d , --directory | yes | <setup_name> | Target directory. | | -p , --private| no | false | 🔒 Save to private directory. [conflict with "-d"] | | -f , --file| no | run.sh | Path script, create directory if they miss. [conflict with "-d"] | | -e , --env-directory| no | . | Public env directory. [conflict with "-d"] |
Example : create a setup named my_setup with .test environment file and bash script.
$> sht generate my_setup test bash
short.yaml (generated) : Configuration file.
setups:
my_setup:
file: run.sh
array_vars:
all:
pattern: ".*"
case: CamelCase
format: "[{key}]='{value}'"
delimiter: " "
vars: []
.test (generated) : Environment
Related Skills
tmux
354.3kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
diffs
354.3kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
blogwatcher
354.3kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
product
Cloud-agnostic Kubernetes infrastructure with Terraform & Helm for homelabs, edge, and production clusters.
