# Your first mg commands — Mercury LMS ## Prerequisite and first success Use a POSIX shell, jonnify checkout, Go >= 1.26.0 on PATH. Native Windows setup is outside this recipe. From the repository root: ```sh go version scripts/mg help alias mg="$PWD/scripts/mg" mg version ``` scripts/mg builds bin/mg with local Go, GOWORK=off and CGO_ENABLED=0; it preserves the caller’s working directory. First build may download Go module dependencies. Alias lasts in this shell and identifies this checkout. macOS /usr/bin/mg is an editor, so do not rely on the bare name before creating the alias. ## Help and completion `mg help version` and `mg version --help` show equivalent help. `mg help` exits 0; bare `mg` prints usage on stderr and exits 2. `mg hlep` exits 2, suggests help and runs nothing. For zsh: ```sh autoload -Uz compinit compinit source <(mg completion zsh) ``` For bash: `source <(mg completion bash)`. fish and powershell scripts are also available. Do not source --json output. ## Recover and continue Launcher MG-GO-MISSING/MG-GO-OLD: select sufficient local Go. MG-BUILD-FAILED: inspect compiler/dependency diagnostics. Exit 3 means mg did not run. Development versions may be devel+revision[-dirty] or (devel). Success: help and version exit 0; typo exits 2 with correction. Next: [Examples](/mg/generate-examples/llms.txt), [Automation](/mg/automation/llms.txt). ## Navigation - [Read this page in the browser](/mg/first-steps) - [mg](/mg/llms.txt) - [llms.txt](/llms.txt) - [All English companions](/llms-full.txt) - [Sitemap](/sitemap.xml)