loc-visuals scans a project and creates a self-contained HTML report showing how its non-empty physical lines are distributed across documentation, tests, and code.
The generated report has no external assets or network dependencies. Open it locally, attach it to a build, or publish it as a CI artifact.
curl -fsSL https://raw.githubusercontent.com/EzyGang/loc-visuals/main/scripts/install.sh | shThe installer selects the current operating system and architecture, verifies the release checksum, and installs the binary to ~/.local/bin by default.
Set LOC_VISUALS_VERSION to install a specific release or LOC_VISUALS_INSTALL_DIR to change the destination:
curl -fsSL https://raw.githubusercontent.com/EzyGang/loc-visuals/main/scripts/install.sh | LOC_VISUALS_VERSION=0.1.1 LOC_VISUALS_INSTALL_DIR="$HOME/bin" shirm https://raw.githubusercontent.com/EzyGang/loc-visuals/main/scripts/install.ps1 | iexThe PowerShell installer verifies the release checksum, copies the executable to %USERPROFILE%\.local\bin, and adds that directory to both the persistent user PATH and the current PowerShell session. It installs the executable itself rather than a shortcut.
$env:LOC_VISUALS_VERSION="0.1.1"; $env:LOC_VISUALS_INSTALL_DIR="$HOME\bin"; irm https://raw.githubusercontent.com/EzyGang/loc-visuals/main/scripts/install.ps1 | iexGo 1.25 or newer is required.
git clone https://github.com/EzyGang/loc-visuals.git && cd loc-visuals && go build -o bin/loc-visuals ./cmd/loc-visualsScan the current project and write loc-report.html:
loc-visuals .Choose another output path or project:
loc-visuals -o artifacts/lines.html ../projectScan several folders without scanning their parent directory:
loc-visuals -o artifacts/lines.html ./cmd ./internal/scan ./internal/reportAny number of paths can be provided. Duplicate and nested paths are scanned only once. Multi-path reports show combined totals alongside a separate composition breakdown for every selected folder.
Print the installed version:
loc-visuals versionSuccessful interactive runs check the GitHub Releases API at most once every 24 hours and report when a newer version is available. Set LOC_VISUALS_NO_UPDATE_CHECK=1 to disable this check.
Files are classified in this order:
- Files under test or spec directories are tests.
- Filenames containing a standalone
test,tests,spec, orspecstoken are tests. - Markdown, MDX, reStructuredText, and AsciiDoc files are documentation.
- All other scanned text files are code.
Dependencies, caches, build output, lock files, minified files, source maps, symlinks, binary files, and the requested report path are excluded.
go test ./... && go vet ./... && go build -o bin/loc-visuals ./cmd/loc-visuals && ./bin/loc-visuals -o /tmp/loc-report.html .CI runs tests, vet, and builds on Linux, macOS, and Windows.
Releases are manual:
- Update
Currentininternal/version/version.go. - Run the Release workflow from the intended branch or commit in GitHub Actions.
The workflow reads the package version, builds Linux, macOS, and Windows archives for amd64 and arm64, creates the matching vMAJOR.MINOR.PATCH release, and attaches the archives, installers, and SHA-256 checksums.