feat: tfcode

This commit is contained in:
Gab
2026-03-24 14:29:24 +11:00
parent 4380efd658
commit 7c015708cb
3 changed files with 279 additions and 295 deletions

View File

@@ -17,7 +17,7 @@
## Installation
```bash
npm install -g tfcode
npm install -g @toothfairyai/tfcode@beta
```
The installer will:
@@ -26,6 +26,21 @@ The installer will:
## Quick Start
### Option A: Interactive Setup (Recommended)
```bash
# 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
```bash
# 1. Set your ToothFairyAI credentials
export TF_WORKSPACE_ID="your-workspace-id"
@@ -38,21 +53,20 @@ tfcode validate
# 3. Sync tools from your workspace
tfcode sync
# 4. Start coding!
tfcode
# 4. List your tools
tfcode tools list
```
## Commands
| Command | Description |
|---------|-------------|
| `tfcode` | Start the AI coding assistant |
| `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 mcp` | List MCP servers |
| `tfcode tools credentials <name> --set` | Set API key for a tool |
| `tfcode tools list --type api_function` | Filter by type |
## Regions
@@ -65,7 +79,17 @@ tfcode
## Configuration
Credentials can be set via environment variables:
Credentials are stored in `~/.tfcode/config.json`:
```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):
```bash
export TF_WORKSPACE_ID="your-workspace-id"
@@ -73,18 +97,6 @@ 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)
@@ -104,12 +116,19 @@ Install Python:
- 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:
```bash
export TF_REGION="eu" # or us, au
tfcode setup
```
## Documentation