Everything You Need to Know About TDK CLI Core
TDK CLI Core is the command-line tool at the centre of TDK. It describes each service of an application in a small service.json file, generates the local runtime files from those descriptions, and starts the whole stack with Docker and Tilt. You write the application code. The tool writes the plumbing. What it does Describes services. Each service has a service.json with its runtime, port, and…
TDK CLI Core is a command-line tool that serves as the backbone of TDK. Its primary purpose is to simplify the process of developing applications by managing the local runtime files and starting the entire stack. To begin, you write the application code while TDK CLI Core takes care of the necessary plumbing.
Each service within an application is defined in a service.json file, which includes details such as the runtime, port, and dependencies. TDK CLI Core generates the required Dockerfiles, routing configuration, and Tilt wiring under the .autogenerated/ directory. When you initiate the stack using the command "tdk up", the tool runs the containers, routes traffic through Traefik, and keeps everything updated using Tilt.
Before starting the stack, TDK CLI Core performs a self-check by comparing the generated files with saved snapshots. If any manual edits have been made, this comparison will flag them for review before the stack begins running. To create a new project, you can use the command "tdk project --yes", and to add a new service, use "tdk resource name --type type", with various service types available such as frontend, backend, worker, mcp, and bring-your-own.
Before proceeding with the stack, it's wise to run a dry run using "tdk up main --dry-run" to ensure everything is set up correctly. Upon completion, you can monitor the stack using "tdk ui" or check the readiness of individual services through "tdk status --json". In case you encounter any issues, "tdk doctor --json" can help identify if your machine is capable of running the stack. To view recent log entries for a specific service, use "tdk logs --json --service name --tail n".
It's important to note that TDK CLI Core is designed for local development and should not be considered a deployment tool. Production deployment is typically handled by external tools like Helm, Argo CD, or Kustomize. Additionally, a container runtime is required for TDK CLI Core to function, and if one is not present, the tool will notify you and prevent the stack from starting.
For further reference, the TDK CLI Core repository contains a complete command reference, while the generated files reference explains the contents of the .autogenerated/ directory. Example projects are also provided to showcase how to use TDK CLI Core effectively.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.