Guides

Seed Local Files

Get .env.local and other untracked files into every new workspace automatically.

A fresh worktree has everything git tracks and nothing it does not — which means no .env.local, no local certificates, no scratch config. Seeding puts them there for you.

Set it up

Declare what to seed

seed_files holds paths relative to the worktree root:

~/.uxd/my-project.toml
[setup]
run = "pnpm install --frozen-lockfile"
seed_files = [".env.local", "config/local.json"]

Put the sources somewhere

uxd looks for each file under <config-dir>/seeds/<project>/, mirroring the worktree layout:

~/.uxd/
  my-project.toml
  seeds/
    my-project/
      .env.local
      config/
        local.json

Materialize a workspace

uxd my-project feat/login run dev
→ worktree ready: ~/dev/uxd/my-project/trees/feat-login
→ seeded .env.local
→ seeded config/local.json
→ running setup

Seeding from an existing checkout

Already keeping your real .env.local in a working copy? Point seed_from at it instead of duplicating the file:

~/.uxd/my-project.toml
[setup]
seed_files = [".env.local"]
seed_from = "~/dev/my-project"

uxd checks <config-dir>/seeds/<project>/ first, then seed_from. The first source that exists wins, so you can override individual files in the seeds tree while letting the rest come from your checkout.

If no source is found, uxd warns and continues rather than failing the command:

warning: no seed source for '.env.local' (looked in seeds/my-project and seed_from)

Existing files are never overwritten

Seeding skips any target that already exists. That protects edits you made inside a workspace from being clobbered on the next run.

To force a refresh — after rotating a key, say:

uxd my-project feat/login run dev --reseed

--reseed removes the target first, then copies the source over it.

seed_files entries must be relative and free of .. segments. Absolute paths and parent traversal are rejected by config validation.

Secrets

Seed files are ordinary files on your disk, copied verbatim. uxd neither encrypts nor redacts them.

  • Keep the seeds directory out of any repository you push.
  • Prefer references (a path to a credential helper, a vault key name) over literal secrets where your app supports it.
  • Remember that --dry-run on a run prints the computed environment, including values from [env] — do not paste that output into a ticket without reading it first.

Verify before you trust it

uxd config validate my-project
→ all project configs valid

Validation is aggregate: it reports every schema error in a file at once, so you fix the whole thing in one pass rather than one error per run.