Appearance
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, notscripts/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:
| Command | Script | Description |
|---|---|---|
bun commit | scripts/release/server.ts | Server release pipeline |
bun release:ariadne | scripts/release/ariadne.ts | Ariadne Internal release pipeline |
bun release:theseus | scripts/release/theseus.ts | Theseus Internal release pipeline |
bun run lab:deploy | scripts/deploy.ts | Lab web build + rsync to safecall-lab.sourcectl.com |
bun build | scripts/build/all.sh | Full build (server + ariadne) |
bun build:server | scripts/build/server.sh | Server build only |
bun build:ariadne | scripts/build/ariadne.sh | Ariadne build only |
bun test:all | scripts/test/all.ts | Typecheck, unit tests, Playwright, contracts (--apps also Flutter) |
bun test:contracts | scripts/test/contracts.ts | Contract tests (server ↔ ariadne) |
bun analyze:ariadne | ariadne/ | flutter analyze for Ariadne |
bun test:ariadne | ariadne/ | flutter test for Ariadne |
bun analyze:theseus | theseus/ | flutter analyze for the Theseus scaffold |
bun test:theseus | theseus/ | flutter test for the Theseus scaffold |
All Scripts
| Script | Type | Description |
|---|---|---|
build/all.sh | Bash | Full build pipeline (server + ariadne) |
build/server.sh | Bash | Server build (frontend, embeds, binaries, smoke test, upload) |
build/ariadne.sh | Bash | Ariadne build (Android AAB + iOS IPA) |
build/generators/embeds.ts | TypeScript | Generates static file and migration embeds for compiled binary |
build/generators/installer.ts | TypeScript | Bundles CLI into installer shell script |
build/templates/installer.sh | Bash | Template for the generated installer |
release/server.ts | TypeScript | Server version bump, build, commit, tag, push |
release/ariadne.ts | TypeScript | Ariadne version bump, signed Internal AAB/IPA, commit, tag, push |
release/theseus.ts | TypeScript | Theseus Internal AAB/IPA (NAS --dart-define) |
release/at-signing.ts | TypeScript | Fail-closed keystore / ExportOptions helpers |
deploy.ts | TypeScript | Lab deploy: web --release, embeds, rsync, systemd restart |
deploy/sync.ts | TypeScript | Lab rsync allowlist (config/lib/server/web/build/web/src/lib/contracts.ts); protects db, maps, config |
deploy/import-cedr.ts | TypeScript | Copy CEDR rasters + Hansel import over SSH |
test/all.ts | TypeScript | Orchestrates typecheck, unit tests, Playwright, and contracts |
test/contracts.ts | TypeScript | Generates API fixtures then runs Dart contract tests |
test/binary.sh | Bash | Compiles binary, boots it, hits key endpoints |
test/vm.sh | Bash | Full VM lifecycle test (install, setup, test, uninstall) |
cli/main.ts | TypeScript | CLI entry point (Commander-based) |
cli/system.ts | TypeScript | Install, update, repair, uninstall, service, status |
cli/config.ts | TypeScript | Config show, edit, set, reset |
cli/setup.ts | TypeScript | Phase 2 guided setup wizard |
cli/integrations.ts | TypeScript | External integrations (server auto-detect, monit, cron) |
cli/selftest.ts | TypeScript | Deployment health checks |
cli/test.ts | TypeScript | Test command (selftest, full VM suite, cleanup) |
cli/user.ts | TypeScript | User create, delete, reset password |
cli/monit.ts | TypeScript | Monit monitoring setup |
cli/cron.ts | TypeScript | Cron jobs for automatic backups and updates |
cli/backup.ts | TypeScript | Application backup and restore |
cli/helpers.ts | TypeScript | CLI input/password/select prompts |
audit/leftover_mac_history.ts | TypeScript | Post-upgrade leftover-MAC history / .pb audit |
audit/merge_candidates.ts | TypeScript | Read-only duplicate-name / orphan sensor history scan |
upgrade/customer_db_verify.ts | TypeScript | Offline customer-DB baseline + 8.0 migrate/verify |
upgrade/customer_db_soak.ts | TypeScript | Live MQTT soak against upgraded work-tree DBs |
Command Line Tool Docs
The SafeCall command line tool (util.sh) now has a dedicated documentation menu: