{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Treasure Code","product_name":"Treasure Code","type":"markdown"},"seo":{"title":"tdx llm - LLM Project Management | Treasure Data","description":"Manage LLM projects and chat sessions. List projects, agents, and view chat history.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"image":"/assets/og-image.ba836864a30434f560a4f7720f8a09019ad30ff828b20c5052ae933ba7121524.d7ef4821.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"llm-commands","__idx":0},"children":["LLM Commands"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Manage LLM projects and chat sessions."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"commands","__idx":1},"children":["Commands"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx llm projects [pattern]          # List projects\ntdx llm project list [pattern]      # Same as projects\ntdx llm agents [pattern]            # List agents (alias for tdx agent list)\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Agent Commands"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Agent management commands have moved to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/commands/agent"},"children":["Agent Commands"]}," for:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent list"]}," - List agents"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent show"]}," - Show agent details"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent create"]}," - Create a new agent"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent update"]}," - Update an existing agent"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent delete"]}," - Delete an agent"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"project-management","__idx":2},"children":["Project Management"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"set-project-context","__idx":3},"children":["Set Project Context"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Set current project context (session-only)\ntdx llm use \"MyProject\"\n\n# Now all agent commands use \"MyProject\" by default\ntdx agent list\ntdx agent show \"Data Analyst\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"set-default-agent-for-chat","__idx":4},"children":["Set Default Agent for Chat"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set a default agent for chat operations using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx use agent"]},", so you don't need to specify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--agent"]}," each time:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Set default agent (use \"Project/Agent\" format)\ntdx use agent \"MyProject/My Agent\"\n\n# Now new chats use this agent by default\ntdx chat --new \"Your question here\"\ntdx chat \"Another question\"  # Continues the chat\n\n# Override with --agent for a specific new chat\ntdx chat --new \"Question\" --agent \"OtherProject/OtherAgent\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The default agent preference is:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Stored in session context (same as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx use database"]},", etc.)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Used automatically by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx chat --new"]}," when no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--agent"]}," flag is specified"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Overridden by explicit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--agent"]}," flag"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-and-create-projects","__idx":5},"children":["List and Create Projects"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# List available models\ntdx llm models\n\n# List all projects\ntdx llm projects\n\n# List projects matching pattern\ntdx llm projects \"data*\"\ntdx llm projects \"*_prod\"\n\n# Create a new project\ntdx llm project create \"MyProject\" --description \"Data analysis project\"\n\n# Delete a project\ntdx llm project delete \"OldProject\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"backup-and-restore-projects-deprecated","__idx":6},"children":["Backup and Restore Projects (Deprecated)"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"DEPRECATED"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["backup"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["restore"]}," commands are deprecated. Use the new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent"]}," commands instead:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent pull"]}," - Export project to Git-friendly YAML/Markdown format"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent push"]}," - Import local files to project"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent clone"]}," - Clone a project to a new project"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/commands/agent"},"children":["Agent Commands"]}," for full documentation."]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["Legacy backup/restore commands (click to expand)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Backup an entire LLM project to a folder, including all agents, knowledge bases, prompts, and integrations:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Backup project to default folder ({project_name}.llm)\ntdx llm project backup \"MyProject\"\n\n# Backup to custom folder\ntdx llm project backup \"MyProject\" -o ./backups/myproject\n\n# Preview what would be backed up (dry-run)\ntdx llm project backup \"MyProject\" --dry-run\n\n# Overwrite existing backup without confirmation\ntdx llm project backup \"MyProject\" -y\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Restore a project from a backup:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Restore project with original name\ntdx llm project restore ./MyProject.llm\n\n# Restore with a new name\ntdx llm project restore ./MyProject.llm --name \"MyProject-restored\"\n\n# Preview what would be restored (dry-run)\ntdx llm project restore ./MyProject.llm --dry-run\n\n# Skip confirmation if project exists\ntdx llm project restore ./MyProject.llm -y\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Backup Contents"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The backup folder contains:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project.json"]}," - Project metadata and backup info"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["agents.json"]}," - All agents with full configuration"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["knowledgebases.json"]}," - All knowledge bases"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["prompts.json"]}," - All prompts"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integrations.json"]}," - All integrations"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"agent-management","__idx":7},"children":["Agent Management"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Agent commands have moved to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx agent"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/commands/agent"},"children":["Agent Commands"]}," for full documentation."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# List agents (alias kept for convenience)\ntdx llm agents\n\n# Or use the new commands\ntdx agent list\ntdx agent show \"My Agent\"\ntdx agent create \"New Agent\"\ntdx agent update \"My Agent\" --prompt \"...\"\ntdx agent delete \"Old Agent\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"chat-history","__idx":8},"children":["Chat History"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# List recent chat sessions\ntdx llm history\n\n# Show specific chat messages\ntdx llm history chat456\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"project-resolution","__idx":9},"children":["Project Resolution"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Agent commands resolve projects in this order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--llm-project"]}," global option (highest priority)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx llm use <project>"]}," context (session-only)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Default project ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx_default_<username>"]}," (auto-created)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"claude-code-integration","__idx":10},"children":["Claude Code Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/commands/claude"},"children":["tdx claude"]}," for launching Claude Code with TD LLM backend."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options-reference","__idx":11},"children":["Options Reference"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"backup-options-deprecated","__idx":12},"children":["Backup Options (Deprecated)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-o, --output <folder>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Output folder"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["{project_name}.llm"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--dry-run"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Preview without creating files"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-y, --yes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip confirmation prompt"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["false"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"restore-options-deprecated","__idx":13},"children":["Restore Options (Deprecated)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--name <text>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["New project name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Original name from backup"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--dry-run"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Preview without making changes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-y, --yes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip confirmation prompt"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["false"]}]}]}]}]}]},"headings":[{"value":"LLM Commands","id":"llm-commands","depth":1},{"value":"Commands","id":"commands","depth":2},{"value":"Project Management","id":"project-management","depth":2},{"value":"Set Project Context","id":"set-project-context","depth":3},{"value":"Set Default Agent for Chat","id":"set-default-agent-for-chat","depth":3},{"value":"List and Create Projects","id":"list-and-create-projects","depth":3},{"value":"Backup and Restore Projects (Deprecated)","id":"backup-and-restore-projects-deprecated","depth":3},{"value":"Agent Management","id":"agent-management","depth":2},{"value":"Chat History","id":"chat-history","depth":2},{"value":"Project Resolution","id":"project-resolution","depth":2},{"value":"Claude Code Integration","id":"claude-code-integration","depth":2},{"value":"Options Reference","id":"options-reference","depth":2},{"value":"Backup Options (Deprecated)","id":"backup-options-deprecated","depth":3},{"value":"Restore Options (Deprecated)","id":"restore-options-deprecated","depth":3}],"frontmatter":{"seo":{"title":"tdx llm - LLM Project Management | Treasure Data","description":"Manage LLM projects and chat sessions. List projects, agents, and view chat history.","image":"/assets/og-image.ba836864a30434f560a4f7720f8a09019ad30ff828b20c5052ae933ba7121524.d7ef4821.png"}},"lastModified":"2026-03-31T01:31:33.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/treasure-code/commands/llm","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}