tcon is a zero-dependency typed configuration compiler in Rust.
It compiles .tcon files (TypeScript-like DSL) into deterministic config outputs and detects drift.
Documentation:
- User guide:
docs/user-guide.md - CLI reference:
docs/cli-reference.md - DSL reference:
docs/dsl-reference.md - Diagnostics contract:
docs/diagnostics/v1.md - Publication guide:
docs/publication/github.md - CI/CD:
docs/ci.md
tcon is currently versioned as v1.0.0 and includes frozen compatibility snapshots in compat/v1/.
Build and install locally:
./scripts/install.shOn Windows PowerShell:
./scripts/install.ps1Then run directly:
tcon --help
tcon --versionUninstall:
- macOS/Linux:
./scripts/uninstall.sh - Windows:
./scripts/uninstall.ps1
tcon build [--entry <file.tcon>]- generate output filestcon check [--entry <file.tcon>]- verify generated files are up-to-datetcon diff [--entry <file.tcon>]- show first-difference drift summariestcon print --entry <file.tcon>- print parsed AST/programtcon watch [--entry <file.tcon>]- rebuild when entry files changetcon init [--preset <name>] [--force]- scaffold.tconentries for common formats
Global flags:
--error-format text|json- emit human-readable or machine-readable structured errors
jsonyamlenvtomlproperties
spec.pathmust stay inside the workspace (absolute paths,..traversal, and symlink escapes are rejected)..secret()fields must be environment-sourced (${VAR}/${VAR:default}) and are redacted intcon print..secret()fields do not permit.default(...)to avoid embedding fallback secrets in schema definitions.
export const spec = {
path: "server.json",
format: "json",
mode: "replace",
};
export const schema = t.object({
host: t.string().default("0.0.0.0"),
port: t.number().int().min(1).max(65535).default(8080),
}).strict();
export const config = {
port: 3000,
};Import symbols from other .tcon files:
import { sharedSchema, sharedConfig } from "./base.tcon";
export const schema = sharedSchema;
export const config = sharedConfig;cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets
Generate release archives + checksums:
- macOS/Linux:
./scripts/package-release.sh 1.0.0 [targets...] - Windows:
./scripts/package-release.ps1 -Version 1.0.0 [-Target ...]