Skip to Content
kalam.toml Reference

kalam.toml Reference

kalam.toml is the project configuration file at the repository root. Workflow commands (kalam init, kalam dev, kalam migration, kalam schema, kalam db, kalam status, kalam link) read it to resolve environments, schema sources, codegen targets, and dev orchestration.

Secrets do not belong in kalam.toml. URLs and namespaces are fine; passwords and JWTs stay in ~/.kalam/ (credential profiles like kalam-dev).

Project layout

TEXT
my-app/├── kalam.toml├── schema.sql├── .env / .env.example├── kalam/│   ├── migrations/│   ├── .schema-baseline.sql│   ├── .gitignore│   ├── cli/logs/kalam.log│   └── server/│       ├── server.toml│       ├── data/│       └── logs/├── src/generated/kalam.ts    # TypeScript└── lib/generated/kalam.dart  # Dart

The default project data directory is kalam/ (override with [project].kalam_dir).

Full example

TOML
[project]name = "my-app"default_env = "dev"package_manager = "pnpm" [connection.dev]url = "http://localhost:2900"namespace = "my_app" [connection.prod]url = "https://db.example.com"namespace = "my_app" [schema]mode = "sql"path = "schema.sql"watch = truelanguages = ["typescript", "dart"] [schema.targets.typescript]output = "src/generated/kalam.ts" [schema.targets.dart]output = "lib/generated/kalam.dart" [migrations]auto_create = true [dev]auto_start_db = trueapply_schema = truegenerate_types = truewatch = true [dev.processes]app = "pnpm dev"worker = "cargo run --bin worker" [logging]file = truecapture_process_output = true

[project]

FieldRequiredDefaultDescription
nameyesProject name
default_envnodevDefault environment for workflow commands
package_managernonpm, pnpm, yarn, or bun — written by kalam init for TypeScript projects
kalam_dirnokalamRelative path for migrations, local server config, CLI logs, and schema baselines

[connection.<env>]

FieldRequiredDescription
urlyesKalamDB HTTP URL
namespaceyesNamespace identifier

Add or update environments without re-running init:

BASH
kalam link --env staging --url https://staging.example.com --namespace my_app

[schema]

FieldRequiredDefaultDescription
modeyessql (local file) or remote
pathwhen mode = "sql"Schema source path (typically schema.sql)
watchnotrueEnable file watch together with [dev].watch
languagesno["typescript"]Codegen targets: typescript, dart

Each language in languages requires a matching [schema.targets.<language>] block.

[schema.targets.<language>]

FieldRequiredDescription
outputyesPath for generated SDK/schema artifacts (must be unique per language)

[migrations]

FieldDefaultDescription
auto_createtrueAutomatically maintain kalam/migrations/_draft.sql from schema diffs
dirkalam/migrationsMigration directory (default; usually omitted from the written file)

[dev]

FieldDefaultDescription
auto_start_dbtrueStart or reuse a local kalamdb-server (false for remote-only)
apply_schematrueRun the migration pipeline on startup and on schema file changes
generate_typestrueRun kalam schema gen after schema apply
watchtruePoll the schema file during kalam dev (requires [schema].watch = true)

[dev.processes]

Optional map of process name → shell command. kalam dev supervises each entry alongside the database server and schema pipeline.

BehaviorDetail
Init defaultTypeScript projects get app = "<manager> dev" automatically (npm run dev, pnpm dev, yarn dev, or bun run dev)
Log prefixEach key becomes a stable prefix — [app], [worker], etc. — distinct from [cli] workflow output and [server] database logs
ExecutionCommands run from the project root through the system shell
Multiple processesAdd any number of entries
Dart-only projectsSection is omitted; scaffold includes a commented example
TOML
[dev.processes]app = "pnpm dev"agent = "dart run bin/agent.dart"

[logging]

FieldDefaultDescription
filetrueWrite workflow logs to disk
capture_process_outputtrueMirror managed process stdout/stderr into the log file (secrets redacted)
pathkalam/cli/logs/kalam.logLog file path (default; usually omitted from the written file)

Environment resolution

SettingResolution order (first match wins)
Environment name--envKALAM_ENV[project].default_envdev
Server URLKALAM_URL[connection.<env>].url
Namespace--namespaceKALAM_NAMESPACE[connection.<env>].namespace

Credential profiles follow the pattern kalam-<env> in ~/.kalam/. After kalam init, .env sets KALAM_PROFILE=kalam-dev.

Validation

The CLI validates kalam.toml on load:

  • project.name must be non-empty
  • project.kalam_dir must be a relative in-project path
  • schema.path is required when schema.mode = "sql"
  • Every schema.languages entry needs a matching [schema.targets.<lang>]
  • Generated output paths must be unique
  • package_manager must be one of npm, pnpm, yarn, bun when set
Last updated on