{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Pi Integration","description":"Treasure AI Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pi-integration","__idx":0},"children":["Pi Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://pi.dev/"},"children":["Pi"]},", a coding assistant that runs in your terminal, with Treasure AI as the backend."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure AI customers can use Pi with their existing ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.treasuredata.com/terms/ai-suite-credits-definition/"},"children":["AI Suite credits"]},". You don't need a separate model subscription for traffic that goes through Treasure AI."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Experimental"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," is an experimental integration. Its behavior, flags, and defaults may change as Pi evolves."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"why-use-it","__idx":1},"children":["Why use it"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Auto by default."]}," New sessions use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/auto"]},", which picks a model for each request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Codemode."]}," Pi can write one script that calls many tools, instead of spending one model turn per call. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-docs"]}," tools are available to these scripts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TD skills included."]}," The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/treasure-code/guide/td-skills#tdx-skills-tdx-skills"},"children":["tdx skills"]}," that ship with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," are available in Pi automatically. No download is needed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Your Pi setup stays as it is."]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," adds its models and tools only for the session it starts. Your Pi settings, sign-ins, and session history are unchanged."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Automatic sign-in."]}," Pi uses your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," login, and tokens refresh while you work."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quick-start","__idx":2},"children":["Quick start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You'll need a Treasure AI account with AI Suite access."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# 1. Install Pi 1.1.0 or later (once per machine)\nnpm install -g @earendil-works/pi-coding-agent\n\n# 2. Sign in to tdx (once per profile)\ntdx auth setup\n\n# 3. Launch Pi against Treasure AI\ntdx pi\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," also needs Node.js on your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATH"]},", which you already have if you installed ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," with npm."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":3},"children":["Examples"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Launch Pi with Treasure AI Auto\ntdx pi\n\n# Start with an initial prompt\ntdx pi -- \"Explain this code\"\n\n# Continue the most recent session in this folder\ntdx pi -- --continue\n\n# Use a specific tdx profile; its region is used automatically\ntdx --profile production pi\n\n# Choose another model by its ID\ntdx pi -- --model tdx/claude-sonnet-5-5\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Anything after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--"]}," is passed to Pi unchanged, so every Pi CLI option works."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"models","__idx":4},"children":["Models"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["New sessions use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/auto"]},", which picks a model for each request. Sessions you continue or resume (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-c"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--continue"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-r"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--resume"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--session"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--session-id"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--fork"]},") keep the model they started with."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To choose a specific model, pass its model ID with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/"]}," prefix, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--model tdx/claude-sonnet-5-5"]},". The list includes the chat models and the aliases such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/efficient"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/auto-cost"]},". Run ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands/ai"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx ai models"]}]}," to see the IDs your account can use. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," loads this list when it starts. If the list can't be loaded, only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/auto"]}," is available."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"codemode","__idx":5},"children":["Codemode"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," turns on Pi's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["codemode"]}," tool. The tools in the table below are then available to the scripts Pi writes:"]},{"$$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":"Tool"},"children":["Tool"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What scripts can do"},"children":["What scripts can do"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run and look up tdx commands for the active profile"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-docs"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Search and read the Treasure AI documentation and API references"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, ask:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"> List my databases and, for the three largest, show their table counts\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pi can answer this with one script that runs several tdx commands and returns only the summary."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you already configured ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-docs"]}," in Pi, your configuration is used instead. Pi's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-mcp"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-extensions"]}," options also turn these tools off."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"No approval prompts"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pi runs tools, including shell commands and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," commands, without asking for confirmation. Review requests that change data before you send them, or add a Pi permission extension."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-skills","__idx":6},"children":["TD skills"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," makes the bundled tdx skills (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx-basic"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["segment"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journey"]},", and the rest) available to Pi. They update when you upgrade ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]},", without a download."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If you already have a skill with the same name, your copy is kept and a warning is shown."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If skill setup fails, Pi still launches with a warning and any existing skills."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":7},"children":["Options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," accepts the standard ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," global options. The most useful are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--profile <name>"]},", which picks the account and region, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--verbose"]},", which prints the exact Pi command. Everything after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--"]}," is passed to Pi."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"availability","__idx":8},"children":["Availability"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," isn't available for every account. If it's blocked for yours, use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands/claude"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx claude"]}]}," instead. A blocked launch makes no changes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":9},"children":["Limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Sessions that use a model outside the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/"]}," list are not supported. Start a new session with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx/"]}," model."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each model request gets a fresh sign-in token, which can add a short delay."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]}," usage is not yet included in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands/usage"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx usage"]}]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting","__idx":10},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Pi CLI not found"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requires the Pi coding agent 1.1.0 or later"]},"."]}," ","Install or update Pi with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npm install -g @earendil-works/pi-coding-agent"]},", then rerun ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx pi"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication fails after Pi starts."]}," ","Run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx status"]}," to see whether the active profile is signed in. If it isn't, run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx auth setup"]}," and relaunch Pi."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Pi is using the wrong account or region."]}," ","Pi keeps the profile it was launched with. Quit Pi and relaunch it with the profile you want: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx --profile <name> pi"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"learn-more","__idx":11},"children":["Learn More"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://pi.dev/docs/latest"},"children":["Pi documentation"]},": the upstream CLI documentation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands/claude"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx claude"]}]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/treasure-code/commands/codex"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx codex"]}]},": the launchers for Claude Code and Codex"]}]}]},"headings":[{"value":"Pi Integration","id":"pi-integration","depth":1},{"value":"Why use it","id":"why-use-it","depth":2},{"value":"Quick start","id":"quick-start","depth":2},{"value":"Examples","id":"examples","depth":2},{"value":"Models","id":"models","depth":2},{"value":"Codemode","id":"codemode","depth":2},{"value":"TD skills","id":"td-skills","depth":2},{"value":"Options","id":"options","depth":2},{"value":"Availability","id":"availability","depth":2},{"value":"Limitations","id":"limitations","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":2},{"value":"Learn More","id":"learn-more","depth":2}],"frontmatter":{"seo":{"title":"Pi Integration"}},"lastModified":"2026-10-26T03:15:29.000Z","isTranslationFallback":true,"pagePropGetterError":{"message":"","name":""}},"slug":"/ja/treasure-code/commands/pi","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}