Environments
Environments allow you to manage multiple isolated profiles within bssh. Each environment maintains its own independent database of connections, tags, aliases, session history, and default configuration.
What is isolated
Section titled “What is isolated”Every environment is stored in its own directory under ~/.config/bayesian-ssh/environments/<name>/:
history.db: An independent SQLite database containing:- Saved connections and credentials
- Tags and groups
- Short aliases
- Past session history and durations
- Configured inventory sources
config.json: Profile-specific settings, including:- Default SSH username and port
- Default bastion and bastion username
- Search mode (
bayesianorfuzzy) - Session recording settings
- Context prediction settings
The built-in initial environment is named default. Your currently active environment is tracked in ~/.config/bayesian-ssh/active_env.
Manage environments
Section titled “Manage environments”List environments
Section titled “List environments”Run bssh env list to view all available environments. The currently active profile is marked with an asterisk:
bssh env listEnvironments: client-a * default (active)Create an environment
Section titled “Create an environment”Run bssh env create with a unique name to initialize a new profile:
bssh env create client-a✅ Created new environment 'client-a'To start using it, run: bayesian-ssh env use client-aCreating an environment generates a clean history.db database and a fresh config.json pre-populated with standard defaults.
Switch environments
Section titled “Switch environments”Run bssh env use to switch your active profile:
bssh env use client-a✅ Now using environment 'client-a'Once switched, all subsequent bssh commands operate on the selected environment’s database until changed again.
Remove an environment
Section titled “Remove an environment”Run bssh env remove to delete an environment and its stored database:
bssh env remove client-a🗑️ Removed environment 'client-a'bssh enforces safety constraints when deleting environments:
- You cannot delete the currently active environment. Switch to another environment first.
- You cannot delete the built-in
defaultenvironment.
Desktop app support
Section titled “Desktop app support”# Switch profile from the terminalbssh env use client-aIn the desktop app, click the profile selector at the top of the sidebar to switch between profiles, or choose Manage profiles… to add or remove profiles.
Per-invocation override
Section titled “Per-invocation override”To run a single command in another environment without switching your persistent active profile, pass the --env flag:
# List connections in the client-b environmentbssh --env client-b list
# Connect to a host stored in client-bbssh --env client-b connect db-prod
# Check reachability of hosts in client-bbssh --env client-b ping --allThe --env flag takes precedence for that execution only. Your active environment remains unchanged.
Typical workflows
Section titled “Typical workflows”- Client separation: Consultants and agencies can maintain dedicated environments for each client (
client-acme,client-beta). Connections, bastion routes, and aliases never mix or appear in another client’s search results. - Work and personal: Keep your personal home lab and hobby VPS instances completely isolated from corporate production infrastructure.
- Compliance and audits: Configure strict session recording and mandatory bastion routes in a
productionenvironment, while leaving asandboxenvironment unrestricted.