Commands overview

Luban has 16 commands, organized into four groups.

Toolchain & environment (one-time per machine)

CommandWhat it does
luban setupInstall LLVM-MinGW + cmake + ninja + mingit + vcpkg into <data>/toolchains/
luban envShow env state; rewrite activate scripts; register HKCU PATH (rustup-style)

Per-project (run inside a project dir)

CommandWhat it does
[`luban new applib `](./new.md)
luban buildcmake --preset && cmake --build; sync compile_commands.json
[`luban target addremove`](./target.md)

Dependency management (vcpkg.json + luban.cmake)

CommandWhat it does
luban add <pkg>[@version]Edit vcpkg.json + regenerate luban.cmake (find_package + link auto-wired)
luban remove <pkg>Reverse luban add
luban syncRe-read vcpkg.json + luban.toml, regenerate luban.cmake
luban search <pattern>Search vcpkg ports (wraps vcpkg search)

Advanced / diagnostic

CommandWhat it does
luban doctorReport directories, installed components, tools on PATH
luban run <cmd> [args...]uv-style activate + exec; runs cmd with luban env
luban which <alias>Print absolute exe path that an alias resolves to
luban describe [--json]Dump system + project state for IDEs / scripts
luban shimRegenerate <data>/bin/ shims (text + .exe; repair tool)
luban self {update,uninstall}Self-update binary, or uninstall luban completely

Global flags

These work before any subcommand:

FlagEffect
-V, --versionPrint luban X.Y.Z and exit
-h, --helpPrint top-level help
-v, --verboseVerbose log output (including stack traces on internal errors)

Conventions

  • Idempotent: every command can be re-run safely. luban setup skips already-installed components, luban add replaces existing dep, luban target add refuses duplicate names.
  • Atomic file writes: every config/manifest write goes via tmp + rename, so a crash leaves either the old or new file fully intact, never half-written.
  • Idiomatic exit codes: 0 success, 1 runtime failure (download failed, cmake error), 2 user error (invalid args, refused operation).
  • Logs to stderr: useful info (, , !, prefixed lines) goes to stderr. stdout is for machine-readable output (e.g., compile_commands.json paths). You can pipe stdout cleanly.