Naive terminal variables manager.
{variable} or {{variable}} syntaxDownload one of the prebuilt binaries for your platform, then make it executable:
Example:
curl -L -o yuna https://github.com/ShogunPanda/yuna/releases/latest/download/yuna-linux chmod a+x yuna
If your platform is not available or you prefer to build from source, ensure you have Rust installed, then run:
cargo install yuna
# List all variables in the current directory and parent directories yuna # Set a variable yuna my_var "some value" # Set a variable with multiple words (they will be joined with spaces) yuna greeting Hello World from Yuna # Get a variable value yuna my_var # Delete a variable yuna -d my_var # or yuna --delete my_var # Show version yuna -V
Yuna stores variables in YAML files (.yuna.yml by default). The tool automatically:
.yuna.yml file in the current directory when you save a variable.yuna.yml files from all parent directories up to the rootYou can work with nested structures using dot notation:
# Set nested object values yuna database.host localhost yuna database.port 5432 yuna database.name myapp # Set array values yuna servers.0 "server1.example.com" yuna servers.1 "server2.example.com" # Read nested values yuna database.host
Variables can reference other variables using {var} or {{var}} syntax:
# Set base variables yuna base_url "https://api.example.com" yuna api_version "v1" # Use interpolation yuna api_endpoint "{base_url}/{api_version}" # When reading api_endpoint, it will show: https://api.example.com/v1 yuna api_endpoint
Options: -c, --configConfiguration file name [default: .yuna.yml] -d, --delete Delete a variable -n, --no-merge Do not merge with configuration files in parent folders -r, --raw Do not perform variable interpolation -V, --version Print version -h, --help Print help
When listing variables, Yuna displays a formatted table showing:
When you run Yuna, it searches for configuration files starting from the root directory down to your current directory, loading each .yuna.yml file it finds. Values from files closer to your current directory override those from parent directories. This allows for:
Example directory structure:
/ --- .yuna.yml # Global variables --- projects/ | --- .yuna.yml # Project-wide variables | --- my-app/ | --- .yuna.yml # App-specific variables | --- src/ | --- .yuna.yml # Source-specific variables
Yuna supports all YAML data types:
When the same variable is defined in multiple configuration files:
Copyright (C) 2021 and above Shogun (shogun@cowtech.it).
Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.