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
The default project data directory is kalam/ (override with [project].kalam_dir).
Full example
[project]
| Field | Required | Default | Description |
|---|---|---|---|
name | yes | — | Project name |
default_env | no | dev | Default environment for workflow commands |
package_manager | no | — | npm, pnpm, yarn, or bun — written by kalam init for TypeScript projects |
kalam_dir | no | kalam | Relative path for migrations, local server config, CLI logs, and schema baselines |
[connection.<env>]
| Field | Required | Description |
|---|---|---|
url | yes | KalamDB HTTP URL |
namespace | yes | Namespace identifier |
Add or update environments without re-running init:
[schema]
| Field | Required | Default | Description |
|---|---|---|---|
mode | yes | — | sql (local file) or remote |
path | when mode = "sql" | — | Schema source path (typically schema.sql) |
watch | no | true | Enable file watch together with [dev].watch |
languages | no | ["typescript"] | Codegen targets: typescript, dart |
Each language in languages requires a matching [schema.targets.<language>] block.
[schema.targets.<language>]
| Field | Required | Description |
|---|---|---|
output | yes | Path for generated SDK/schema artifacts (must be unique per language) |
[migrations]
| Field | Default | Description |
|---|---|---|
auto_create | true | Automatically maintain kalam/migrations/_draft.sql from schema diffs |
dir | kalam/migrations | Migration directory (default; usually omitted from the written file) |
[dev]
| Field | Default | Description |
|---|---|---|
auto_start_db | true | Start or reuse a local kalamdb-server (false for remote-only) |
apply_schema | true | Run the migration pipeline on startup and on schema file changes |
generate_types | true | Run kalam schema gen after schema apply |
watch | true | Poll 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.
| Behavior | Detail |
|---|---|
| Init default | TypeScript projects get app = "<manager> dev" automatically (npm run dev, pnpm dev, yarn dev, or bun run dev) |
| Log prefix | Each key becomes a stable prefix — [app], [worker], etc. — distinct from [cli] workflow output and [server] database logs |
| Execution | Commands run from the project root through the system shell |
| Multiple processes | Add any number of entries |
| Dart-only projects | Section is omitted; scaffold includes a commented example |
[logging]
| Field | Default | Description |
|---|---|---|
file | true | Write workflow logs to disk |
capture_process_output | true | Mirror managed process stdout/stderr into the log file (secrets redacted) |
path | kalam/cli/logs/kalam.log | Log file path (default; usually omitted from the written file) |
Environment resolution
| Setting | Resolution order (first match wins) |
|---|---|
| Environment name | --env → KALAM_ENV → [project].default_env → dev |
| Server URL | KALAM_URL → [connection.<env>].url |
| Namespace | --namespace → KALAM_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.namemust be non-emptyproject.kalam_dirmust be a relative in-project pathschema.pathis required whenschema.mode = "sql"- Every
schema.languagesentry needs a matching[schema.targets.<lang>] - Generated output paths must be unique
package_managermust be one ofnpm,pnpm,yarn,bunwhen set
Related
- Project Init — scaffolding and flags
- Local Development — orchestration and log multiplexing
- Migrations — draft, seal, and apply