Skip to content

Scripts ​

The scripts/ directory contains all build, release, test, and CLI tooling for the SafeCall monorepo. Scripts are organized into purpose-based subdirectories.

Directory Structure ​

scripts/
├── build/              Build pipelines and code generators
├── release/            Version bump and release automation
├── deploy/             Lab rsync to safecall-lab.sourcectl.com
├── test/               Test suites and smoke tests
├── audit/              Read-only DB/history audits
├── upgrade/            Customer DB upgrade dry-run helpers
└── cli/                Production CLI (bundled into installer)

Naming Conventions ​

  • Directories: lowercase, single word (build/, release/, test/, cli/)
  • Files: single-word names where the directory provides context (scripts/build/server.sh, not scripts/build/build_server.sh)
  • Entry point scripts live at the top of each subdirectory
  • Internal helpers live in nested subdirectories (build/generators/, build/templates/)

Quick Reference ​

All commands are run from the project root with bun:

CommandScriptDescription
bun commitscripts/release/server.tsServer release pipeline
bun release:ariadnescripts/release/ariadne.tsAriadne Internal release pipeline
bun release:theseusscripts/release/theseus.tsTheseus Internal release pipeline
bun run lab:deployscripts/deploy.tsLab web build + rsync to safecall-lab.sourcectl.com
bun buildscripts/build/all.shFull build (server + ariadne)
bun build:serverscripts/build/server.shServer build only
bun build:ariadnescripts/build/ariadne.shAriadne build only
bun test:allscripts/test/all.tsTypecheck, unit tests, Playwright, contracts (--apps also Flutter)
bun test:contractsscripts/test/contracts.tsContract tests (server ↔ ariadne)
bun analyze:ariadneariadne/flutter analyze for Ariadne
bun test:ariadneariadne/flutter test for Ariadne
bun analyze:theseustheseus/flutter analyze for the Theseus scaffold
bun test:theseustheseus/flutter test for the Theseus scaffold

All Scripts ​

ScriptTypeDescription
build/all.shBashFull build pipeline (server + ariadne)
build/server.shBashServer build (frontend, embeds, binaries, smoke test, upload)
build/ariadne.shBashAriadne build (Android AAB + iOS IPA)
build/generators/embeds.tsTypeScriptGenerates static file and migration embeds for compiled binary
build/generators/installer.tsTypeScriptBundles CLI into installer shell script
build/templates/installer.shBashTemplate for the generated installer
release/server.tsTypeScriptServer version bump, build, commit, tag, push
release/ariadne.tsTypeScriptAriadne version bump, signed Internal AAB/IPA, commit, tag, push
release/theseus.tsTypeScriptTheseus Internal AAB/IPA (NAS --dart-define)
release/at-signing.tsTypeScriptFail-closed keystore / ExportOptions helpers
deploy.tsTypeScriptLab deploy: web --release, embeds, rsync, systemd restart
deploy/sync.tsTypeScriptLab rsync allowlist (config/lib/server/web/build/web/src/lib/contracts.ts); protects db, maps, config
deploy/import-cedr.tsTypeScriptCopy CEDR rasters + Hansel import over SSH
test/all.tsTypeScriptOrchestrates typecheck, unit tests, Playwright, and contracts
test/contracts.tsTypeScriptGenerates API fixtures then runs Dart contract tests
test/binary.shBashCompiles binary, boots it, hits key endpoints
test/vm.shBashFull VM lifecycle test (install, setup, test, uninstall)
cli/main.tsTypeScriptCLI entry point (Commander-based)
cli/system.tsTypeScriptInstall, update, repair, uninstall, service, status
cli/config.tsTypeScriptConfig show, edit, set, reset
cli/setup.tsTypeScriptPhase 2 guided setup wizard
cli/integrations.tsTypeScriptExternal integrations (server auto-detect, monit, cron)
cli/selftest.tsTypeScriptDeployment health checks
cli/test.tsTypeScriptTest command (selftest, full VM suite, cleanup)
cli/user.tsTypeScriptUser create, delete, reset password
cli/monit.tsTypeScriptMonit monitoring setup
cli/cron.tsTypeScriptCron jobs for automatic backups and updates
cli/backup.tsTypeScriptApplication backup and restore
cli/helpers.tsTypeScriptCLI input/password/select prompts
audit/leftover_mac_history.tsTypeScriptPost-upgrade leftover-MAC history / .pb audit
audit/merge_candidates.tsTypeScriptRead-only duplicate-name / orphan sensor history scan
upgrade/customer_db_verify.tsTypeScriptOffline customer-DB baseline + 8.0 migrate/verify
upgrade/customer_db_soak.tsTypeScriptLive MQTT soak against upgraded work-tree DBs

Command Line Tool Docs ​

The SafeCall command line tool (util.sh) now has a dedicated documentation menu: