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
├── 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, 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:mobile | scripts/release/mobile.ts | Mobile release pipeline |
bun build | scripts/build/all.sh | Full build (server + mobile) |
bun build:server | scripts/build/server.sh | Server build only |
bun build:mobile | scripts/build/mobile.sh | Mobile build only |
bun test:contracts | scripts/test/contracts.ts | Contract tests (server ↔ mobile) |
All Scripts
| Script | Type | Description |
|---|---|---|
build/all.sh | Bash | Full build pipeline (server + mobile) |
build/server.sh | Bash | Server build (frontend, embeds, binaries, smoke test, upload) |
build/mobile.sh | Bash | Mobile 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/mobile.ts | TypeScript | Mobile version bump, build, commit, tag, push |
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/nginx.ts | TypeScript | Nginx + self-signed cert setup |
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 job for automatic updates |
cli/helpers.ts | TypeScript | CLI input/password/select prompts |