DEV Community

Cover image for One Command, 18 Generated Files: Inside TDK CLI's Local Stack
tdk-cli
tdk-cli

Posted on

One Command, 18 Generated Files: Inside TDK CLI's Local Stack

I ran TDK CLI on a scratch project to count what it generates. The answer is 18 files per frontend service, not 17. I checked the count on the CLI version I had installed (1.3.178).

The setup takes two commands

tdk project --yes
tdk resource storefront-web --type frontend -y
Enter fullscreen mode Exit fullscreen mode

The first command creates the project. The second scaffolds a React frontend. It writes nine source files you own: package.json, index.html, tsconfig.json, Dockerfile, service.json, src/App.tsx, src/main.tsx, a test file, and public/.gitkeep.

The 18 generated files appear later, when you run tdk up. Starting the stack regenerates everything under .autogenerated/.

What the 18 files are

They sit in services/main/storefront-web/.autogenerated/. Each one is a runtime file the stack needs, and each one starts with a warning not to edit it.

File What it does
nginx.autogenerated.conf Serves the built frontend and routes API calls.
Dockerfile.app.autogenerated Builds the app image.
Dockerfile.app.autogenerated.dockerignore Keeps unneeded files out of the image build.
.env.frontend.autogenerated Local frontend environment settings.
env.ts Exports the generated API URL.
vite.config.frontend.autogenerated.ts Dev server config.
vite.config.build.autogenerated.ts Production build config served by nginx.
tsconfig.autogenerated.json TypeScript settings for local development.
tsconfig.docker.autogenerated.json TypeScript settings for the container build.
.npmrc.autogenerated Package registry settings on the host.
.npmrc.docker.autogenerated Package registry settings in the container.
bunfig.autogenerated.toml Bun settings on the host.
bunfig.docker.autogenerated.toml Bun settings in the container.
api-client.ts A client preconfigured for the frontend's API route.
api-index.ts Re-exports the client and URL.
AGENTS.md A notice telling coding agents not to edit the directory.
validation-report.autogenerated.json The generator's validation result.
service.yaml A projection of service.json for Tilt. Edit the JSON instead.

The host and container config pairs exist because the two environments use different registry addresses and source paths.

Why 18 and not 17

I counted 18 files at the top of .autogenerated/. I also counted 18 snapshot copies under .autogenerated/.tdk-contract/. Those snapshots are what drift checks compare against. They are not separate outputs, so they are not included in the 18.

If you leave out service.yaml because it is a projection rather than a runtime file, you get 17.

Why the generated files matter

Editing a generated file is a mistake, and TDK makes that mistake visible. Before Tilt starts, tdk up compares each file with its snapshot. A hand edit blocks startup and names the file. tdk up --dry-run runs the same check without starting containers.

The fix is to change service.json and run tdk up again. TDK regenerates the output from the manifest. Two services built from the same manifest produce the same files, which means you never have to reconcile hand-edited copies.

Limits

These 18 files are for a Bun and TypeScript frontend. A Bun backend generates a different set. Python, Go, and Rust backends generate their own runtime files and skip the Bun and Vite configs.

The stack needs Docker. I ran the scratch project on a machine with Docker running. The services themselves were not built or tested beyond generation.

Try it

npm install -g @tdk-landscape/tdk-cli-core
tdk project --yes
tdk resource storefront-web --type frontend -y
tdk up main --dry-run
Enter fullscreen mode Exit fullscreen mode

Then count the files yourself. The generated files reference lists them all.

Top comments (0)