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. Both the
tdxandtd-docstool servers are available to these scripts. - TD skills included. The tdx skills that ship with
tdxare linked into~/.agents/skills, using the same installer astdx codex. No download is needed. - Your Pi configuration stays as it is.
tdx piadds providers and tool servers only for the session it launches. It doesn't rewrite your Pi settings or sign-ins; Pi continues to manage its usual session history. - Automatic sign-in. Pi uses your
tdxlogin, 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 pitdx 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
tdx pi -- --model anthropic/claude-sonnet-5-5Anything after -- is passed to Pi unchanged, so every Pi CLI option works.
Default model
New sessions use tdx/auto unless you pass --model or --provider. Sessions you continue or resume (-c, --continue, -r, --resume, --session, --session-id, or --fork) keep the model they started with.
The built-in anthropic/* and openai/* models also go through Treasure AI for the session. Run tdx ai models to see the models your account can use.
Codemode
Pi turns on its codemode tool when a tool server uses codemode exposure. tdx pi adds two servers this way:
| Server | What scripts can call |
|---|---|
tdx | tdx_run and tdx_search, which 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 calls tdx_run several times and returns only the summary.
If you already defined a server named tdx or td-docs in your Pi mcp.json, your definition is used instead. Pi's --no-mcp and --no-extensions options also turn these servers 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 links the bundled tdx skills (tdx-basic, segment, journey, and the rest) into ~/.agents/skills, which Pi discovers automatically. It reuses tdx codex's installer, ownership record, and lock, so both launchers share one managed skill set without loading a second copy through --skill.
- Managed links update to the installed bundle when you upgrade
tdx, without a download. Previously recorded targets can be repaired even when the install path moves. - Your own files or unrecognized links with the same names are kept, with a warning. Other personal and project skills continue to load according to your Pi settings and project trust.
- If skill setup fails, Pi still launches with a warning and any existing skills.
- These links are visible to other agents that read
~/.agents/skillstoo. Your Pi settings are not changed.
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. tdx pi checks your account before it sets up skills or starts Pi, so a blocked launch changes nothing.
Limitations
- If you signed in to
anthropicoropenaiinside Pi with/login, that sign-in is used when you pick one of those providers' models, instead of Treasure AI. The defaulttdx/automodel always uses Treasure AI. - Each model request runs
tdx auth tokento get a fresh token, which adds a short delay. tdx piusage is not yet included intdx 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
- Pi documentation: the upstream CLI documentation
tdx claudeandtdx codex: the launchers for Claude Code and Codex