One-Shot Self-Host Initialization

Provision a fresh self-hosted Dots database into a bootable workspace with migrations, storage, owner identity, foundational Dotabases, and access authority.

Overview

Description

One-Shot Self-Host Initialization takes an empty PostgreSQL target to a bootable Dots workspace. The provisioner applies schema migrations, prepares storage, creates or adopts the first owner identity, seeds the workspace company, creates the foundational Dotabases, and binds the owner through the Access authority plane. It runs out of band because the normal server boot guard expects an existing company before serving.

The operation is idempotent: rerunning migration and provisioning adopts existing owner/company state and skips already-created foundational data rather than duplicating it. The public dots init command supplies non-interactive owner flags and environment fallbacks, plus a migration skip for release processes that own schema application separately. A first-signup mode can intentionally stop after schema and storage setup, leaving the first browser signup to claim ownership. Typed failure codes distinguish configuration, migration, storage, identity, and provisioning faults.

Selling Points

  • Replaces a multi-step database bootstrap runbook with one repeatable operation.
  • Produces a real owner, company, foundational knowledge stores, and authority bindings rather than only creating tables.
  • Supports both administrator-supplied owner credentials and a first-signup-becomes-owner deployment.
  • Is safe to rerun, simplifying container restarts and infrastructure automation.
  • Emits distinct failure categories so operators and supervisors can respond to the actual failed stage.

User Story

An administrator provisions a Postgres database for a private Dots server and runs the init command with owner credentials. The command migrates the schema, prepares storage, creates the owner and workspace, seeds the foundational Dotabases, and reports what was created or adopted. The administrator can then start the API and sign in to a usable instance instead of facing an empty schema.

Extension Surface

This feature is automatable. packages/cli/src/commands/init.ts exposes the supported command workflow, while packages/api/src/init/core.ts exports runInit with injectable production seams and deterministic reports. Deployment automation can run it repeatedly through the CLI or process entry. The ordered provisioning contract is fixed core and does not expose third-party bootstrap-step registration.

Capabilities & Limits

  • Migrates schema, provisions storage, creates/adopts owner identity, company, foundational Dotabases, and Access authority.
  • Supports owner-full and ownerless first-signup modes.
  • Returns an idempotent created/skipped report and typed failure exit codes.
  • Limit: it provisions one deployment’s first workspace; ongoing workspace creation uses normal application flows.
  • Limit: a production run still requires valid database, identity, storage, and security configuration.

Implementation Map

  • packages/api/src/init/core.ts
  • packages/api/src/init-entry.ts
  • packages/api/src/init/index.ts
  • packages/cli/src/commands/init.ts
  • dots init
  • packages/cli/src/program.ts

Properties

Property
Value
product
dots-platform
extensibility
automatable
module
CLI, Access, Dotabases, App Shell
packages
api, cli
status
shipped
surface
cli
summary
Provision a fresh self-hosted Dots database into a bootable workspace with migrations, storage, owner identity, foundational Dotabases, and access authority.

Connections

One-Shot Self-Host Initialization · Explore connections

  • documented bytoSelf-host Dots
  • complementstoLocal Self-Hosted Daemon
  • implemented bytopackages/api/src/init/index.ts
  • implemented bytopackages/cli/src/commands/init.ts
  • implemented bytopackages/api/src/init/core.ts
  • implemented bytopackages/api/src/init-entry.ts
  • implemented bytopackages/cli/src/program.ts
  • complementsfromCLI Workspace Onboarding and Platform Operations

Connected Records8

Complements
Documented by
Implemented by
packages/api/src/init-entry.ts
packages/api/src/init/core.ts
packages/api/src/init/index.ts
packages/cli/src/commands/init.ts
packages/cli/src/program.ts
8 connections.

Documents

Title
Type