Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

t3-json.md

80 lines5.5 KB

Project configuration (t3.json) and actions

Check a t3.json file into your repository root to share project actions (setup, dev, test, and cleanup scripts), worktree defaults, icons, and multi-repo settings with everyone opening the repo in T3 Code.

Inheritance order

Settings that t3.json can declare resolve in this order (first non-inherited value wins):

  1. Project override in Settings
  2. Environment setting in Settings
  3. t3.json in the repository
  4. Built-in default

Schema reference

Add "$schema": "https://t3.codes/schema/t3.json" for editor autocomplete and validation:

{
  "$schema": "https://t3.codes/schema/t3.json",
  "iconPath": "assets/logo.svg",
  "defaultThreadEnvMode": "worktree",
  "worktreeSubmodules": "top-level",
  "worktreeSparsePatternsPath": ".t3/sparse-checkout",
  "ignoreRepositories": ["vendor/big"],
  "scripts": [
    {
      "name": "Setup",
      "command": "pnpm install",
      "icon": "configure",
      "runOnWorktreeCreate": true,
      "async": false
    },
    {
      "name": "Dev",
      "command": "pnpm dev",
      "icon": "play",
      "previewUrl": "http://localhost:3000",
      "autoOpenPreview": true,
      "stopOnSettle": true
    },
    {
      "name": "Clean",
      "command": "cargo clean",
      "icon": "build",
      "runOnSettle": true
    }
  ]
}

Top-level fields

FieldValues / Description
iconPathWorkspace-relative path to a project icon (checked before auto-detected icons).
defaultThreadEnvMode"local" or "worktree" — default workspace mode for new threads.
worktreeSubmodules"recursive" (default), "top-level", or "none".
worktreeSparsePatternsPathRepo-relative path to a Git sparse-checkout pattern file (non-cone syntax; Git 2.35+).
ignoreRepositoriesRepo-relative paths to exclude in multi-repo projects.
worktreeLayoutCustom { "create": "...", "remove": "..." } commands for multi-repo or custom worktrees (requires approval; see Custom worktree layout).
scriptsUp to 50 project actions (see below).

Project actions (scripts)

Import t3.json scripts or define local actions in Settings → Projects → Actions (run them from the thread details panel, command palette, or keybindings via script.<id>.run).

FieldDescription
nameDisplay name in the actions menu.
commandShell command run in a T3 terminal at the project root.
icon"play" (default), "test", "lint", "configure", "build", or "debug".
runOnWorktreeCreateRuns automatically when a new worktree is created. Skipped for agent-initiated worktrees below Full access.
asyncFor runOnWorktreeCreate only: true (default) starts the agent immediately; false waits for the script to finish first.
stopOnSettleStops this action's terminal and child processes when its thread settles.
runOnSettleRuns in the thread's worktree whenever the thread settles (skipped in main checkouts). Terminal closes on success, stays open on failure.
previewUrlOpens this URL in the in-app browser when the script runs (desktop only).
autoOpenPreviewAutomatically opens the browser panel at previewUrl on script start.

Note: In multi-repo projects, only the project folder's t3.json is read—nested repo t3.json files are ignored.