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

t3-json.md

80 lines5.5 KB

1# Project configuration (`t3.json`) and actions
2​
3Check 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.
4​
5## Inheritance order
6​
7Settings that `t3.json` can declare resolve in this order (first non-inherited value wins):
8​
91. **Project override** in Settings
102. **Environment setting** in Settings
113. **`t3.json`** in the repository
124. **Built-in default**
13​
14## Schema reference
15​
16Add `"$schema": "https://t3.codes/schema/t3.json"` for editor autocomplete and validation:
17​
18```json
20 "$schema": "https://t3.codes/schema/t3.json",
21 "iconPath": "assets/logo.svg",
22 "defaultThreadEnvMode": "worktree",
23 "worktreeSubmodules": "top-level",
24 "worktreeSparsePatternsPath": ".t3/sparse-checkout",
25 "ignoreRepositories": ["vendor/big"],
26 "scripts": [
27 {
28 "name": "Setup",
29 "command": "pnpm install",
30 "icon": "configure",
31 "runOnWorktreeCreate": true,
32 "async": false
33 },
34 {
35 "name": "Dev",
36 "command": "pnpm dev",
37 "icon": "play",
38 "previewUrl": "http://localhost:3000",
39 "autoOpenPreview": true,
40 "stopOnSettle": true
41 },
42 {
43 "name": "Clean",
44 "command": "cargo clean",
45 "icon": "build",
46 "runOnSettle": true
47 }
48 ]
50```
51​
52### Top-level fields
53​
54| Field | Values / Description |
55| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
56| `iconPath` | Workspace-relative path to a project icon (checked before auto-detected icons). |
57| `defaultThreadEnvMode` | `"local"` or `"worktree"` — default workspace mode for new threads. |
58| `worktreeSubmodules` | `"recursive"` (default), `"top-level"`, or `"none"`. |
59| `worktreeSparsePatternsPath` | Repo-relative path to a Git sparse-checkout pattern file (non-cone syntax; Git 2.35+). |
60| `ignoreRepositories` | Repo-relative paths to exclude in [multi-repo projects](./multi-repo-projects.md). |
61| `worktreeLayout` | Custom `{ "create": "...", "remove": "..." }` commands for multi-repo or custom worktrees (requires approval; see [Custom worktree layout](./multi-repo-projects.md#custom-worktree-layout)). |
62| `scripts` | Up to 50 project actions (see below). |
63​
64## Project actions (`scripts`)
65​
66Import `t3.json` scripts or define local actions in **Settings → Projects → Actions** (run them from the thread details panel, command palette, or [keybindings](./keybindings.md) via `script.<id>.run`).
67​
68| Field | Description |
69| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
70| `name` | Display name in the actions menu. |
71| `command` | Shell command run in a T3 terminal at the project root. |
72| `icon` | `"play"` (default), `"test"`, `"lint"`, `"configure"`, `"build"`, or `"debug"`. |
73| `runOnWorktreeCreate` | Runs automatically when a new worktree is created. Skipped for agent-initiated worktrees below **Full access**. |
74| `async` | For `runOnWorktreeCreate` only: `true` (default) starts the agent immediately; `false` waits for the script to finish first. |
75| `stopOnSettle` | Stops this action's terminal and child processes when its thread settles. |
76| `runOnSettle` | Runs in the thread's worktree whenever the thread settles (skipped in main checkouts). Terminal closes on success, stays open on failure. |
77| `previewUrl` | Opens this URL in the in-app browser when the script runs (desktop only). |
78| `autoOpenPreview` | Automatically opens the browser panel at `previewUrl` on script start. |
79​
80> Note: In multi-repo projects, only the project folder's `t3.json` is read—nested repo `t3.json` files are ignored.