Skip to main content
Version: v3 (beta)

Config

TF Code uses JSON config files merged in precedence order. Profile credentials and environment variables override file-based settings.

Interactive Setup​

The recommended way to get started:

tfcode setup

This prompts for profile name, workspace ID, API key, and region, then saves them as a named profile.

Profiles​

Profiles store multiple sets of ToothFairyAI credentials so you can switch between workspaces instantly.

Create​

tfcode setup
# Prompts for: profile name, workspace ID, API key, region

Non-interactive:

tfcode setup --profile dev --workspace-id dev-ws-456 --api-key dev-key-xxx --region dev --name dev

Switch​

tfcode profile prod
tfcode profile
# Current profile: prod
#
# Available profiles:
# * prod
# dev

Use in commands​

tfcode -p prod run "Deploy to production"
TF_PROFILE=prod tfcode run "Force prod workspace"

Storage​

Profiles are stored in ~/.local/share/tfcode/.tfcode/profiles.json:

{
"default": "prod",
"profiles": {
"prod": {
"api_key": "prod-key-xxx",
"workspace_id": "prod-ws-123",
"region": "au"
},
"dev": {
"api_key": "dev-key-yyy",
"workspace_id": "dev-ws-456",
"region": "dev"
}
}
}

Profiles replace the legacy credentials.json. TF Code automatically migrates it on first profile command.

Regions​

RegionBase URLStreaming URL
devai.toothfairylab.linkais.toothfairylab.link
auai.toothfairyai.comais.toothfairyai.com
euai.eu.toothfairyai.comais.eu.toothfairyai.com
usai.us.toothfairyai.comais.us.toothfairyai.com

Config File Locations​

Config sources are loaded in order of increasing priority (later overrides earlier):

  1. Global config — ~/.config/tfcode/tfcode.json
  2. Custom config — OPENCODE_CONFIG env var path
  3. Project config — tfcode.json in project root
  4. .tfcode/tfcode.json in project root
  5. Inline config — OPENCODE_CONFIG_CONTENT env var
  6. Active profile — set via tfcode profile <name> or --profile / TF_PROFILE
  7. Environment variables — TF_WORKSPACE_ID, TF_API_KEY, TF_REGION

Files are merged together, not replaced. Non-conflicting settings from all sources are preserved.

note

tfcode sync can replace the global config file with a workspace-managed tfcode.json published by your workspace admin — the previous file is kept as tfcode.json.bak. See Workspace Sync.

Project config example​

.tfcode/tfcode.json:

{
"toothfairy": {
"workspace_id": "your-workspace-id",
"api_key": "your-api-key",
"region": "au"
},
"model": "toothfairyai/mystica",
"default_agent": "build"
}

Feature config sections​

Top-level config keys that switch on agent features (see Agents for details):

KeyTypeDescription
reviewerobjectStronger model agents call for second opinions (see Reviewer)
model_swapobjectLets agents switch models mid-session (see Model swap)
escalateobjectLets agents temporarily upgrade to a stronger model, matched on problem domain (see Escalate)
loopsobjectStructured execution-path workflows (see Loops)
kanbanobjectKanban dispatcher — watches boards and runs ready tasks with agents (see Kanban)
handoffobjectCloud hand-off tuning — delegate subagent tasks to a cloud runner under pressure (see Cloud Hand-off)
tfdesignobjectTF Design add-on — CLI path, daemon URL, and mirror directory (see TF Design)
officeobjectOffice documents — LibreOffice previews and desktop editing (see Office documents)
policiesarrayAllow/deny rules for providers, tools, MCP, and skills (see Policies)
self_improve_skillsboolean | objectSteers agents to refine their own skills. Supports enabled_for, validate, history_dir, and reserved embeddings (see Self-improving skills)
perksobjectNamed capabilities (e.g. computer-use, voice, mailbox) whose default on/off state applies to every new session — seeds session toggles (see Perks)
settingsobjectWeb app preferences — general, appearance, keybinds, permissions, notifications, sounds, voice, theme (see Web app settings)

Perks​

Perks are the single gate for every capability — built-in plugins (email, scheduler, vibeguard, goal, loops, notifications, gateway) and on-demand session capabilities alike. Set a perk's default state once and it applies to every new session:

{
"perks": {
"computer-use": true,
"voice": true,
"scheduler": true,
"plugins": true
}
}

Each perk key is a boolean:

KeyDescription
"computer-use"Default state of the computer-use perk (OS GUI control) for new sessions — users can still toggle it per session via the UI icon
"voice"Default state of the voice perk (mic input, spoken callouts, TTS) for new sessions
"delegate_on_cloud"Enables cloud hand-off — delegate subagent tasks to a cloud runner when local resources are under pressure (see Cloud Hand-off)
"escalate"Enables the escalate perk — agents may temporarily upgrade to a stronger model, matched on the problem's domain via benchmark data (see Escalate)
"mailbox"Enables the mailbox perk — auto-connects the built-in mailbox MCP server for email/calendar access (see Mailbox)
"scheduler"Enables the scheduler — recurring jobs and routines on a schedule (see Scheduling)
"email"Enables the send_email tool — premium branded HTML email through the ToothFairyAI SES pipeline
"vibeguard"Enables Vibeguard — secrets/PII redacted into placeholders before LLM calls
"goal"Enables the /goal command — session objective tracking with auto-continue
"loops"Enables structured step-by-step loop workflows (see Loops)
"notifications"Enables desktop alerts and sounds when a session finishes or permission is requested
"gateway"Enables the webhook receiver gateway (see Gateway)
"browser"Unattended browsing without per-action permission asks (the browser tool)
"session_search"Enables the sessions tool — read other sessions of this project
"plugins"Enables agent plugins — self-authored, declarative plugin manifests in .tfcode/plugin/ (see Plugins)

