This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Authgate CLI is a production-ready OAuth 2.0 authentication library for Go CLI applications. It automatically selects between Authorization Code Flow with PKCE (browser-based) and Device Authorization Grant (headless/SSH) based on the runtime environment.
make build # Build binary → bin/authgate-cli
go run . # Run directly without building
make rebuild # Clean and rebuild
make dev # Hot reload with airmake test # Run all tests with coverage
make coverage # Open coverage report in browser
go test -v -run TestFunctionName # Run a single testmake lint # Run golangci-lint
make fmt # Format code
make check-tools # Verify all required tools are installedmake build_linux_amd64 # Linux x86-64 → release/linux/amd64/authgate-cli
make build_linux_arm64 # Linux ARM64 → release/linux/arm64/authgate-cli- IMPORTANT: Before committing changes:
- Write tests: All new features and bug fixes MUST include corresponding unit tests
- Format code: Run
make fmtto automatically fix formatting issues - Pass linting: Run
make lintto verify code passes linting without errors