A portable, fully generic SDK environment manager for Windows (Go implementation).
- Manage and activate portable SDK environments for any toolchain (Python, Node.js, Java, Go, .NET, and more)
- No installation required for SDKs (xcopy/portable only)
- Supports global and per-project environments
- Generates activation scripts for PowerShell and CMD
- Extensible: add new SDKs/toolchains by dropping a YAML config in the
toolchainsfolder - All toolchain logic, prompts, and commands are defined in YAML—no Go code changes required
- Windows 11 (or Windows 10)
- Go 1.22+ (for building the tool)
- Portable SDKs for each language/toolchain you want to use
- Git (optional, for template .gitignore)
- Clone or download this repository
- Prepare SDKs:
- Download portable/xcopy versions of each SDK you want to use (e.g., Python, Node.js, Go, Java, .NET, etc.)
- Place them in the following folder structure (edit
--sdk-rootif you use a different path):envman_sdks/ python/3.12.1/ nodejs/20.10.0/ golang/1.22.3/ java/17.0.2/ dotnet/8.0.100/ - Each version folder should contain the SDK's
bindirectory and all required files for that SDK to run portably.
- Build envman:
- Open a terminal in the
envmanfolder - Run:
go build -o envman.exe - This will produce
envman.exein the current directory.
- Open a terminal in the
- (Optional) Add envman.exe to your PATH
- So you can run
envmanfrom any folder.
- So you can run
cd myproject
envman init
- Prompts you to select a toolchain and version, then runs the steps defined in its YAML config.
- Creates
envman.jsonin the current folder with your selection. - Optionally copies template files (e.g.,
.gitignore,README.md) if present in thetemplatesfolder.
envman list
- Shows all SDKs and versions found in your SDKs root.
envman select
- Prompts you to choose a version for each toolchain (default is latest).
- Updates
envman.json.
envman activate
- Generates
activate.bat(CMD) andactivate.ps1(PowerShell) in the current folder. - These scripts set up your shell to use the selected SDKs.
- Run the appropriate script in your shell to activate the environment.
envman deactivate
- (Currently, just a reminder. To fully deactivate, close your shell or manually restore your PATH.)
envman use local # Use the envman.json in the current folder
envman use global # Use the global envman.json (see below)
- Copies the selected config to
envman.jsonin the current folder.
- To set up a global environment, create a folder
%USERPROFILE%\.envmanand place anenvman.jsonthere. - Use
envman use globalto switch to it in any project.
- By default, envman looks for SDKs in
envman_sdksnext to the executable. - You can override this with the
--sdk-rootflag:envman init --sdk-root "D:/sdks" envman list --sdk-root "D:/sdks" # etc.
- To add a new toolchain, create a YAML config in the
toolchains/folder (see below). - To add a new SDK version, extract it to the appropriate folder under your SDKs root (e.g.,
python/3.12.1/). - Run
envman listto verify it is detected.
All toolchain logic is defined in YAML files in the toolchains/ folder. Each YAML file describes the steps, prompts, commands, and environment variables for initializing and activating a project.
name: Toolchain name (e.g., python, nodejs)steps: List of steps to run duringenvman init(prompt, select, run, file, message)env_vars: Mapping of environment variable names to values (for activation)
prompt: Prompt the user for a valueselect: Prompt the user to select from optionsrun: Run a command (with args)file: Write a file with given contentmessage: Print a messagewhen: (optional) Only run this step if the condition is true (supports{var}== "value")
name: python
steps:
- type: prompt
var: venv_dir
message: "Enter venv directory"
default: venv
- type: run
command: "{sdk_root}/python/{version}/python.exe"
args: ["-m", "venv", "{venv_dir}"]
- type: file
path: requirements.txt
content: |
# Add your dependencies here
- type: message
text: "Python venv created in {venv_dir}"
env_vars:
PYTHON_VERSION: "{version}"name: nodejs
steps:
- type: select
var: pkg_manager
message: "Choose package manager"
options: ["npm", "yarn"]
default: npm
- type: run
when: "{pkg_manager}" == "npm"
command: "{sdk_root}/nodejs/{version}/npm.cmd"
args: ["init", "-y"]
- type: run
when: "{pkg_manager}" == "yarn"
command: "{sdk_root}/nodejs/{version}/yarn.cmd"
args: ["init", "-y"]
- type: message
text: "Node.js project initialized with {pkg_manager}"
env_vars:
NODE_VERSION: "{version}"name: dotnet
steps:
- type: run
command: "{sdk_root}/dotnet/{version}/dotnet.exe"
args: ["new", "console"]
- type: message
text: ".NET console project created"
env_vars:
DOTNET_VERSION: "{version}"name: golang
steps:
- type: prompt
var: module_name
message: "Enter Go module name"
default: "{cwd_basename}"
- type: run
command: "{sdk_root}/golang/{version}/bin/go.exe"
args: ["mod", "init", "{module_name}"]
- type: message
text: "Go module {module_name} initialized"
env_vars:
GOLANG_VERSION: "{version}"name: java
steps:
- type: select
var: build_tool
message: "Choose build tool"
options: ["maven", "gradle"]
default: maven
- type: prompt
var: group_id
message: "Enter groupId"
default: "com.example"
- type: prompt
var: artifact_id
message: "Enter artifactId"
default: "{cwd_basename}"
- type: run
when: "{build_tool}" == "maven"
command: "mvn"
args: ["archetype:generate", "-DgroupId={group_id}", "-DartifactId={artifact_id}", "-DinteractiveMode=false"]
- type: run
when: "{build_tool}" == "gradle"
command: "gradle"
args: ["init", "--type", "java-application"]
- type: message
text: "Java project initialized with {build_tool}"
env_vars:
JAVA_VERSION: "{version}"- Copy one of the example YAMLs above to
toolchains/envman_<yourtool>.yaml. - Edit the steps, commands, and env_vars as needed for your toolchain.
- Place your portable SDK in the appropriate folder under your SDKs root.
- Run
envman initand select your toolchain!
- If a command fails, check the error message for details.
- Make sure your SDKs are portable and have a
bindirectory. - If activation scripts do not work, check your shell and PATH settings.
- You can fully customize or extend any toolchain by editing its YAML config.
# Prepare SDKs in envman_sdks/ as described above
cd myproject
envman init
envman select # (optional, to pick specific versions)
envman activate
# In your shell, run: .\activate.ps1 (PowerShell) or activate.bat (CMD)
# Now your shell uses the selected SDKs
- To remove envman, simply delete the
envman.exefile and any generated scripts/configs.
MIT