docs/v3/binary-size.md
Go removes unreachable code during compilation, so the first step is to measure the binary you ship instead of assuming a specific feature is expensive.
go build -trimpath -o myapp ./cmd/myapp
ls -lh myapp
For a release-style build, combine reproducible paths with stripped symbol and debug information:
go build -trimpath -ldflags="-s -w" -o myapp ./cmd/myapp
ls -lh myapp
Use the Go toolchain to inspect what is in the binary:
go version -m myapp
go tool nm -size myapp | sort -nr | head -40
make check-binary-size in this repository to compare the current package
contribution against the tracked binary-size budget.-trimpath for reproducible paths.-ldflags="-s -w" for release builds when debug symbols are not needed.If a specific urfave/cli feature appears to keep unexpected code reachable,
open an issue with the Go version,
build command, a minimal reproduction, and the go tool nm -size output that
shows the largest symbols.
The v3 module does not currently define build tags such as
urfave_cli_no_docs, urfave_cli_no_completion, or urfave_cli_minimal.
Documentation generation lives outside the core module in
urfave/cli-docs, so applications that
only import github.com/urfave/cli/v3 do not pull in that package.
Shell completion support is part of the core package. Leave
EnableShellCompletion disabled unless the application needs shell completion,
then measure the result with the commands above.