mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-10 18:58:48 +00:00
feat: tfcode beta
This commit is contained in:
@@ -1,15 +1,127 @@
|
||||
# js
|
||||
# tfcode
|
||||
|
||||
To install dependencies:
|
||||
**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
|
||||
|
||||
```bash
|
||||
bun install
|
||||
npm install -g tfcode
|
||||
```
|
||||
|
||||
To run:
|
||||
The installer will:
|
||||
- Check Python is installed
|
||||
- Install the ToothFairyAI Python SDK automatically
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
# 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. Start coding!
|
||||
tfcode
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||
## Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `tfcode` | Start the AI coding assistant |
|
||||
| `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 mcp` | List MCP servers |
|
||||
| `tfcode tools credentials <name> --set` | Set API key for a tool |
|
||||
|
||||
## 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 can be set via environment variables:
|
||||
|
||||
```bash
|
||||
export TF_WORKSPACE_ID="your-workspace-id"
|
||||
export TF_API_KEY="your-api-key"
|
||||
export TF_REGION="au"
|
||||
```
|
||||
|
||||
Or in `~/.tfcode/tfcode.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"toothfairy": {
|
||||
"workspace_id": "your-workspace-id",
|
||||
"api_key": "your-api-key",
|
||||
"region": "au"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Your Credentials
|
||||
|
||||
1. Log in to [ToothFairyAI](https://app.toothfairyai.com)
|
||||
2. Go to **Settings** → **API Keys**
|
||||
3. Copy your **Workspace ID** and **API Key**
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Python 3.10+ is required but not found"
|
||||
|
||||
Install Python:
|
||||
- **macOS**: `brew install python@3.12`
|
||||
- **Windows**: Download from https://python.org/downloads
|
||||
- **Linux**: `sudo apt install python3.12`
|
||||
|
||||
### "Failed to validate: Invalid API key"
|
||||
|
||||
- Check your API key is correct
|
||||
- Generate a new key in ToothFairyAI Settings → API Keys
|
||||
|
||||
### "Failed to validate: Connection test failed"
|
||||
|
||||
Try a different region:
|
||||
```bash
|
||||
export TF_REGION="eu" # or us, au
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- **Full Guide**: https://toothfairyai.com/developers/tfcode
|
||||
- **API Docs**: https://apidocs.toothfairyai.com
|
||||
- **Issues**: https://github.com/ToothFairyAI/tfcode/issues
|
||||
|
||||
## Credits
|
||||
|
||||
tfcode is based on [opencode](https://github.com/anomalyco/opencode) by [anomalyco](https://github.com/anomalyco).
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user