Skip to content
[tasks.build]
description = "Build the workspace (debug)"
run = "cargo build --workspace --all-targets"

[tasks."build:release"]
description = "Build the workspace with the optimized release profile"
run = "cargo build --workspace --release"

[tasks.check]
description = "Type-check the workspace without producing binaries"
run = "cargo check --workspace --all-targets"

[tasks.test]
description = "Run all workspace tests"
run = "cargo test --workspace --all-targets"

[tasks."test:doc"]
description = "Run documentation tests"
run = "cargo test --workspace --doc"

[tasks.fmt]
description = "Format the workspace"
alias = "format"
run = "cargo fmt --all"

[tasks."fmt:check"]
description = "Verify formatting without rewriting files"
run = "cargo fmt --all --check"

[tasks.lint]
description = "Run clippy over every target, denying warnings"
alias = "clippy"
run = "cargo clippy --workspace --all-targets -- -D warnings"

[tasks."lint:fix"]
description = "Apply clippy's machine-applicable fixes"
run = "cargo clippy --workspace --all-targets --fix --allow-dirty --allow-staged"

[tasks.doc]
description = "Build the workspace documentation"
run = "cargo doc --workspace --no-deps"

[tasks."doc:open"]
description = "Build and open the workspace documentation"
run = "cargo doc --workspace --no-deps --open"

[tasks."run:server"]
description = "Run the twice control plane (TWICE_LOG controls verbosity)"
env = { TWICE_LOG = "{{ env.TWICE_LOG | default(value='twice_server=debug,info') }}" }
run = "cargo run --bin twice-server --"

[tasks."run:ui"]
description = "Run the egui desktop client"
run = "cargo run --bin twice-ui --"

[tasks."run:server:release"]
description = "Run the control plane built with the release profile"
run = "cargo run --release --bin twice-server --"

[tasks."run:ui:release"]
description = "Run the desktop client built with the release profile"
run = "cargo run --release --bin twice-ui --"

[tasks.update]
description = "Update Cargo.lock within the declared semver ranges"
run = "cargo update --workspace"

[tasks.clean]
description = "Remove build artifacts"
run = "cargo clean"

[tasks.ci]
description = "Everything CI would run: format, lint, test, docs"
depends = ["fmt:check", "lint", "test", "test:doc", "doc"]