Skip to content
Last updated

Pi Integration

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.

Experimental

tdx pi is an experimental integration. Its behavior, flags, and defaults may change as Pi evolves.

Why use it

  • 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 tdx and td-docs tools are available to these scripts.
  • TD skills included. The tdx skills that ship with tdx are available in Pi automatically. No download is needed.
  • Your Pi setup stays as it is. tdx pi adds 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 tdx login, and tokens refresh while you work.

Quick start

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 pi

tdx pi also needs Node.js on your PATH, which you already have if you installed tdx with npm.

Examples

# 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-5

Anything after -- is passed to Pi unchanged, so every Pi CLI option works.

Models

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.

Codemode

tdx pi turns on Pi's codemode tool. The tools in the table below are then available to the scripts Pi writes:

ToolWhat scripts can do
tdxRun and look up tdx commands for the active profile
td-docsSearch and read the Treasure AI documentation and API references

For example, ask:

> List my databases and, for the three largest, show their table counts

Pi 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.

No approval prompts

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.

TD skills

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.

Options

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.

Availability

tdx pi isn't available for every account. If it's blocked for yours, use tdx claude instead. A blocked launch makes no changes.

Limitations

  • Sessions that use a model outside the tdx/ list are not supported. Start a new session with a tdx/ model.
  • Each model request gets a fresh sign-in token, which can add a short delay.
  • tdx pi usage is not yet included in tdx usage.

Troubleshooting

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.

Learn More