Skip to content

Configuration

View Markdown

tld has two layers of configuration.

Global config lives at ~/.config/tldiagram/tld.global.yaml. It’s machine-wide: credentials, server preferences, indexing tools, and defaults that apply to every project.

Workspace config lives at .tld/.tld.yaml inside each project for settings like: project name, repositories, and exclude patterns.

Global config values can be overridden with env vars. Workspace config stays in .tld/.tld.yaml.

VariableWhat it does
TLD_CONFIG_DIROverride global config directory (default: ~/.config/tldiagram/)
TLD_DATA_DIROverride data directory (SQLite + logs)
TLD_SERVER_URLCloud server URL (default: https://tldiagram.com)
TLD_API_KEYAPI key for cloud sync
TLD_ORG_IDDefault organization/workspace identifier
TLD_HOSTHost for tld serve (default: 127.0.0.1)
TLD_ADDRBind address for tld serve (host:port; overrides host and port)
PORTPort for tld serve (default: 8060)
TLD_DB_DRIVERsqlite or postgres
TLD_DATABASE_URLPostgreSQL URL when the driver is postgres
TLD_APPLY_TARGETDefault target: auto, local, or remote

Manage it with tld config.

KeyDefaultNotes
server_urlhttps://tldiagram.comCloud/server URL for sync
api_keySecret. Set by tld login
org_idOrganization/workspace id for remote operations
apply.targetautoauto, local, or remote
KeyDefaultNotes
database.driversqlitesqlite or postgres
database.urlSecret. Required when the driver is postgres
KeyDefaultNotes
serve.host127.0.0.1Bind host
serve.port8060Listen port
serve.data_dirDatabase and log directory
serve.public_urlPublic root URL for reverse-proxied deployments
serve.allowed_originsExtra comma-separated CORS origins
KeyDefaultNotes
validation.level2Warning strictness: 1 minimal, 2 standard, 3 strict
validation.allow_low_insightfalseInclude low-insight generated warning groups
validation.include_rulesRule codes to include (comma list)
validation.exclude_rulesRule codes to suppress (comma list)

See Linting Rules for the rule codes.

Overrides the external indexers tld index and tld git compare resolve on PATH.

KeyDefault
index.tools.scip_goscip-go
index.tools.scip_typescriptscip-typescript
index.tools.scip_pythonscip-python
index.tools.scip_javascip-java
index.tools.scip_clangscip-clang
index.tools.scip_dotnetscip-dotnet
index.tools.scip_dartscip-dart
index.tools.scip_phpscip-php
index.tools.scip_rubyscip-ruby
index.tools.rust_analyzerrust-analyzer
index.tools.timeout_seconds300

Controls how tld index --map turns the dependency graph into architectural components.

KeyDefaultNotes
map.grouping.resolution1.0Higher values produce more, smaller communities
map.grouping.min_group_size2Merge groups smaller than this into a sibling
map.grouping.min_root_groups3Minimum root components
map.grouping.max_root_groups20Maximum root components
map.grouping.max_children8Max fan-out of one subdivision
map.grouping.max_depth4Max depth of the group hierarchy
map.grouping.max_leaf_files40Files per leaf view before subdivision
map.budget.max_connectors_per_view40Max rolled-up connectors in one map view
map.budget.max_leaf_connectors_per_view12Max connectors in a file-only map view
KeyDefaultNotes
completion.remotefalseAllow shell completion to query remote resources
updates.autofalseAuto-install CLI updates during startup checks
updates.check_interval24hMinimum time between update checks
.tld/.tld.yaml
project_name: my-project
repositories:
my-repo:
url: https://github.com/org/my-repo
localDir: "."
config:
mode: upsert
exclude:
- vendor/
- node_modules/
- .venv/
- "**/*_test.go"
- "**/*.pb.go"
ModeBehavior
upsertIndexing adds new symbols and updates existing ones. Never deletes. Default.
manualNo automatic changes from indexing. YAML stays the source of truth.
autoIndexing creates, updates, and deletes based on source. Use with caution.

Glob patterns matching files to skip during indexing. The defaults cover most build artifacts; add your own for custom generated directories.

When a setting exists in multiple places, higher wins:

  1. CLI flag (e.g. --port 9090)
  2. Environment variable (e.g. PORT=9090)
  3. Global config (~/.config/tldiagram/tld.global.yaml)
  4. Built-in default

Commit your .tld/ directory (including .tld.yaml) to version control so element and connector definitions travel with the code. Keep machine-specific state — credentials, local server settings, data directory, indexer paths — in global config.

Terminal window
# Where is my global config?
tld config path
# What's currently set?
tld config list
# Show secrets too (be careful)
tld config list --show-secrets
# One specific value
tld config get serve.port
# Change something
tld config set serve.port 9090
# Reset to defaults
tld config reset
# Validate your config
tld config validate