Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.48 KB

File metadata and controls

48 lines (34 loc) · 1.48 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

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.

Development Commands

Building and Running

make build          # Build binary → bin/authgate-cli
go run .            # Run directly without building
make rebuild        # Clean and rebuild
make dev            # Hot reload with air

Testing

make test           # Run all tests with coverage
make coverage       # Open coverage report in browser
go test -v -run TestFunctionName  # Run a single test

Code Quality

make lint           # Run golangci-lint
make fmt            # Format code
make check-tools    # Verify all required tools are installed

Cross-Platform Builds

make build_linux_amd64    # Linux x86-64 → release/linux/amd64/authgate-cli
make build_linux_arm64    # Linux ARM64  → release/linux/arm64/authgate-cli

Coding Conventions

  • IMPORTANT: Before committing changes:
    1. Write tests: All new features and bug fixes MUST include corresponding unit tests
    2. Format code: Run make fmt to automatically fix formatting issues
    3. Pass linting: Run make lint to verify code passes linting without errors