2026-03-25 21:14:19 +11:00
..
2026-03-24 14:29:24 +11:00
2026-03-24 23:27:38 +11:00
2026-03-24 14:01:32 +11:00
2026-03-25 21:14:19 +11:00
git
2026-03-24 13:20:14 +11:00
2026-03-24 14:01:32 +11:00
2026-03-24 23:27:38 +11:00
2026-03-24 14:29:24 +11:00
2026-03-24 17:42:26 +11:00

tfcode

ToothFairyAI's official AI coding agent - A terminal-based coding assistant with seamless integration to your ToothFairyAI workspace.

Features

  • 🤖 AI-Powered Coding - Intelligent code generation, refactoring, and debugging
  • 🔌 Tool Integration - Sync and use tools from your ToothFairyAI workspace
  • 💻 Terminal-Based - Fast, lightweight, runs in your terminal
  • 🔐 Secure - Credentials stay in ToothFairyAI, route via TF Proxy

Requirements

  • Python 3.10+ - Required for ToothFairyAI integration
  • Node.js 18+ - Required to run tfcode

Installation

npm install -g @toothfairyai/tfcode@beta

The installer will:

  • Check Python is installed
  • Install the ToothFairyAI Python SDK automatically

Quick Start

# Run interactive setup
tfcode setup

This will guide you through entering your credentials step by step:

  1. Enter your Workspace ID
  2. Enter your API Key (hidden as you type)
  3. Select your region
  4. Validate and sync automatically

Option B: Manual Setup

# 1. Set your ToothFairyAI credentials
export TF_WORKSPACE_ID="your-workspace-id"
export TF_API_KEY="your-api-key"
export TF_REGION="au"

# 2. Validate your credentials
tfcode validate

# 3. Sync tools from your workspace
tfcode sync

# 4. List your tools
tfcode tools list

Commands

Command Description
tfcode setup Interactive credential setup
tfcode quickstart Show quick start guide
tfcode validate Test your credentials
tfcode sync Sync tools from workspace
tfcode tools list List synced tools
tfcode tools list --type api_function Filter by type

Regions

Region URL Use Case
dev api.toothfairylab.link Development/Testing
au api.toothfairyai.com Australia (Default)
eu api.eu.toothfairyai.com Europe
us api.us.toothfairyai.com United States

Configuration

Credentials are stored in ~/.tfcode/config.json:

{
  "workspace_id": "your-workspace-id",
  "api_key": "your-api-key",
  "region": "au"
}

You can also set credentials via environment variables (takes priority over config file):

export TF_WORKSPACE_ID="your-workspace-id"
export TF_API_KEY="your-api-key"
export TF_REGION="au"

Getting Your Credentials

  1. Log in to ToothFairyAI
  2. Go to SettingsAPI Keys
  3. Copy your Workspace ID and API Key

Troubleshooting

"Python 3.10+ is required but not found"

Install Python:

"Failed to validate: Invalid API key"

  • Check your API key is correct
  • Generate a new key in ToothFairyAI Settings → API Keys
  • Run tfcode setup to re-enter credentials

"Failed to validate: Connection test failed"

Try a different region:

  • Run tfcode setup and select a different region
  • Or set TF_REGION="eu" or TF_REGION="us"

"No credentials found"

Run interactive setup:

tfcode setup

Documentation

Credits

tfcode is based on opencode by anomalyco.

License

MIT