Hello young explorers! Today we’re going to learn about magical treasure chests called environment files! These special chests hold magical keys that help Tushell find different treasures!
Long ago, in the land of Tushell, wizards needed a way to keep their magical keys organized. Some keys opened doors to secret gardens, while others unlocked treasure vaults or activated magical mirrors!
The wise wizards created special treasure chests that could hold different collections of keys. Each chest was labeled with a special name ending in .env (like .env.Mia or .env.Miette).
Each magic chest (environment file) holds special magical keys with secret values:
# Inside a magic chest called .env.Mia
EH_API_URL=https://miadi.vercel.app
EH_TOKEN=abracadabra123
EH_ENV_NAME=Mia's Treasure Vault
These magical words tell Tushell:
EH_API_URL)EH_TOKEN)EH_ENV_NAME)When you want to use a different treasure chest, you use the magic words --env followed by the name of the chest:
# This uses the default magic chest
tushell scan-keys
# This uses Mia's special magic chest
tushell --env .env.Mia scan-keys
The scan-keys spell will show different magical keys depending on which chest you opened!
When you use the scan-keys spell with different magic chests, you’ll see something like:
Loaded environment variables from .env.Mia
🔑 Scanning keys using Mia's Treasure Vault environment 🔑
Found 42 keys:
redstones:
- redstones:vcu.CeSaReT.jgwill.tushell.42
- redstones:mia.echo.resonance
Trace:
- Trace:042a0ea2
- Trace:072e28a3
The most powerful wizards know how to give their magic chests special names! Inside your chest, you can add a magical spell called EH_ENV_NAME:
# Inside .env.Special
EH_ENV_NAME=Rainbow Castle
EH_API_URL=https://rainbowcastle.vercel.app
EH_TOKEN=magical_rainbow_password
Now when you say:
tushell --env .env.Special scan-keys
You’ll see:
🔑 Scanning keys using Rainbow Castle environment 🔑
Isn’t that amazing? Your magic chest now has its own special name!
Let’s create your very own magic treasure chest:
.env.YourNameEH_ENV_NAME=YourName's Magical Collection
EH_API_URL=https://example.com
EH_TOKEN=your_secret_password
tushell --env .env.YourName scan-keys
Want to see what magical keys and values are in your treasure chest? Use the magic --debug word:
tushell --env .env.YourName scan-keys --debug
This will show you all the magical secrets inside your chest (except it keeps part of your password hidden, because good wizards protect their secrets!).
.env files) hold different magical keys--env to choose which magic chest to openEH_ENV_NAME to give your chest a special name--debug to peek inside and see what magical values are storedNow you’re ready to explore all the different magical treasures in the land of Tushell! Which magic chest will you open first?
Next Adventure: Meet the Magical Keyring with ScanKeys! 🔑