Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Portable Toolchain Manager

Welcome to the documentation for Portable Toolchain Manager — one unified, zero-Admin PowerShell 7.x TUI and headless CLI for 38+ portable Windows developer toolchains, IDEs, SDKs, compilers, and CLI power-tools.

Core Principles

  • Strictly Pure Portable .zip Archives Only: Never downloads or runs .7z.exe SFX archives or .exe/.msi installers. Verifies PKZIP magic bytes (50 4B 03 04) and official SHA-256 / SHA-512 checksums.
  • Sleek Keyboard-Driven TUI: Built on the flicker-free PowerShell 7 TUI architecture from windows-utilities-menu (↑/↓, 1–6 hotkeys, / live search, D Dry-Run preview, L Log toggle).
  • 100% Isolated data\ Folders: Every toolchain stores configs, caches, and user tools under <InstallDir>\data\ and preserves them across in-place updates.
  • Zero-Admin Reversible Cleanup: Strictly scoped to user directories, User PATH, User environment variables, and HKCU.

Getting Started

Prerequisites

  • Windows 10 / Windows 11 (x64, arm64, or x86)
  • PowerShell 7.x (pwsh.exe) in PATH:
    winget install Microsoft.PowerShell
    

Interactive TUI Mode

Double-click or run PortableToolchainManager.bat:

  • Use ↑/↓ or 1–6 to open a toolchain category.
  • Press / from anywhere to filter all 38+ toolchains live.
  • Press S to view all installed portable toolchains.
  • Press D to toggle Dry-Run mode (preview download URLs, checksums, PATH, and env vars with zero writes).
  • Press Enter on any toolchain to Install, Update (preserving data\), Configure, Verify Live .zip, or Uninstall.

Headless CLI Mode

PortableToolchainManager.bat --list
PortableToolchainManager.bat --verify-zip go
PortableToolchainManager.bat --install git --dry-run
PortableToolchainManager.bat --install go --preset privacy
PortableToolchainManager.bat --update all

Configuration & Per-Toolchain Profiles

Portable Toolchain Manager uses a modular INI folder structure so global manager defaults stay minimal while every IDE, SDK, runtime, compiler, and CLI tool has its own native configuration options and opt-in profiles.

Directory Layout

config\
├── manager.ini                 # Core manager defaults (BaseInstallDir, DefaultArch, StrictZipOnly, Logging)
└── toolchains\
    ├── vscode.ini              # Personal VS Code overrides ([Toolchain], [Settings], [Extensions], [Env])
    ├── python.ini              # Personal Python overrides ([Toolchain], [Pip], [Packages], [Env])
    ├── nodejs.ini              # Personal Node.js overrides ([Toolchain], [Npm], [Packages], [Env])
    ├── dotnet.ini              # Personal .NET overrides ([Toolchain], [NuGet], [Tools], [Env])
    ├── go.ini                  # Personal Go overrides ([Toolchain], [GoEnv], [Tools], [Env])
    ├── git.ini                 # Personal Git overrides ([Toolchain], [GitConfig], [GitIgnore], [Env])
    ├── gh.ini                  # Personal GitHub CLI overrides ([Toolchain], [GhConfig], [Extensions], [Env])
    └── <id>.ini                # One modular personal config file for each of the 38 built-in toolchains
profiles\
├── <id>\*.ini                  # Per-toolchain opt-in native profiles (e.g. profiles\vscode\privacy.ini)
└── _bundles\*.ini              # Optional multi-toolchain workstation bundles

Core Manager Settings (config\manager.ini)

KeyDefaultDescription
BaseInstallDirD:\CLIDefault parent directory where each toolchain installs into <BaseInstallDir>\<FolderName> (overridable per tool in config\toolchains\<id>.ini).
DefaultArchx64Default Windows architecture (x64, arm64, x86).
VerifyChecksumtrueEnforce SHA-256 / SHA-512 verification against official upstream metadata.
StrictZipOnlytrueStrictly allow pure portable .zip archives only (blocks SFX .7z.exe & installers).
AutoAddPathtrueAdd toolchain bin directories to User PATH.
AutoAddRegistrytrueRegister only official Windows App Paths and documented official vendor HKCU keys (PEP 514 PythonCore, Node.js, GitForWindows). Never writes synthetic keys.
AutoSetPortableEnvtrueWire portable User environment variables into <InstallDir>\data\.
AutoAddContextMenufalseOptionally register HKCU Explorer right-click prompt menus.

Merge Precedence (Personal Always Wins)

When installing or configuring toolchain <id>:

  1. Any OptionalProfiles listed in config\toolchains\<id>.ini under [Toolchain] are loaded from profiles\<id>\*.ini in order.
  2. Any --preset <names> passed on the CLI (or selected via TUI option [4] Apply Per-Toolchain Profile) are layered next.
  3. Personal keys in config\toolchains\<id>.ini are overlaid last so your personal settings always override profile defaults.

