Skip to content

tld CRUD Commands

View Markdown

These were designed for agentic workflows in mind. Brief, token efficient, predictable commands that can return instant feedback to the agent. Show informative warnings about potential issues, and guide it towards a well-structured architecture.

If you are using these with scripting to manage your diagrams programmatically, please let us know!

Create or update an element.

Terminal window
# Minimal
tld add my-service
# With details
tld add payment-svc \
--ref payment-svc \
--kind service \
--description "Handles payment processing" \
--technology Go \
--parent api-gateway \
--position-x 100 \
--position-y 200 \
--diagram-label "Payments"
FlagDescription
--refOverride the generated ref (defaults to a slugified name)
--kindElement kind: service, database, queue, person, system, container, component
--descriptionShort description string
--technologyTechnology stack label
--urlExternal URL (repository link, docs, etc.)
--parentParent element ref (default: root)
--position-xHorizontal canvas position
--position-yVertical canvas position
--diagram-labelOptional label for the element’s canonical diagram

If an element with the same ref already exists, tld add updates it. It’s an upsert , safe to run multiple times, safe to script.

Terminal window
# Add with JSON output
tld add cache-redis --kind database --technology Redis --format json

Create a connector (edge) between two elements.

Terminal window
# Basic
tld connect --from api-gateway --to auth-svc
# With details
tld connect \
--from api-gateway \
--to payment-svc \
--label "processes payments" \
--description "Sends payment requests via gRPC" \
--relationship "calls" \
--direction forward
# Bidirectional
tld connect --from auth-svc --to user-db --direction both --label "reads/writes"
FlagDescription
--fromSource element ref (required)
--toTarget element ref (required)
--labelEdge label text
--descriptionLonger description
--relationshipSemantic type (e.g. “calls”, “publishes”, “queries”)
--directionforward, backward, both, or none
--urlExternal URL

The view is inferred automatically based on the elements’ placements. If both elements share a parent, the connector goes in that parent’s view. Otherwise, it goes in the root view.

Delete elements or connectors.

Terminal window
# Remove an element by ref
tld remove element payment-svc
# Remove a connector
tld remove connector --view root --from api-gateway --to auth-svc

Removing an element also cleans up all connectors that reference it. Removals are local , they don’t affect the cloud version until you tld apply.

Rename an element. All references in connectors and other elements are updated automatically.

Terminal window
tld rename --from old-ref --to new-ref

This is a safe refactor. Every connector that referenced old-ref now references new-ref. Every placement is preserved. It’s a one-liner.

Change a specific field on an element or connector.

Terminal window
# Update element field
tld update element api-gateway description "Routes external requests to internal services"
# Update connector field
tld update connector root:api-gateway:auth-svc:calls label "validates JWT"

Connectors use a compound key: view:source:target[:label]

  • root:api-gateway:auth-svc , connector in root view between those two elements
  • root:api-gateway:auth-svc:calls , with a label to disambiguate

All CRUD commands support --format json:

Terminal window
tld add my-service --format json
# {"command":"add","status":"ok","action":"add","ref":"my-service"}
tld connect --from api-gateway --to auth-svc --format json
# {"command":"connect","status":"ok","action":"connect","ref":"api-gateway:auth-svc"}