openclaw-scan 0.1.0

Security scanner for agentic AI framework installations (OpenClaw, Claude Code, and compatible)
Documentation
# Makefile for openclaw-scan
# Wraps common cargo commands for convenience.

.DEFAULT_GOAL := help

BINARY      := ocls
CARGO       := cargo
TARGET_DIR  := target/release

# ── Help ─────────────────────────────────────────────────────────────────────

.PHONY: help
help: ## Show this help message
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
		awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[36m%-18s\033[0m %s\n", $$1, $$2}'

# ── Build ─────────────────────────────────────────────────────────────────────

.PHONY: build
build: ## Build debug binary
	$(CARGO) build

.PHONY: release
release: ## Build optimised release binary
	$(CARGO) build --release

.PHONY: install
install: ## Install ocls into ~/.cargo/bin
	$(CARGO) install --path .

# ── Quality gates ─────────────────────────────────────────────────────────────

.PHONY: fmt
fmt: ## Format all source files
	$(CARGO) fmt

.PHONY: fmt-check
fmt-check: ## Check formatting without modifying files
	$(CARGO) fmt --check

.PHONY: lint
lint: ## Run clippy (zero-warnings policy)
	$(CARGO) clippy -- -D warnings

.PHONY: test
test: ## Run all unit and integration tests
	$(CARGO) test --all

.PHONY: check
check: fmt-check lint test ## Run all quality gates (CI equivalent)

# ── Coverage ──────────────────────────────────────────────────────────────────

.PHONY: coverage
coverage: ## Generate code coverage report (requires cargo-llvm-cov)
	$(CARGO) llvm-cov --all-features --workspace --html

.PHONY: coverage-text
coverage-text: ## Print coverage summary to terminal
	$(CARGO) llvm-cov --all-features --workspace

# ── Development helpers ───────────────────────────────────────────────────────

.PHONY: run
run: ## Run ocls against auto-detected installation
	$(CARGO) run --

.PHONY: run-json
run-json: ## Run ocls with JSON output
	$(CARGO) run -- --json

.PHONY: run-verbose
run-verbose: ## Run ocls with verbose remediation output
	$(CARGO) run -- -v

.PHONY: run-claude
run-claude: ## Run ocls against ~/.claude specifically
	$(CARGO) run -- ~/.claude

# ── Clean ─────────────────────────────────────────────────────────────────────

.PHONY: clean
clean: ## Remove build artifacts
	$(CARGO) clean

# ── Cross-compilation ─────────────────────────────────────────────────────────

.PHONY: cross-linux-x86
cross-linux-x86: ## Build for x86_64-unknown-linux-musl (requires cross)
	cross build --release --target x86_64-unknown-linux-musl

.PHONY: cross-linux-arm
cross-linux-arm: ## Build for aarch64-unknown-linux-musl (requires cross)
	cross build --release --target aarch64-unknown-linux-musl

.PHONY: cross-mac-arm
cross-mac-arm: ## Build for aarch64-apple-darwin
	$(CARGO) build --release --target aarch64-apple-darwin

.PHONY: cross-mac-x86
cross-mac-x86: ## Build for x86_64-apple-darwin
	$(CARGO) build --release --target x86_64-apple-darwin