Listing & Applying Profiles

PortableToolchainManager.bat --profiles vscode
PortableToolchainManager.bat --configure vscode --preset portable-essentials,privacy,no-ai --dry-run
PortableToolchainManager.bat --install git --preset portable-essentials,privacy,git-aliases --dry-run

CLI Reference

PortableToolchainManager.bat                                    :: Interactive TUI
PortableToolchainManager.bat --list                             :: List all categories & toolchains
PortableToolchainManager.bat --search <query>                   :: Search by ID, name, category, or tag
PortableToolchainManager.bat --status [id]                      :: Show installed status
PortableToolchainManager.bat --verify-zip <id> [--arch <a]      :: Verify live upstream .zip & hash
PortableToolchainManager.bat --install <id> [options]           :: Install portable .zip
PortableToolchainManager.bat --update <id|all> [options]        :: In-place update (preserves data\)
PortableToolchainManager.bat --configure <id> [options]         :: Apply config\toolchains\<id>.ini, profiles, PATH & Official HKCU Reg
PortableToolchainManager.bat --profiles [id]                    :: List per-toolchain opt-in profiles (profiles\<id>\*.ini)
PortableToolchainManager.bat --uninstall <id> [--registry-only] :: Cleanly remove toolchain
PortableToolchainManager.bat --export [path]                    :: Export installed manifest JSON
PortableToolchainManager.bat --help                             :: Show CLI help

Common flags: --version <v>, --arch <x64|arm64|x86>, --dir <path>, --preset <names>, --add-context-menu, --registry-only, --dry-run, --force, --no-pause, --log [path].

Troubleshooting

GitHub API Rate Limit (HTTP 403)

Unauthenticated GitHub API calls are limited to 60 requests/hour per IP. If running bulk --verify-zip or --update all, set a read-only token in GITHUB_TOKEN or GH_TOKEN for your current shell session (never commit tokens).

Non-ZIP / SFX Blocked Error

Portable Toolchain Manager intentionally blocks .7z.exe SFX archives and .exe/.msi installers. All 38 built-in toolchains resolve strictly to official pure .zip archives.

Terminal Doesn’t See New Tool After Install

Open a new terminal window so Windows picks up the broadcast WM_SETTINGCHANGE User PATH and environment updates.

Architecture

Portable Toolchain Manager combines a strict 4-layer acyclic PowerShell 7.x core with a modular pluggable toolchain catalog and a flicker-free TUI engine:

flowchart TD
    TUI["Entrypoint: PortableToolchainManager.bat -> src/menu.ps1<br/>Interactive TUI (windows-utilities-menu style) & Headless CLI"]
    CAT["Catalog & Lifecycle: catalog.ps1 · lifecycle.ps1 · resolvers.ps1 · config.ps1 · config-apply.ps1"]
    PACKS["Pluggable Packs: src/toolchains/01..06_*.ps1 + custom/*.ps1 · config/toolchains/*.ini · profiles/<id>/*.ini"]
    UTIL["Utilities: filesystem.ps1 (ZIP-Only + Zip Slip) · path.ps1 · registry.ps1 (Official HKCU Only)"]
    EVT["Events: logger.ps1 · progress.ps1"]

    TUI --> CAT
    CAT --> PACKS
    CAT --> UTIL
    CAT --> EVT
    UTIL --> EVT

Adding Custom Toolchains

  1. Drop a .ps1 pack into src\toolchains\custom\ (see src\toolchains\custom\_example.disabled.ps1). Any file not starting with _ and not ending with .disabled.ps1 is auto-discovered by src\core\catalog.ps1.
  2. Add its personal config INI at config\toolchains\<id>.ini with [Toolchain] overrides (InstallDir, Arch, Version, OptionalProfiles), [Env], and any applicable native config sections.
  3. Add opt-in profiles under profiles\<id>\*.ini — they automatically appear in --profiles <id> and TUI action [4] Apply Per-Toolchain Profile.

Required Guardrails

  • Pure Portable .zip Only: Every toolchain Resolve scriptblock MUST resolve to a pure portable .zip archive. Assert-PortableZipAsset and Test-FileIsPkZip reject .7z.exe SFX archives and .exe/.msi installers automatically.
  • Official Registry Keys Only: Only list real executables in AppPathExes (registered under HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\<exe>) and only add an OfficialRegistryHook when the upstream vendor officially documents an HKCU\Software\<Vendor> key. Never invent synthetic registry keys.

Release Packaging

.github\workflows\release.yml packages a strict runtime allowlist into portable-toolchain-manager-<tag>.zip + .sha256:

  • README.txt
  • PortableToolchainManager.bat
  • config\ (manager.ini + toolchains\*.ini)
  • profiles\ (<id>\*.ini + _bundles\*.ini)
  • src\

Repository Markdown (*.md), docs\, tests\, .github\, logs\, and plan.txt are audited and excluded from release archives.