Environment Setup
FluxLoop automatically detects and uses your project’s Python environment so experiments, CLI commands, and the Integration Assistant run inside the correct interpreter.
Python Requirements
• FluxLoop CLI → Python 3.8+
• FluxLoop SDK & MCP → Python 3.11+ (required for Flux Agent)
Quick Setup
- Create / activate a venv
python3.11 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate - Install FluxLoop packages
pip install fluxloop-cli fluxloop fluxloop-mcp - Select execution mode
- Command Palette →
FluxLoop: Select Environment - Choose Auto (detect project environment) or Workspace only
- If dependencies are missing the wizard offers automatic install or manual instructions
- Command Palette →
- Verify detection
- Command Palette →
FluxLoop: Show Environment Info - Confirm Python/fluxloop/fluxloop-mcp paths point to
.venv - View → Output → FluxLoop for detailed logs
- Command Palette →
- Set Target Source Root…
- Projects view → Target Source Root…
- Select the directory containing your actual agent code (Flux Agent uses this for analysis)
FluxLoop now uses this environment for experiments, CLI commands, and Integration Assistant runs.
Automated Setup Script
For faster onboarding run:
cd your-project
bash packages/cli/scripts/setup_fluxloop_env.sh \
--python python3.11 \
--target-source-root ./src
The script:
- Creates
.venv(if needed) - Installs CLI, SDK, MCP
- Writes
.vscode/settings.jsonwithfluxloop.executionMode,fluxloop.targetSourceRoot,fluxloop.projectRoot - Updates
configs/project.yaml → source_root - Runs
fluxloop doctor
The VS Code project wizard exposes this as Run Setup Script.
Execution Modes
Choose how FluxLoop locates executables:
| Mode | Description | Use When |
|---|---|---|
| Auto (default) | Detect .venv, Poetry, Conda, uv; fallback to PATH | General use |
| Workspace only | Require a project-local venv; fail otherwise | Teams enforcing per-project envs |
| Global PATH | Always use global executables (pipx, Homebrew) | Quick prototyping |
| Custom executables | Manually specify Python + fluxloop-mcp paths | Complex Conda/pyenv setups |
Set via:
- Command Palette →
FluxLoop: Select Environment - Integration view → System Status → Select Environment
.vscode/settings.json:{
"fluxloop.executionMode": "auto",
"fluxloop.pythonPath": "/custom/python",
"fluxloop.mcpCommandPath": "/custom/fluxloop-mcp"
}
Target Source Root
Defines where FluxLoop searches for envs and source files (also used by Flux Agent).
Projects view workflow
- Expand your project
- Click Target Source Root…
- Choose a folder (relative paths stored automatically)
- FluxLoop refreshes detection and logs the results
Manual configuration
# configs/project.yaml
source_root: "./backend"
Monitoring Environment Status
Show Environment Info
FluxLoop: Show Environment Info → quick modal with:
- Source root
- Execution mode
- Python/fluxloop/fluxloop-mcp paths
- Detection notes (missing packages, etc.)
Output Channel
View → Output → select FluxLoop. Every refresh prints:
[FluxLoop Env] Source root: /Users/me/src/app
[FluxLoop Env] Environment: venv
[FluxLoop Env] Python: .../.venv/bin/python
[FluxLoop Env] fluxloop: .../.venv/bin/fluxloop
[FluxLoop Env] fluxloop-mcp: .../.venv/bin/fluxloop-mcp
[FluxLoop Env] Notes:
[FluxLoop Env] • fluxloop-mcp not found; install fluxloop-mcp in this environment.
Doctor
Run comprehensive diagnostics:
- Command Palette →
FluxLoop: Run Doctor - Integration view → System Status → Run Doctor
- Terminal →
fluxloop doctor [--json]
Doctor checks Python, venv, CLI, SDK, MCP, knowledge index, and config structure.
Common Scenarios
uv
uv venv && source .venv/bin/activateuv pip install fluxloop-cli fluxloop fluxloop-mcp- (Optional)
FluxLoop: Configure Execution Wrapper → uv run
pipx
pipx install fluxloop-cli/pipx install fluxloop-mcp- Install
fluxloopSDK in your project venv - Set execution mode to Global PATH
Conda
conda create -n agent python=3.11conda activate agentpip install fluxloop-cli fluxloop fluxloop-mcp- If VS Code doesn’t detect it automatically, use Custom executables and point to
/opt/conda/envs/agent/bin/python
Multiple Projects
- Each project stores its own execution mode, target source root, wrapper, etc.
- Switching projects triggers a fresh detection using the cached settings.
Troubleshooting
“Environment not detected”
- Run
FluxLoop: Show Environment Info - Check FluxLoop Output for errors
- Run
FluxLoop: Run Doctor - Ensure the selected interpreter actually contains
fluxloopandfluxloop-mcp:source .venv/bin/activate
which fluxloop
which fluxloop-mcp
“Commands use global Python instead of venv”
- Ensure
.venvexists under your target source root - Set execution mode to Auto or Workspace only
- Confirm
fluxloop.targetSourceRootpoints at the folder containing.venv
“Flux Agent says MCP missing”
- Verify MCP installed in active env
- Check doctor output for index path
- Rebuild index:
packages/mcp/scripts/rebuild_index.sh - Confirm
fluxloop.mcpCommandPathisn’t pointing to an old installation
“Wrong project analyzed”
- Run Target Source Root… again and choose the correct folder
- Ensure
configs/project.yaml → source_rootmatches your selection - Integration view displays the currently active source root in System Status