HaloStack Docs
Open App
Tools

Scripts

Shared CLI presentation helpers plus the native dev bootstrap — fast and dependency-free.

@halostack/scripts provides the shared command-line presentation used across the repo's ops scripts — colors, logging, prompts, progress, spinners, and run reporting — alongside the native dev bootstrap. It has zero runtime dependencies: the ANSI handling is hand-rolled rather than pulling in third-party logger/color deps, which keeps the scripts fast and self-contained.

Importing

There's no . barrel — import the specific subpath you need:

Structure

Beyond the presentation helpers above, two scripts carry the package's real work:

  • src/commands/dev-setup.ts is the boot orchestrator (run by bun run dev:setup): it installs dependencies, waits for Postgres, waits for storage, and seeds the database, all behind a figlet banner. It's dependency-free and reads Bun.env directly, since it runs before bun install. Postgres readiness uses Bun's TCP socket probe, so it's host-portable and needs no pg_isready binary. The native one-shot bun run setup runs this after services:up, waiting on the host and port from DATABASE_URL (localhost).
  • src/commands/sync-icons.ts copies @halostack/icons assets into a --target <dir> (for example, an app's public/) using the shared logger. Consumers invoke it from their pre-hooks, e.g. bun ../../tools/scripts/src/commands/sync-icons.ts --target public.

Conventions

Keep the package free of third-party dependencies — reach for the standard library or Bun built-ins before adding one. The lone workspace dependency is @halostack/icons, which sync-icons.ts resolves through that package's ./assets/* export. Interactive polish must stay TTY-aware: spinners/progress can redraw in terminals, but CI and redirected output should get plain append-only status lines.

Because it's consumed by ops and seed scripts (such as @halostack/seed), keep it app-agnostic.