# justfile — task runner for syslog-server-mcp
# Lists available recipes by default. Mirror of .github/workflows/ci.yml.

set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]

# Default: show recipes
default:
    @just --list

# Build with default features (stdio)
build:
    cargo build

# Build with HTTP feature
build-http:
    cargo build --features http

# Build for stdio-only (no defaults)
build-stdio:
    cargo build --no-default-features --features stdio

# Run all tests (default features)
test:
    cargo test

# Run tests with HTTP feature
test-http:
    cargo test --features http

# Lint: clippy with -D warnings
clippy:
    cargo clippy --all-targets -- -D warnings

clippy-http:
    cargo clippy --all-targets --features http -- -D warnings

# Format check (CI gate)
fmt-check:
    cargo fmt -- --check

# Apply formatting
fmt:
    cargo fmt

# Dependency hygiene
deny:
    cargo deny check

audit:
    cargo audit

machete:
    cargo machete

# CI aggregate — mirrors .github/workflows/ci.yml
ci: build test clippy fmt-check build-http test-http clippy-http deny audit machete

# Pre-push sanity (fast subset)
validate: fmt-check clippy test

# Install locally
install:
    cargo install --path .

# Run stdio mode (requires SYSLOG_BASE_URL + SYSLOG_API_KEY env)
run-stdio:
    cargo run -- serve

# Run HTTP mode (requires --config path)
run-http config:
    cargo run --features http -- serve --http 127.0.0.1:8765 --config {{config}}

# Run probes once and exit
probe-once:
    cargo run -- serve --probe-once
