Official Go toolchain CLI for building, testing, running, and inspecting Go packages, modules, and workspaces.
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
Go is the official command-line tool for working with Go codebases and the Go toolchain. It handles package builds, tests, runs, module and workspace maintenance, environment inspection, and access to bundled tools from one entrypoint.
What It Enables
- Build, run, test, benchmark, and install Go packages or commands across local packages, modules, and target platforms.
- Inspect package graphs, module metadata, workspace state, environment settings, and binary build info with commands like
go list,go env,go mod,go work, andgo version -m. - Initialize or maintain
go.modandgo.work, download or verify dependencies, generate code, and invoke bundled or module-defined tools.
Agent Fit
- Core workflows are shell-friendly: commands are mostly non-interactive, work against explicit paths or package patterns, and return stable exit codes for CI or agent loops.
- Structured output is substantial rather than universal, with JSON on
go env,go list,go mod download,go mod edit,go work edit,go version -m,go test, and build-style-jsonoutput. - Automation still depends on local toolchain state, module graph, and sometimes network access, and many everyday commands remain text-first.
Caveats
README.mdidentifiesgolang/goas an official mirror; the canonical Git repository isgo.googlesource.com/go.- Official install docs point to platform-specific downloads and installers, so there is no single upstream shell install command to recommend.