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
├── test/               Test suites and smoke tests
└── 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:mobilescripts/release/mobile.tsMobile release pipeline
bun buildscripts/build/all.shFull build (server + mobile)
bun build:serverscripts/build/server.shServer build only
bun build:mobilescripts/build/mobile.shMobile build only
bun test:contractsscripts/test/contracts.tsContract tests (server ↔ mobile)

All Scripts

ScriptTypeDescription
build/all.shBashFull build pipeline (server + mobile)
build/server.shBashServer build (frontend, embeds, binaries, smoke test, upload)
build/mobile.shBashMobile 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/mobile.tsTypeScriptMobile version bump, build, commit, tag, push
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/nginx.tsTypeScriptNginx + self-signed cert setup
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 job for automatic updates
cli/helpers.tsTypeScriptCLI input/password/select prompts