Variable Groups
Learn about Variable Groups in Penflow
Variable Groups 🔄
Variable Groups in Penflow allow you to manage sets of environment variables that can be toggled across your sessions. This feature is particularly useful when you need to switch between different configurations, environments, or user profiles.
What are Variable Groups? 🤔
Variable Groups are collections of key-value pairs that can be:
- ✅ Enabled or disabled as needed
- 🎯 Used to template commands
Common Use Cases 📋
Here are some typical scenarios where Variable Groups are helpful:
-
Multiple Target Environments
- Development vs Production servers
- Different IP ranges or domains
- Various test environments
-
User Credentials
- Different user accounts
- Various authentication tokens
- Multiple API keys
-
Tool Configurations
- Different tool paths
- Alternate command flags
- Various output directories
Creating Variable Groups 🛠️
To create a new Variable Group:
- Press Ctrl+Shift+V to open the Variable Groups panel
- Click "New Variable Group"
- Give your group a name
- Add your key-value pairs
- Save the group
Fixed vs Regular Variable Groups 🔒
Penflow supports two types of variable groups:
Fixed Variable Groups ⚓
Fixed variable groups are designed for static, shared environment variables that remain constant across sessions. These are ideal for:
- 🌐 Fully Qualified Domain Names (e.g., app.example.com)
- 🎯 IP ranges in scope (e.g., 192.168.1.0/24)
- 🔌 Network interface names (e.g., eth0, tun0)
- 🏠 Local hostnames and addresses
Multiple fixed variable groups can be set up in your Penflow setup. However, be careful not to duplicate environment variables across groups as this may cause conflicts and inconsistencies in your shared environment settings.
Regular Variable Groups 🔄
Regular variable groups are dynamic and can be toggled on/off as needed. Only one regular variable group can be active at a time - enabling a new group will automatically disable any previously active group. These are perfect for:
- 🎯 Target-specific variables (e.g., DC_IP=10.10.10.10, TARGET_IP=192.168.1.10)
- 👤 User credentials (e.g., DOMAIN=contoso.local, USERNAME=administrator)
- 🔑 API keys and tokens (e.g., API_KEY=abcd1234, JWT_TOKEN=xyz789)
- 🌍 Environment-specific settings (e.g., LHOST=tun0, LPORT=4444)
Unlike fixed groups, multiple regular variable groups can be active simultaneously, allowing for flexible configuration combinations.
Security Considerations 🔒
While working with sensitive variables like credentials and API keys, it's important to note:
-
✅ Everything Stays Local: All variable groups and their values are stored exclusively in your browser's local storage. Nothing is ever sent to any remote servers.
-
🔐 Export Safety: When you export a session, variable group values are NOT included in the export file. This ensures sensitive data remains private even when sharing sessions.
-
💡 Best Practice: Even though data stays local, it's recommended to use meaningful but non-sensitive placeholder (we let you decide, once again variable group are excluded from export)
Remember: Your browser's local storage is specific to your device and browser profile. Clearing browser data will also clear your variable groups, so make sure to back up any critical configurations separately.
Managing Fixed Variables 🛠️
To set up your fixed variable group:
-
Open the Variable Groups panel 1.1 On the dock bar click on the variable group icon (x) 1.2 Or rigt click on a speicif node and go to command section and then click on the variable group button 1.3 Or Ctrl+Shift+V
-
Click "Add variable group"
-
Add your shared environment variables
-
Set is as fixed or not and enable it
-
Watch all your commands and notes update with the new variable group
Using Variables in Commands 📝
You can use variables in your commands using the {{variableName}} syntax.
Once a variable has been set and registered, any command that references that variable using the variableName syntax will automatically have the variable placeholder replaced with its actual value.
For example, if you set TARGET_IP=192.168.1.10, then a command like "ping {{TARGET_IP}}" would automatically become "ping 192.168.1.10" in the whole session.
And that's all there is to it! With variable groups, you can quickly switch between different contexts without having to remember and manually update command parameters at ALL. Just enable the variable group you need and all your commands will automatically update. copy paste and go!
Synchronized everywhere even in gloval command table view (Ctrl+Shift+T / command view)