Using Externally Managed Environments¶
Zephyr IDE automatically detects and works with externally managed Zephyr environments.
If you already have Zephyr installed outside of Zephyr IDE (e.g., through Docker, a DevContainer, manual installation, or another workspace manager), the extension will automatically detect and use your existing installation through environment variables.
How It Works¶
When Zephyr IDE starts and no workspace is actively configured:
- Automatic Detection: The extension checks for the
ZEPHYR_BASEenvironment variable - Environment Warning: If neither
ZEPHYR_BASEnorZEPHYR_SDK_INSTALL_DIRis set, a warning appears with three options: - Continue: Proceed using system environment variables (commands may still work if tools are in PATH)
- Don't Show Again: Suppress this warning for the current workspace
- Setup Workspace: Open the Setup Panel to configure a workspace
When ZEPHYR_BASE is set, the extension:
- Assumes west and required packages are already installed in the environment
- Uses the detected Zephyr installation for all build operations
- Allows all commands (build, flash, debug) to run without workspace-specific configuration
- Shows a warning if environment variables are missing (unless suppressed with the setting above)
Setting Up Environment Variables¶
To use an externally managed environment:
-
Set the environment variable in your shell profile (
.bashrc,.zshrc, etc.): -
Start VS Code from a terminal that has these variables set:
-
Verify: All Zephyr IDE commands will use your environment-based setup
Suppressing the Environment Warning¶
If you prefer to work without setting ZEPHYR_BASE (e.g., using west commands directly), you can suppress the warning:
Option 1: Click "Don't Show Again" when the warning appears
Option 2: Manually add to .vscode/settings.json:
This setting prevents the warning from appearing, allowing you to work with system tools without additional prompts.
Use Cases¶
Externally managed environments are suitable for:
- Docker/DevContainer workflows: Environment variables are pre-configured in your container
- CI/CD pipelines: Build with pre-installed Zephyr in automated environments
- Shared development environments: Teams using a common Zephyr installation
- Manual installations: You have installed Zephyr following the official Zephyr Getting Started guide
- Multiple projects: Share one Zephyr installation across multiple project workspaces