@dbx-tools/appkit-env
v0.3.20
Published
CLI and formatting helpers for exporting AppKit auto-configuration results.
Readme
@dbx-tools/appkit-env
CLI and formatting helpers for exporting AppKit auto-configuration results.
Use the appkit-env bin when a shell or process manager needs the Lakebase /
AppKit environment that @dbx-tools/appkit would
resolve before createApp().
Key features:
- Runs the same AppKit auto-configuration path used by
@dbx-tools/appkit. - Emits only variables that changed during auto-configuration.
- Supports shell
export, JSON, and Windowssetoutput formats. - Provides importable env snapshot/diff/format helpers for tests and wrapper CLIs.
- Keeps local shell setup aligned with deployed AppKit startup behavior.
Load Env Into A Shell
eval "$(appkit-env --quiet)"The command snapshots process.env, runs AppKit auto-config, diffs the result,
and prints only new or changed variables. On POSIX shells the default output is
export KEY=value.
This is useful when another process must start after Lakebase discovery has
filled PGHOST, PGDATABASE, PGUSER, or related AppKit variables.
Inspect JSON Or Windows Output
appkit-env --format json
appkit-env --format windowsUse JSON for process managers and tests. Use Windows format for cmd.exe
set KEY=value lines.
Format Env Diffs Programmatically
import { envExport } from "@dbx-tools/appkit-env";
const before = envExport.snapshotEnv();
process.env.PGHOST = "ep-foo.database.azuredatabricks.net";
const diff = envExport.diffEnv(before);
console.log(envExport.formatEnvExport(diff, "export"));These helpers are useful in tests for auto-config behavior or in custom CLIs that want the same output formats without invoking the bin.
Modules
envExport- env snapshots, env diffs, default format detection,formatEnvExport(), andparseEnvExportFormat().
Auto-config itself lives in
@dbx-tools/appkit.
