Use Pi, a coding assistant that runs in your terminal, with Treasure AI as the backend.
Treasure AI customers can use Pi with their existing AI Suite credits. You don't need a separate model subscription for traffic that goes through Treasure AI.
tdx pi is an experimental integration. Its behavior, flags, and defaults may change as Pi evolves.
- Treasure AI Auto by default. New sessions use
tdx/auto, which picks a model for each request. - Codemode. Pi can write one script that calls many tools, instead of spending one model turn per call. The
tdxandtd-docstools are available to these scripts. - TD skills included. The tdx skills that ship with
tdxare available in Pi automatically. No download is needed. - Your Pi setup stays as it is.
tdx piadds its models and tools only for the session it starts. Your Pi settings, sign-ins, and session history are unchanged. - Automatic sign-in. Pi uses your
tdxlogin, and tokens refresh while you work.
You'll need a Treasure AI account with AI Suite access.
# 1. Install Pi 1.1.0 or later (once per machine)
npm install -g @earendil-works/pi-coding-agent
# 2. Sign in to tdx (once per profile)
tdx auth setup
# 3. Launch Pi against Treasure AI
tdx pitdx pi also needs Node.js on your PATH, which you already have if you installed tdx with npm.
# Launch Pi with Treasure AI Auto
tdx pi
# Start with an initial prompt
tdx pi -- "Explain this code"
# Continue the most recent session in this folder
tdx pi -- --continue
# Use a specific tdx profile; its region is used automatically
tdx --profile production pi
# Choose another model by its ID
tdx pi -- --model tdx/claude-sonnet-5-5Anything after -- is passed to Pi unchanged, so every Pi CLI option works.
New sessions use tdx/auto, which picks a model for each request. Sessions you continue or resume (-c, --continue, -r, --resume, --session, --session-id, or --fork) keep the model they started with.
To choose a specific model, pass its model ID with the tdx/ prefix, for example --model tdx/claude-sonnet-5-5. The list includes the chat models and the aliases such as tdx/efficient and tdx/auto-cost. Run tdx ai models to see the IDs your account can use. tdx pi loads this list when it starts. If the list can't be loaded, only tdx/auto is available.
tdx pi turns on Pi's codemode tool. The tools in the table below are then available to the scripts Pi writes:
| Tool | What scripts can do |
|---|---|
tdx | Run and look up tdx commands for the active profile |
td-docs | Search and read the Treasure AI documentation and API references |
For example, ask:
> List my databases and, for the three largest, show their table countsPi can answer this with one script that runs several tdx commands and returns only the summary.
If you already configured tdx or td-docs in Pi, your configuration is used instead. Pi's --no-mcp and --no-extensions options also turn these tools off.
Pi runs tools, including shell commands and tdx commands, without asking for confirmation. Review requests that change data before you send them, or add a Pi permission extension.
tdx pi makes the bundled tdx skills (tdx-basic, segment, journey, and the rest) available to Pi. They update when you upgrade tdx, without a download.
- If you already have a skill with the same name, your copy is kept and a warning is shown.
- If skill setup fails, Pi still launches with a warning and any existing skills.
tdx pi accepts the standard tdx global options. The most useful are --profile <name>, which picks the account and region, and --verbose, which prints the exact Pi command. Everything after -- is passed to Pi.
tdx pi isn't available for every account. If it's blocked for yours, use tdx claude instead. A blocked launch makes no changes.
- Sessions that use a model outside the
tdx/list are not supported. Start a new session with atdx/model. - Each model request gets a fresh sign-in token, which can add a short delay.
tdx piusage is not yet included intdx usage.
Pi CLI not found or requires the Pi coding agent 1.1.0 or later. Install or update Pi with npm install -g @earendil-works/pi-coding-agent, then rerun tdx pi.
Authentication fails after Pi starts. Run tdx status to see whether the active profile is signed in. If it isn't, run tdx auth setup and relaunch Pi.
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: tdx --profile <name> pi.
- Pi documentation: the upstream CLI documentation
tdx claudeandtdx codex: the launchers for Claude Code and Codex