sbenv - SyftBox Environment Manager
A virtualenv-like tool for managing isolated SyftBox environments. Create, activate, and manage multiple SyftBox instances without conflicts.
Installation
Quick Install (via curl)
|
Install from crates.io
Build from Source
Quick Start
1. Install Shell Integration
First, install the shell helper utilities for your shell:
Note: If your shell doesn't look like this with nice text on the right, then open a PR to fix it:
~/datasites/me@madhavajay.com ✔ 📦 me@madhavajay.com
This will detect your shell (bash/zsh) and add the necessary functions to your shell configuration file.
2. Create an Environment
This creates a new SyftBox environment in the current directory.
Dev mode
Dev mode sets SYFTBOX_AUTH_ENABLED=0 and defaults to localhost:8080. You can override that with the --server_url param.
Notes:
- With
--dev, defaultserver_urlishttp://localhost:8080(overridable). - Without
--dev, defaultserver_urlishttps://syftbox.net. - In dev mode,
sbenv startandsbenv loginrun syftbox withSYFTBOX_AUTH_ENABLED=0.
3. Activate an Environment
Or use the shell function (after installing shell integration):
Your prompt will change to show the active environment:
~/datasites/me@madhavajay.com ✔ 📦 me@madhavajay.com
4. Start SyftBox
Once activated, start the SyftBox instance:
5. Deactivate
When done, deactivate the environment:
Or use the shell function:
Commands
Environment Management
# Create a new environment
# Remove an environment
# Show current environment info
# Show environment status
Activation
# Activate an environment
# Deactivate current environment
SyftBox Control
# Start SyftBox in current environment
# Stop SyftBox in current environment
# View SyftBox logs
Environment Structure
Each environment is isolated in ~/.sbenv/envs/<name>/ with:
apps
datasites
.syftbox <- config.json and logs go in here
Tips
- Each environment runs its own SyftBox instance on a unique port
- Environments are completely isolated from each other
- Use
sbenv infoto see details about the current environment - Use
sbenv statusto check if SyftBox is running
Troubleshooting
Shell functions not working
Make sure you've run sbenv install-shell and restarted your terminal or run:
# or
Port conflicts
Each environment automatically gets a unique port. If you have port issues, check:
SyftBox won't start
Check the logs for the current environment:
Requirements
- Rust 1.70+ (for building from source)
- Bash or Zsh shell (for shell integration)
- SyftBox installed on your system
License
Apache-2.0