spmx
Concepts

Shims

How flutter, xcodebuild and swift are intercepted without changing your workflow.

After spmx setup, ~/.spmx/shims contains flutter, xcodebuild and swift, all symlinks to one multicall binary. When it starts, it looks at the name it was invoked as and behaves accordingly, the way BusyBox and puro do.

Finding the real tool

A shim removes ~/.spmx/shims from PATH and runs the next matching executable. That keeps it compatible with puro, fvm, asdf, mise, xcodes and /usr/bin/xcodebuild. Exit codes, stdin, stdout and stderr, including TTY colors, pass through unchanged.

What each shim does

ShimActs onBeforeAfter
flutterrun, build and test for Apple platforms, and pub getensures the ephemeral SwiftPM package exists, hydrates the Runner workspaceharvests new packages
xcodebuild-resolvePackageDependencies, build, archive, testhydrates SourcePackages unless you passed -clonedSourcePackagesDirPath; enables the compilation cacheharvests
swiftbuild, test, run, package resolve with a Package.swifthydrates .buildharvests

Every other subcommand, such as flutter --version or swift --version, is passed straight through.

When flutter runs xcodebuild internally, it sets SPMX_FLUTTER_SHIM_ACTIVE=1 so the xcodebuild shim skips a second hydration.

Switches

VariableEffect
SPMX_DISABLE=1bypass every shim
SPMX_NO_COMPILE_CACHE=1keep hydration, skip the compilation cache
SPMX_VERBOSE=1print what the shim is doing to stderr
SPMX_STORE_DIRmove the store
SPMX_COMPILATION_CACHE_DIRmove the compilation cache
SPMX_SHIMS_DIRmove the shims directory
Maintained by LuisRibeirooLast updated Edit this page on GitHub