Absent perks default to off.

note

The old builtin config ("builtin": { "scheduler": { "enabled": true } }) still works as a read-only fallback — perks.<name> always wins when set. All new writes (via the plugin_recommend tool, the /plugins toggle, or the HTTP API) go to perks.*.

You normally don't edit this by hand: ask the agent about capabilities ("what plugins should I turn on?") and it uses the plugin_recommend tool to list, recommend, and toggle them — with your confirmation before anything changes.

Mailbox​

The mailbox perk auto-connects the built-in mailbox MCP server (tf-mailbox) — a zero-install, stdio server that gives agents read access to the user's email and calendar. No API keys or extra setup: it reads from the local mail store and exposes tools like list_folders, list_emails, read_email, and calendar queries. Enable it once and every new session has the tools available:

{
"perks": {
"mailbox": true
}
}

Web app settings​

The settings section stores web app preferences. It is applied on the next UI load and validated against the real catalogs (themes, sounds, fonts, keybinds) — invalid values are dropped with a warning. Agents can read and update it at runtime via the tfcode_config tool.

{
"settings": {
"general": { "autoSave": true, "followup": "queue" },
"appearance": { "font": "intel-one-mono", "fontSize": 14 },
"theme": { "colorScheme": "system" },
"permissions": { "autoApprove": false },
"notifications": { "agent": true, "permissions": true, "errors": true },
"sounds": { "agentEnabled": true },
"voice": { "ttsModel": "cartesia" }
}
}
KeyDescription
generalAuto-save, release notes, follow-up handling (queue/steer), reasoning/thinking display, tool part expansion, computer-use and voice toggle defaults
updatesCheck for app updates on startup
appearanceChat font size and monospace font id
keybindsKeybind overrides for the web app, keyed by action name
permissionsAuto-approve permission requests in the web app
notificationsNotify when the agent finishes, a permission is requested, or on errors
soundsSound on/off and sound id for agent finish, permission request, and errors
voiceTTS model, voice, language, and auto-send for voice transcriptions
themeTheme id and color scheme (light/dark/system) applied at startup
note

Agent-level perks are a different concept: setting perk: "tf_engineer" or perk: "tf_orchestrate" on an agent definition makes it inherit the full behaviour of the native ToothFairyAI agent (prompt, permissions, MCP and TF tool access). See Agent perks.

Environment Variables​

VariableDescription
TF_WORKSPACE_IDToothFairyAI workspace ID
TF_API_KEYToothFairyAI API key
TF_REGIONToothFairyAI region: dev, au, eu, us
TF_PROFILEProfile name to use (overrides default profile)
TFCODE_SERVER_PASSWORDHTTP basic auth password for server mode
TFCODE_SERVER_USERNAMEHTTP basic auth username (default: tfcode)
OPENCODE_CONFIGPath to custom config file
OPENCODE_CONFIG_CONTENTInline config content (highest priority)

Validate​

tfcode validate
tfcode validate --profile prod

Server Config​

The server block controls the HTTP server:

{
"server": {
"port": 4096,
"hostname": "127.0.0.1",
"mdns": false,
"mdnsDomain": "tfcode.local",
"cors": ["https://app.example.com"]
}
}

Logging​

tail -f ~/.local/share/tfcode/log/dev.log
tfcode --log-level DEBUG

Levels: DEBUG, INFO, WARN, ERROR.

CLI Commands Reference​

Top-level​

CommandDescription
tfcodeStart interactive session
tfcode run <prompt>Execute a single task and exit
tfcode serveStart headless HTTP server
tfcode webStart server and open web interface
tfcode attach <url>Attach TUI to a running server

Setup & credentials​

CommandDescription
tfcode setupInteractive credential setup (creates a profile)
tfcode validateValidate credentials (--profile <name> for specific)
tfcode profileShow current profile and list all
tfcode profile <name>Switch to a different profile
tfcode syncSync workspace tools metadata
tfcode policyList local and workspace policy statements
tfcode providers listList available providers
tfcode models [provider]List available models (optional provider filter)
tfcode models --verboseList models with metadata
tfcode models --refreshRefresh the models cache

MCP​

CommandDescription
tfcode mcp listList MCP servers and tools
tfcode mcp addAdd a local MCP server
tfcode mcp authAuthenticate with OAuth MCP server
tfcode mcp logoutLogout from MCP server

Other​

CommandDescription
tfcode -p/--profileSwitch profile per command
tfcode --log-levelSet log level
tfcode --versionShow version
tfcode --helpShow all commands
tfcode gatewayManage webhook subscriptions

Chat commands (interactive)​

CommandDescription
/compact [instructions]Compact context with preservation hints
/helpShow available commands