Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biome: Fish Edition

Manage isolated environment variables

Installation

Using fisher:

fisher add codeindulgence/biome-fish

Usage

Add your variables to a file named .biome in your project directory.

mkdir ~/myproject
echo "MYVAR=myvalue" > ~/myproject/.biome

Enter the biome!

cd ~/myproject
Entering biome: myproject
+ MYVAR: myvalue

Exit the biome...

cd ~
Exiting biome: myproject
- MYVAR: myvalue

Sub directories also work!

mkdir -p ~/myproject/myfolder
cd ~/myproject/myfolder
Entering biome: myproject
+ MYVAR: myvalue

Remember previous values!

cd ~
MYVAR=myoldvalue
cd ~/myproject
Entering 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 ~/myproject
Entering biome: myproject
- MYVAR: myoldvalue
+ MYVAR: myvalue
+ API_KEY: *******************0001
+ DB_PASS: *******************0002
+ APP_SECRET: **********************0003

Guard them both ways!

cd ~
API_KEY=mysupersecretapikey0004
cd ~/myproject
Entering 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

Configure

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/exit when you want. That way you can load biomes from other directories.
    • Default: true
    • Example:
      set -g _biome_auto false
      biome enter ~/myproject
      biome exit
  • _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

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Credits

Nick Butler

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages