Skip to content

CLI Usage with AI Agent

The tld CLI allows you to define, plan, and apply your system architecture diagrams using configuration files. Combined with an AI agent, you can automatically generate and refine diagrams directly from your source code.

To install the tld CLI, run the following command in your terminal:

Terminal window
curl -LsSf https://tldiagram.com/install.sh | sh

OR with brew

Terminal window
brew install --cask Mertcikla/tap/tld

Follow these steps to generate a diagram for your project:

Go to your project’s root directory and initialize the tld workspace:

Terminal window
tld init

Authenticate your CLI with tldiagram.com:

Terminal window
tld login

Follow the prompts in your browser to authorize access.

Add the create-diagram skill to your favorite AI agent:

Terminal window
npx skills add Mertcikla/tld-cli
Terminal window
gemini extensions install https://github.com/Mertcikla/tld-cli

SOON

Download the official VS Code Extension to view and edit your diagrams directly within your IDE.

Once the skill is installed, you can use your AI agent to map your codebase.

Ask your agent to create a diagram:

“Create a diagram of this codebase”

The agent will analyze your project structure and generate the necessary YAML files in your workspace. You can follow along and provide more specific prompts if you want deeper detail on certain modules:

“Add more detail on the authentication flow in the backend directory”

Before publishing, review the changes that will be made:

Terminal window
tld plan

This generates a summary of the diagrams and objects to be created. You can manually inspect the generated YAML files in your repository if needed.

When you’re satisfied with the plan, publish your diagram to tldiagram.com:

Terminal window
tld apply

Your architecture is now live and can be viewed, edited, and shared on the tldiagram web interface.