.xtraqconfig – version-controlled JSON that captures non-sensitive defaults (for example target framework or schema allow-list) and records the resolved namespace/output folder. Every clone reads this file so the entire team works from the same baseline..xtraqconfig.local – optional untracked overlay for machine- or environment-specific defaults. Uses the same schema as .xtraqconfig, lives beside it, and is ignored by Git by default..env – private developer file used strictly for the generator connection string and logging/diagnostic toggles. It stays out of source control and should remain minimal.ProjectEnvironmentBootstrapper – helper that scaffolds a minimal .env, derives .xtraqconfig from CLI inputs, and updates both without clobbering intentional values.Xtraq/ is regenerated on every xtraq build. Do not place handwritten code or configuration files there because the folder may be deleted or overwritten at any time..xtraq/ stores snapshots, cache entries, and optional telemetry. Treat it as an ephemeral working directory and keep custom assets elsewhere.xtraq build --output Generated)XTRAQ_GENERATOR_DB, XTRAQ_LOG_LEVEL, XTRAQ_VERBOSE, etc.).xtraqconfig.local (optional overlay for machine-local defaults).xtraqconfig (canonical team defaults).env simply seeds the process environment with the few allowed secrets and logging flags listed above. Configuration values such as namespaces, schema filters, target frameworks, API toggles, and EF integration settings now come exclusively from .xtraqconfig / .xtraqconfig.local or explicit CLI switches.
.xtraqconfigxtraq init writes .xtraqconfig automatically, but you can edit it directly to capture project-wide changes. The CLI always persists the Namespace because downstream generators treat it as mandatory; if you omit --namespace, init resolves the value from the nearest .csproj and falls back to the directory name when that fails. Other properties remain optional—OutputDir still defaults to Xtraq, and arrays such as BuildSchemas can be skipped entirely. Even when every other value relies on defaults, the file keeps the $schema reference together with the resolved Namespace so future commands remain deterministic.
{
"Namespace": "Contoso.Billing",
"OutputDir": "Xtraq",
"TargetFramework": "net8.0",
"BuildSchemas": ["core", "identity"]
}
| Property | Description | Default when omitted | Notes |
|---|---|---|---|
Namespace | Base namespace for generated artefacts | Resolved during xtraq init (csproj name or directory when no project file is present) | Override only when the auto-detected value is unsuitable |
OutputDir | Relative folder that receives generated files | Xtraq | Pick a different folder if needed |
TargetFramework | Template hint used during generation (e.g. net8.0, net10.0) | net10.0 | Subject to roadmap upgrade |
BuildSchemas | Allow-list of schemas to include | Includes every discovered schema (empty allow-list) | Provide values to restrict generation |
These properties are now sourced exclusively from .xtraqconfig / .xtraqconfig.local or explicit CLI switches—the runtime no longer mirrors them into environment variables or auxiliary payloads.
Recommendations:
.xtraqconfig with every intentional change so teammates receive the same defaults.BuildSchemas even when only one schema is included; the bootstrapper preserves ordering and removes duplicates..xtraqconfig, run xtraq build, review the diff, and commit the configuration and generated artefacts together..xtraqconfig Standard PayloadWhen the file stores configuration directly, the tracked JSON exposes only non-sensitive knobs. Secrets such as XTRAQ_GENERATOR_DB are never written to .xtraqconfig; they stay exclusively in .env or external secrets stores. Environment overrides for configuration (for example XTRAQ_NAMESPACE, XTRAQ_BUILD_SCHEMAS) were removed—edit the JSON directly or use CLI switches instead.
Editors that support JSON Schema can surface completions for .xtraqconfig and .xtraqconfig.local. Reference the published schema to enable IntelliSense:
{
"$schema": "https://nuetzliches.github.io/xtraq/xtraqconfig.schema.json"
}
You can also point to a local copy at docs/public/xtraqconfig.schema.json if you prefer offline validation.
The CLI adds the $schema reference automatically when writing .xtraqconfig; keep it if you want IDE completions to stay active.
.xtraqconfig.local (Optional Overlay)Create .xtraqconfig.local alongside the tracked file when you need local defaults that should never be committed—common examples include alternative output folders, experimental namespace prefixes, or a reduced schema list while iterating. The loader merges the files by taking any value present in .xtraqconfig.local and falling back to .xtraqconfig when absent.
{
"Namespace": "Contoso.Billing.Experimental",
"OutputDir": "Xtraq.Local",
"BuildSchemas": ["identity"]
}
.xtraqconfig; copy only the keys you want to override locally.ProjectEnvironmentBootstrapper.EnsureProjectGitignore writes a dedicated # Xtraq block containing .xtraqconfig.local)..xtraqconfig; .xtraqconfig.local is explicitly for per-developer tweaks and should stay out of automation..xtraqconfig Redirect Mode (Optional)If the file contains a ProjectPath property, xtraq treats it as a redirect. The value can be:
"." to point at the same directory (used by xtraq init during bootstrap)..xtraqconfig and .env.In redirect mode all other properties in the file are ignored. Redirect chains up to ten levels are supported; circular references resolve to the last visited directory to avoid infinite loops. Redirects are mainly used to avoid generating artefacts in the execution directory—for example when .xtraqconfig lives under src/ while commands run from the repository root.
| Key | Purpose | Notes |
|---|---|---|
XTRAQ_GENERATOR_DB | Connection string used for metadata snapshots and builds | Required. Must be stored in .env or environment not checked into source control. |
.envOnly diagnostic switches are allowed alongside XTRAQ_GENERATOR_DB. Use them sparingly and remove them when no longer needed.
| Key | Purpose | Guidance |
|---|---|---|
XTRAQ_LOG_LEVEL | Overrides logging verbosity (info, debug) | Useful while diagnosing generator output; defaults back to info |
XTRAQ_VERBOSE | Enables verbose console streaming (similar to --verbose) | Keep disabled unless actively troubleshooting |
XTRAQ_ALIAS_DEBUG | Emits additional alias binding diagnostics | Combine with XTRAQ_LOG_LEVEL=debug when analysing SQL bindings |
XTRAQ_FORWARDING_DIAG | Logs forwarding/dispatcher decisions for generated pipelines | Helpful when tracing policy execution |
XTRAQ_DEFER_JSON_FUNCTION_EXPANSION | Skips automatic JSON function expansion diagnostics | Advanced ScriptDom debugging only |
XTRAQ_DUMP_FIRST_ROW | Dumps the first row of each result set during diagnostics | Never enable in production – may expose sensitive data |
XTRAQ_JSON_AST_DIAG | Emits detailed ScriptDom findings during JSON analysis | Produces debug/json-ast.txt logs |
XTRAQ_JSON_AUDIT | Writes debug/json-audit.txt summarising every JSON result set | Helpful when validating stored procedure output |
XTRAQ_JSON_TYPE_LOG_LEVEL | Controls verbosity for JSON type inference | Combine with XTRAQ_LOG_LEVEL for full traces |
XTRAQ_LOG_JSON_TYPE_MAPPING | Records JSON type mapping decisions | Use together with XTRAQ_JSON_TYPE_LOG_LEVEL=debug |
Remove the entry after finishing the investigation so future runs fall back to the tracked defaults.
.env)Some operational switches remain environment-driven for CI or integration scenarios, but the .env loader no longer imports them. Configure these via your shell, CI variables, or launch profiles:
| Key | Purpose | Notes |
|---|---|---|
XTRAQ_NO_UPDATE | Disables auto-update prompts | Equivalent to --no-update; ideal for CI or unattended runs |
XTRAQ_CONFIG_PATH | Points the CLI at an alternate .xtraqconfig root | Useful when working from solution roots or workspace aggregations |
XTRAQ_PROJECT_PATH | Forces the resolver to treat a specific directory as root | Set automatically by CLI helpers; override only when scripting |
XTRAQ_SNAPSHOT_ROOT | Pins .xtraq discovery to a specific folder | Handy for multi-repo workspaces |
XTRAQ_TEST_CONNECTION_STRING | Supplies integration test databases for test projects | Keep this secret outside of .env to avoid accidental commits |
XTRAQ_SKIP_DOCKER_TESTS | Skips container-backed integration tests | CI convenience flag |
.env ResponsibilitiesThe bootstrapper copies .env.example, but only a handful of keys are required for day-to-day work. Keep everything else commented unless you are actively testing a preview feature.
XTRAQ_GENERATOR_DB=Server=localhost;Database=AppDb;Trusted_Connection=True;TrustServerCertificate=True;
# Optional diagnostics
# XTRAQ_LOG_LEVEL=debug
# XTRAQ_VERBOSE=1
| Key | Purpose | Guidance |
|---|---|---|
XTRAQ_GENERATOR_DB | Metadata discovery connection string | Required secret – never commit, rotate regularly |
XTRAQ_LOG_LEVEL | Overrides logging verbosity | Optional; reset to default (info) after diagnostics |
XTRAQ_VERBOSE | Enables verbose console diagnostics | Equivalent to passing --verbose; keep disabled by default |
Running xtraq init or invoking commands that require configuration triggers the bootstrapper:
.env exists; if missing, offers to create a minimal file and copies comments from .env.example verbatim..xtraqconfig, carrying forward existing values to avoid accidental resets.Re-run xtraq init --force whenever template keys change upstream or you want to rebuild .env from scratch while preserving .xtraqconfig.
.xtraqconfig first, then regenerate artefacts..env.example aligned with the keys that the CLI understands; every documented key should include a sentence in this page..xtraqconfig (or maintain a dedicated branch) instead of leaning on environment variables—only secrets and diagnostics remain environment-driven..env as disposable.Can .env live outside the repository?
Yes. Pass XTRAQ_CONFIG_PATH and XTRAQ_GENERATOR_DB as process environment variables in CI/CD or containerised environments. The CLI resolves relative hints against the working directory when needed.
How do I absorb new keys from the template?
Pull the latest changes, run xtraq init --force, review the resulting .env diff, and update this page if new keys are promoted to tracked configuration.
.env exists in every project that runs the current CLI and contains at least XTRAQ_GENERATOR_DB (plus temporary logging toggles when required—never other configuration keys)..env, while every deterministic setting flows through .xtraqconfig..xtraqconfig changes are reviewed like code and committed alongside feature work so every clone shares the same defaults.Reference Overview
Central entry point for configuration, JSON handling, table types, and naming conventions. Use this section to deep dive into the core surfaces that xtraq emits and the configuration knobs that shape the generated code.
API Integration
Minimal wiring to call generated procedures from ASP.NET Core (or any DI host), with room to add policies and streaming later.