_default:
    just --list

# Run all tests (unit + CLI) - default command
test: test-unit test-cli

# Run Rust unit tests
test-unit:
    cargo test

# Build the tt binary for testing
build:
    cargo build --bin tt

# Run CLI integration tests with clitest
test-cli TESTS='tests/cli/*.ct': build
    TT_BIN={{justfile_directory()}}/target/debug/tt clitest {{TESTS}}

# Run tt in development mode with TT_DATA_DIR set to ./tmp
dev *ARGS:
    TT_DATA_DIR={{justfile_directory()}}/tmp cargo run --bin tt -- {{ARGS}}

# Clean build artifacts and test databases
clean:
    cargo clean
    rm -rf tmp/
