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

# Default recipe - show available commands
default:
    @just --list

# Build the TypeScript project using Bun's native build with Node.js target
build:
    bun build src/cli.ts --outdir ./dist --target node --sourcemap=external
    bunx tsc --emitDeclarationOnly

# Run linter with auto-fix
lint:
    bunx biome check --write

# Clean the dist directory
clean:
    @{{ if os_family() == "windows" { "if (Test-Path dist) { Remove-Item -Recurse -Force dist }" } else { "rm -rf dist" } }}

# Publish package to npm (auto-increments version, builds before publish)
[confirm("Are you sure you want to publish to npm?")]
publish: lint rebuild
    node scripts/bump-version.js
    npm publish --access public

# Development: Run login command
dev-login:
    bun run src/cli.ts login

# Development: Run fetch command
dev-fetch:
    bun run src/cli.ts fetch

dev-auggie:
    bun run src/cli.ts auggie --print "hi"

# Build and then publish (recommended workflow)
[confirm("This will build and publish. Continue?")]
release: lint rebuild publish

# Clean and rebuild
rebuild: clean build

# Run all quality checks (lint + build)
check: lint build


Auggie-Code:
    auggie --shell powershell

Claude-Code:
    claude --dangerously-skip-permissions
