mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
2.4 KiB
2.4 KiB
Step-by-Step Guide: Testing tfcode Sync
Prerequisites
- Python 3.10+ with
toothfairyaiSDK installed - Node.js/Bun for running tfcode
Step 1: Set Environment Variables
# In your terminal
export TF_WORKSPACE_ID="6586b7e6-683e-4ee6-a6cf-24c19729b5ff"
export TF_API_KEY="EWZooLROIS57EVW3BKGu7Pv6LNe4D6m4gkDjukx3"
export TF_REGION="au"
Or use the setup script:
source scripts/setup-tf-dev.sh
Step 2: Install Python Dependencies
cd packages/tf-sync
pip install -e .
# Or manually install the required packages:
pip install toothfairyai pydantic httpx rich
Step 3: Build tfcode CLI
cd packages/tfcode
bun install
bun run build
Step 4: Test Credential Validation
# From repo root with environment set
cd packages/tfcode
bun run src/index.ts validate
Expected output:
Validating ToothFairyAI credentials...
✓ Credentials valid
Workspace: <workspace_name>
ID: 6586b7e6-683e-4ee6-a6cf-24c19729b5ff
Step 5: Sync Tools from Workspace
bun run src/index.ts sync
Expected output:
Syncing tools from ToothFairyAI workspace...
✓ Synced X tools
By type:
mcp_server: X
agent_skill: X
database_script: X
api_function: X
Step 6: List Synced Tools
# List all tools
bun run src/index.ts tools list
# Filter by type
bun run src/index.ts tools list --type mcp
bun run src/index.ts tools list --type skill
bun run src/index.ts tools list --type database
bun run src/index.ts tools list --type function
Step 7: Debug a Tool
bun run src/index.ts tools debug <tool-name>
Step 8: Set API Function Credentials (if needed)
For tools with auth_via: user_provided:
bun run src/index.ts tools credentials <tool-name> --set
# Enter API key when prompted
bun run src/index.ts tools credentials <tool-name> --show
# Shows masked key
Troubleshooting
Python SDK not found
Error: Failed to validate: Python sync failed: ModuleNotFoundError: No module named 'toothfairyai'
Solution: pip install toothfairyai
Environment not set
Error: TF_WORKSPACE_ID not set
Solution: Export environment variables or source the setup script
Invalid credentials
✗ Validation failed: Invalid API key
Solution: Check your TF_API_KEY is correct
Workspace not found
✗ Validation failed: Workspace not found
Solution: Check your TF_WORKSPACE_ID is correct