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.
Installation
Section titled “Installation”To install the tld CLI, run the following command in your terminal:
curl -LsSf https://tldiagram.com/install.sh | shOR with brew
brew install --cask Mertcikla/tap/tldGetting Started
Section titled “Getting Started”Follow these steps to generate a diagram for your project:
1. Initialize the Workspace
Section titled “1. Initialize the Workspace”Go to your project’s root directory and initialize the tld workspace:
tld init2. Login and Authorize
Section titled “2. Login and Authorize”Authenticate your CLI with tldiagram.com:
tld loginFollow the prompts in your browser to authorize access.
3.a Install the Agent Skill
Section titled “3.a Install the Agent Skill”Add the create-diagram skill to your favorite AI agent:
npx skills add Mertcikla/tld-cli3.b Gemini Extension
Section titled “3.b Gemini Extension”gemini extensions install https://github.com/Mertcikla/tld-cli3.c Claude Plugin
Section titled “3.c Claude Plugin”SOON
3.d VS Code Extension
Section titled “3.d VS Code Extension”Download the official VS Code Extension to view and edit your diagrams directly within your IDE.
Generating Diagrams with AI
Section titled “Generating Diagrams with AI”Once the skill is installed, you can use your AI agent to map your codebase.
Prompt the Agent
Section titled “Prompt the Agent”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”
Preview the Plan
Section titled “Preview the Plan”Before publishing, review the changes that will be made:
tld planThis generates a summary of the diagrams and objects to be created. You can manually inspect the generated YAML files in your repository if needed.
Apply and Publish
Section titled “Apply and Publish”When you’re satisfied with the plan, publish your diagram to tldiagram.com:
tld applyYour architecture is now live and can be viewed, edited, and shared on the tldiagram web interface.