Manage isolated environment variables
Using fisher:
fisher add codeindulgence/biome-fishAdd your variables to a file named .biome in your project directory.
mkdir ~/myproject
echo "MYVAR=myvalue" > ~/myproject/.biomeEnter the biome!
cd ~/myprojectEntering biome: myproject
+ MYVAR: myvalue
Exit the biome...
cd ~Exiting biome: myproject
- MYVAR: myvalue
Sub directories also work!
mkdir -p ~/myproject/myfolder
cd ~/myproject/myfolderEntering biome: myproject
+ MYVAR: myvalue
Remember previous values!
cd ~
MYVAR=myoldvalue
cd ~/myprojectEntering biome: myproject
- MYVAR: myoldvalue
+ MYVAR: myvalue
cd ~Exiting boime: myproject
- MYVAR: myvalue
+ MYVAR: myoldvalue
Guard your secrets!
echo API_KEY=mysupersecretapikey0001 >> ~/myproject/.biome
echo DB_PASS=mysupersecretdbpass0002 >> ~/myproject/.biome
echo APP_SECRET=mysupersecretappsecret0003 >> ~/myproject/.biome
cd ~/myprojectEntering biome: myproject
- MYVAR: myoldvalue
+ MYVAR: myvalue
+ API_KEY: *******************0001
+ DB_PASS: *******************0002
+ APP_SECRET: **********************0003
Guard them both ways!
cd ~
API_KEY=mysupersecretapikey0004
cd ~/myprojectEntering biome: myproject
- MYVAR: myoldvalue
+ MYVAR: myvalue
- API_KEY: *******************0004
+ API_KEY: *******************0001
+ DB_PASS: *******************0002
+ APP_SECRET: **********************0003
cd ~Exiting biome: myproject
- MYVAR: myvalue
+ MYVAR: myoldvalue
- API_KEY: *******************0001
+ API_KEY: *******************0004
- DB_PASS: *******************0002
- APP_SECRET: **********************0003
The following options can be changed using set -g <option> <value>
-
_biome_auto- Sets biome to load variables automatically as you change directories. Set
to false for full manual mode and call
biome enter/exitwhen you want. That way you can load biomes from other directories. - Default:
true - Example:
set -g _biome_auto false biome enter ~/myproject biome exit
- Sets biome to load variables automatically as you change directories. Set
to false for full manual mode and call
-
_biome_mask_char- Sets the character used to mask sensitive values. Want something cool? Consider Nerd Fonts
- Default:
* - Example:
set -g _biome_mask_char 'x'
-
_biome_filename- Sets the filename used for biome variables
- Default:
.biome - Example:
set -g _biome_filename .env
-
_biome_prefix- Sets a prefix for where .biome files are stored. When set checks for .biome files will be made in this path. That way you can keep all your dotfiles in one place and manage them with your other dotfiles.
- Default: (nothing)
- Example:
set -g _biome_prefix ~/.config/biomes/ echo "MYPREFIXVAR=myprefixvalue" > ~/.config/biomes/myproject.biome cd ~/myproject
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D