TF Code
TF Code is ToothFairyAI's AI coding agent — a command-line interface that brings AI-powered coding assistance to your terminal with deep ToothFairyAI workspace integration.
It ships with three built-in agents:
| Agent | Purpose | Key Ability |
|---|---|---|
| Build | Execute and implement | Full read/write access, the default agent |
| TF Engineer | Manage ToothFairyAI workspace | Exclusive access to live MCP tools for workspace operations |
| TF Orchestrate | Orchestrate cloud + local agents | Bridges ToothFairyAI cloud agents with local subagents via raw AI endpoints |
Switch between them at any time with Tab or the --agent flag.
Prerequisites
- Node.js 18+
- A modern terminal emulator (WezTerm, Alacritty, Kitty, Ghostty recommended)
- ToothFairyAI API credentials (from Admin → TFCode & API Integration)
Install
npm install -g @toothfairyai/tfcode
Verify:
tfcode --version
Configure
Run the interactive setup to create a profile:
tfcode setup
This prompts for profile name, workspace ID, API key, and region. Alternatively, set environment variables:
export TF_WORKSPACE_ID="your-workspace-id"
export TF_API_KEY="your-api-key"
export TF_REGION="au"
Validate:
tfcode validate
Usage
Interactive session
tfcode
Single command
tfcode run "Explain this codebase"
Ask questions
How is authentication handled in @src/api/index.ts
Plan first, then build
Use /plan to enter Plan mode, describe what you want, then /task to switch back and implement.
/plan— describe the feature, review the plan/task— switch back and ask it to implement
Workspace management
tfcode run --agent "TF Engineer" "Create a retriever agent called SupportBot"
tfcode run --agent "TF Engineer" "Search documents about refund policy"
Undo changes
/undo
Next Steps
- Config — Profiles, regions, config files, and precedence
- Providers — Multiple providers and model selection
- Agents — Build, TF Engineer, and TF Orchestrate in detail
- MCP Servers — ToothFairyAI MCP, skills, and functions
- Workspace Sync — Pull agents, skills, config, and policies from your workspace
- Policies — Workspace-enforced allow/deny rules
- Sharing Sessions — Share full sessions to the Knowledge Hub and retrieve them anywhere
- Computer Use — Let agents control the local OS GUI (mouse, keyboard, screen)
- Server Mode — Run TF Code as a headless HTTP server
- Plugins — Extend TF Code with custom plugins
- Loops — Structured execution-path workflows with multi-agent steps