A virtualenv-like tool for managing isolated SyftBox environments. Create, activate, and manage multiple SyftBox instances without conflicts.
curl -sSL https://raw.githubusercontent.com/openmined/sbenv/main/install.sh | bash
cargo install sbenv
git clone https://github.com/openmined/sbenv
cd sbenv
cargo build --release
sudo cp target/release/sbenv /usr/local/bin/
First, install the shell helper utilities for your shell:
sbenv install-shell
Note: If your shell doesn't look like this with nice text on the right, then open a PR to fix it:
~/datasites/[email protected] ξ° ξ² β π¦ [email protected]
This will detect your shell (bash/zsh) and add the necessary functions to your shell configuration file.
sbenv init
This creates a new SyftBox environment in the current directory.
Dev mode sets SYFTBOX_AUTH_ENABLED=0 and defaults to localhost:8080. You can override that with the --server_url param.
sbenv init --dev # defaults server_url to http://localhost:8080
sbenv init --dev --server_url https://dev.syftbox.net
sbenv init --server_url https://custom.server
Notes:
- With
--dev
, defaultserver_url
ishttp://localhost:8080
(overridable). - Without
--dev
, defaultserver_url
ishttps://syftbox.net
. - In dev mode,
sbenv start
andsbenv login
run syftbox withSYFTBOX_AUTH_ENABLED=0
.
sbenv activate
Or use the shell function (after installing shell integration):
sba
Your prompt will change to show the active environment:
~/datasites/[email protected] ξ° ξ² β π¦ [email protected]
Once activated, start the SyftBox instance:
sbenv start
When done, deactivate the environment:
sbenv deactivate
Or use the shell function:
sbd
# Create a new environment
sbenv create <name>
# Remove an environment
sbenv remove <name>
# Show current environment info
sbenv info
# Show environment status
sbenv status
# Activate an environment
sbenv activate <name>
# Deactivate current environment
sbenv deactivate
# Start SyftBox in current environment
sbenv start [--skip-login-check]
# Stop SyftBox in current environment
sbenv stop
# View SyftBox logs
sbenv logs [--lines <n>] [--follow]
Each environment is isolated in ~/.sbenv/envs/<name>/
with:
apps
datasites
.syftbox <- config.json and logs go in here
- Each environment runs its own SyftBox instance on a unique port
- Environments are completely isolated from each other
- Use
sbenv info
to see details about the current environment - Use
sbenv status
to check if SyftBox is running
Make sure you've run sbenv install-shell
and restarted your terminal or run:
source ~/.bashrc # for bash
# or
source ~/.zshrc # for zsh
Each environment automatically gets a unique port. If you have port issues, check:
sbenv status # Shows port information
Check the logs for the current environment:
sbenv logs --lines 50
- Rust 1.70+ (for building from source)
- Bash or Zsh shell (for shell integration)
- SyftBox installed on your system
Apache-2.0