tld provides a complete software architecture management platform that bundles a high-performance Go backend with an interactive React frontend into a single, standalone binary. Includes a CLI to enable managing diagrams from the shell or in CI.
Designed for local-first development and private self-hosting, tld allows teams to visualize, document, and manage their system architecture using a combination of a rich web UI and "Diagrams as Code" workflows.
-
Full-Featured Web UI: A React frontend designed, polished and optimized to handle complex architectures while attempting to intelligently show and hide details.
-
Bi-directional Sync: Seamlessly sync changes between your local YAML files, the self-hosted web UI, and the cloud version at tlDiagram.com.
-
Standalone Distribution: A single, dependency-free binary containing both the server and the web application.
-
CLI built that speaks agent: Use the agent skill and teach your agent how to create a diagram of your codebase with the exact detail level you need. You can prompt your agent to add/remove details as needed. Here are some examples that were generated using the agent skill.
-
Diagrams as Code: A Git-like workflow (
plan/apply) to manage architectural evolution alongside your source code. -
Automated Codebase Analysis: (Preview) Built-in tree-sitter integration to automatically discover architecture components in Go, Java, Python, C++, and TypeScript (more soon™ (hopefully)).
- Quick Start
- Deployment & Self-Hosting
- The tlDiagram Workflow
- Tech Stack
- Development Setup
- Commands Reference
- Workspace Structure
- Environment Variables
- Troubleshooting
curl -LsSf https://tldiagram.com/install.sh | sh -s serve --openWindows:
powershell -ExecutionPolicy ByPass -c "irm https://tldiagram.com/install.ps1 | iex; tld serve --open"OR
curl -LsSf https://tldiagram.com/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://tldiagram.com/install.ps1 | iex"Initialize a workspace and start the local server:
tld serveOpen http://localhost:8060 to start visually mapping your architecture.
The tld binary is designed to be run as a persistent service in your infrastructure or as a local development tool.
Run tld serve in any directory to start a local instance that uses your current folder for storage.
- Provide a persistent volume for the
.tld/directory (where YAMLs and the SQLite cache are stored). - Set
TLD_ADDR=0.0.0.0andPORT=8060.
tld bridges the gap between manual diagramming and automated documentation.
- Visualize: Use
tld serveto open the interactive UI. Drag, drop, and connect components. - Automate: Run
tld analyzeto scan your repository. It will suggest new elements and connectors based on your actual source code. - Commit: Save your changes. All UI edits are persisted to
elements.yamlandconnectors.yaml. Commit these to Git to version your architecture.
- Backend: Go 1.26+
- CLI: Cobra
- API: Connect RPC (gRPC compatible)
- Analysis: Tree-sitter
- Database: Embedded SQLite (
modernc.org/sqlite)
- Frontend: React 18 & TypeScript
- Visualization: ReactFlow, ElkJS (auto-layout), D3-force
- UI Components: Chakra UI
- Build System: GoReleaser (for cross-platform standalone binaries)
If you want to contribute to tld or build it from source:
- Clone the Repo:
git clone https://github.com/Mertcikla/tld.git
cd tld-
Install Frontend Dependencies:
make frontend-deps
-
Development Mode (Hot Reloading): This starts the Vite dev server for the frontend and the Air reloader for the Go backend.
make dev
-
Production Build:
make build
tld --help
Usage:
tld [command]
CRUD actions on resources:
add Add or update an element in elements.yaml
connect Add a connector between two elements
remove Remove workspace resources
rename Rename an element in elements.yaml
update Update a resource field with a value
Secondary actions:
analyze Extract symbols from source files and upsert them as workspace elements
apply Apply plan to the tldiagram.com
check Check workspace health and diagram freshness
completion Generate the autocompletion script for the specified shell
diff Show differences between local workspace and server
export Export all diagrams from an organization to the local workspace
help Help about any command
init Initialize a new tld workspace
login Authenticate the CLI with a tlDiagram server
plan Show what would be applied
pull Pull the current server state into local YAML files
serve Start the local tlDiagram web server
status Show sync status between local YAML and the server
stop Stop the local tlDiagram web server
validate Validate the workspace YAML files
version Print the version number of tld
views Show derived view structure for the workspace
Flags:
--compact compact JSON output (no whitespace)
--format string output format: text or json (default "text")
-h, --help help for tld
-v, --version version for tld
-w, --workspace string workspace directory (default "tld")
Use "tld [command] --help" for more information about a command
.tld.yaml: Project settings and exclusions.elements.yaml: Definitions for all components and their placements.connectors.yaml: Connection and relationship definitions..tld.lock: Tracks sync state and versioning.
| Variable | Description | Default |
|---|---|---|
TLD_ADDR |
Host address to bind the server. | 127.0.0.1 |
PORT |
Port for the web UI and API. | 8060 |
TLD_API_KEY |
API key for cloud synchronization. | - |
- "Server already running": Run
tld stopto clear the PID file and shut down the background process. - UI not reflecting YAML changes: Restart the server or ensure
tld serveis running in the correct directory. - Language support: If a language isn't detected, ensure the parser is registered in
internal/analyzer.