Skip to content

Just Recipes

just is the task runner. Every build, test, and release workflow goes through the justfile. Run just --list to see all public recipes.

RecipeWhat it doesTime
just shellBuild/sign as needed, boot a temporary VM, and attach a shell~10s after first build
just exec "CMD"Run a command in a fresh temporary VM, then destroy it~10s after first build
just run-serviceStart or reuse the daemon servicecontinuous
just uiTauri desktop app with hot reload and the service pathcontinuous
just dev-frontendFrontend-only dev server with mock data on port 5173continuous
just build-ui [release]Frontend build plus cargo build -p capsem-appbuild dependent

just shell is the daily VM driver. just exec "CMD" is the one-shot path for quick checks. After frontend changes intended for the desktop app, use just build-ui; the Tauri binary embeds frontend/dist at cargo build time.

RecipeWhat it doesBoots VM?
just smokeFast end-to-end gate: audit, doctor, injection, service/CLI/MCP/gateway testsYes
just testFull gate: unit, coverage, cross-compile, frontend, Python, injection, integration, benchmarks, install E2EYes
just test-gatewayGateway unit and mock-UDS testsNo
just test-gateway-e2eGateway E2E tests with real service and VMsYes
just test-installInstaller E2E in Docker/systemdNo host VM
just benchIn-VM, host lifecycle/fork, and Security Engine benchmarksYes

just test is the source of truth. Targeted commands are for iteration, not for declaring a sprint done.

Policy work spans parser contracts, runtime boundaries, settings UI, docs, and telemetry. Use this sequence for focused iteration:

StepCommand
Rust Security Engine contractscargo test -p capsem-security-engine
Framed MCP policycargo test -p capsem-core net::mitm_proxy::mcp_frame --lib
Frontend policy UI/modelpnpm -C frontend test -- settings-model settings-export api settings-store
Frontend type/check gatepnpm -C frontend run check
Docs gatecd docs && pnpm run build
VM smokejust smoke
Session integrityjust inspect-session [id]
Session SQL proofjust query-session "SQL" [id]
Final gatejust test

Useful policy audit queries:

Terminal window
just query-session "
SELECT tool_name, policy_action, policy_rule, policy_reason
FROM mcp_calls
WHERE policy_rule IS NOT NULL
ORDER BY id DESC
LIMIT 20;"
Terminal window
just query-session "
SELECT domain, method, path, decision, matched_rule
FROM net_events
WHERE matched_rule IS NOT NULL
ORDER BY id DESC
LIMIT 20;"
Terminal window
just query-session "
SELECT qname, qtype, rcode, decision, matched_rule
FROM dns_events
WHERE matched_rule IS NOT NULL OR decision != 'allowed'
ORDER BY id DESC
LIMIT 20;"
RecipeWhat it doesTime
just build-assetsFull rebuild: kernel + rootfs via Profile V2 (needs Docker)~10 min
just build-kernel <arch>Kernel only~5 min
just build-rootfs <arch>Rootfs only~8 min
just cross-compile [arch]Full Linux build in container: agent binaries + .deb package~15 min

You only need just build-assets on first setup or when profile-derived image inputs change rootfs packages, kernel inputs, or base image assets. Repo-local guest/config/ edits matter for built-in profile development only. Day-to-day, just shell and just exec repack the initrd without rebuilding rootfs images.

RecipeWhat it does
just inspect-session [id]Session DB integrity check + event summary (latest by default)
just list-sessionsTable of recent sessions with event counts per table
just query-session "SQL" [id]Run raw SQL against a session DB
just update-fixture <path>Copy + scrub a real session DB as test fixture
RecipeWhat it does
just auditCheck for known vulnerabilities in Rust + npm deps
just update-depscargo update + pnpm update to latest compatible versions
just update-pricesRefresh model pricing JSON from upstream
just doctorCheck tools, colored output, structured recap (exits 1 if failures)
just doctor fixDoctor + auto-fix all fixable issues in dependency order
RecipeWhat it does
just cut-releaseRun tests, bump version, stamp changelog, commit, and create a local release tag
just release [tag]Wait for CI to build + publish an existing tag
just installBuild release package and install locally

just cut-release intentionally does not push. After inspecting the generated release commit and local tag, publish deliberately:

Terminal window
git push origin HEAD:main
git push origin vX.Y.Z
just release vX.Y.Z
RecipeWhat it does
just cleanRemove Rust + frontend build artifacts
just clean allDeep clean: build artifacts + container images + docker cache

Recipes automatically pull in their prerequisites. You never need to run setup steps manually.

shell -> _check-assets + _pack-initrd + _ensure-service
exec -> run-service
run-service -> _check-assets + _pack-initrd + _ensure-service
ui -> _ensure-setup + _pnpm-install + run-service
build-ui -> _pnpm-install + frontend build + cargo build -p capsem-app
smoke -> _install-tools + _pnpm-install + _check-assets + _pack-initrd + _ensure-service
test -> _install-tools + _clean-stale + _pnpm-install + _generate-settings + _check-assets + _pack-initrd
build-assets -> _install-tools + _clean-stale + doctor + capsem-admin image build
test-install -> _build-host
cut-release -> test + _stamp-version

_-prefixed recipes are internal (hidden from just --list). Key internal recipes:

RecipeWhat it does
_ensure-setupChecks setup state and required tools
_install-toolsAuto-installs Rust targets, components, and cargo tools
_pack-initrdCross-compiles guest agent + repacks initrd with latest binaries
_signCodesigns the binary with virtualization entitlement
_check-assetsVerifies VM assets exist, tells you to run build-assets if not
_generate-settingsExports MCP tool defs + generates schema/defaults/mock data
_ensure-serviceBuilds/signs host binaries and starts or reuses the service