### Build and Start Production Source: https://github.com/pingdotgg/t3code/blob/main/docs/getting-started/quick-start.md Commands to build the project for production and then start the production server. ```bash # Production bun run build bun run start ``` -------------------------------- ### Headless CLI Link: Start Environment Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The environment server starts on next start and communicates with the Relay Worker to create a challenge and submit a locally signed proof. ```bash U->>S: Start T3 environment server ``` ```bash S->>R: Create challenge and submit local signed proof ``` -------------------------------- ### Install Project Dependencies with Vite+ Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install all necessary project dependencies using the Vite+ command-line tool. ```bash vp i ``` -------------------------------- ### Install GitHub CLI Source: https://github.com/pingdotgg/t3code/blob/main/docs/integrations/source-control-providers.md Install the GitHub CLI using Homebrew. This is a prerequisite for GitHub integration. ```bash brew install gh ``` -------------------------------- ### CLI Link: Install Relay Client Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html Handles the installation of the relay client when it's missing during a CLI link operation. It prompts the user for confirmation before proceeding with the installation and provides terminal updates. ```bash CLI->>CLI: Install with terminal progress updates ``` -------------------------------- ### Start Development Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Starts contracts, server, and web in `turbo watch` mode. This command defaults `T3CODE_STATE_DIR` to `~/.t3/dev` for isolated state. ```bash bun run dev ``` -------------------------------- ### Build Windows Installer Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Builds a Windows NSIS installer file located in the `./release` directory. ```bash bun run dist:desktop:win ``` -------------------------------- ### Start Metro Dev Client Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Starts the Metro bundler for the Expo dev client. Ensure you are in the 'apps/mobile' directory. ```bash vp run dev:client ``` -------------------------------- ### Install Vite+ on Windows Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install the global Vite+ command-line tool on Windows systems using PowerShell. ```powershell irm https://vite.plus/ps1 | iex ``` -------------------------------- ### Install GitLab CLI Source: https://github.com/pingdotgg/t3code/blob/main/docs/integrations/source-control-providers.md Install the GitLab CLI using Homebrew. This is required for GitLab integration. ```bash brew install glab ``` -------------------------------- ### Run Desktop Development Source: https://github.com/pingdotgg/t3code/blob/main/docs/getting-started/quick-start.md Start the desktop development environment. ```bash # Desktop development bun run dev:desktop ``` -------------------------------- ### Start WebSocket Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Starts only the WebSocket server using Bun's TypeScript execution. This command defaults `T3CODE_STATE_DIR` to `~/.t3/dev`. ```bash bun run dev:server ``` -------------------------------- ### Install Azure CLI Source: https://github.com/pingdotgg/t3code/blob/main/docs/integrations/source-control-providers.md Install the Azure CLI using Homebrew. This is necessary for Azure DevOps integration. ```bash brew install azure-cli ``` -------------------------------- ### Run Development Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/getting-started/quick-start.md Use this command to start the development server with hot reloading enabled. ```bash # Development (with hot reload) bun run dev ``` -------------------------------- ### Start Vite Dev Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Starts only the Vite development server for the web application. This command defaults `T3CODE_STATE_DIR` to `~/.t3/dev`. ```bash bun run dev:web ``` -------------------------------- ### Install T3 Code on Windows via Winget Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install the T3 Code desktop application on Windows using the winget package manager. ```bash winget install T3Tools.T3Code ``` -------------------------------- ### Install Vite+ on macOS/Linux Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install the global Vite+ command-line tool on macOS or Linux systems using curl. ```bash curl -fsSL https://vite.plus | bash ``` -------------------------------- ### Launching Signed Desktop App for Development Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-connect-clerk.md Launch the installed signed macOS application with specific environment variables to connect to the renderer development server. This is necessary for renderer HMR after building and installing a signed app. ```sh VITE_DEV_SERVER_URL=http://127.0.0.1:5733 \ T3CODE_PORT=13773 \ "/Applications/T3 Code (Alpha).app/Contents/MacOS/T3 Code (Alpha)" ``` -------------------------------- ### Launch Packaged Desktop App with OTLP Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/observability.md Start the packaged T3 Code desktop application from a shell where OTLP environment variables are exported. This ensures the embedded backend inherits the observability configuration. Do not rely on launching via Finder or Spotlight. ```bash T3CODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \ T3CODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \ T3CODE_OTLP_SERVICE_NAME=t3-desktop \ "/Applications/T3 Code.app/Contents/MacOS/T3 Code" ``` -------------------------------- ### Start Local Relay Client with Tunnel Token Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html Starts the local relay client using a provided TUNNEL_TOKEN. This token is passed via environment variable, not as a command-line argument. ```bash E->>RC: Start relay client with TUNNEL_TOKEN ``` -------------------------------- ### Direct WebSocket Access Examples Source: https://github.com/pingdotgg/t3code/blob/main/docs/architecture/remote.md These are examples of direct WebSocket URIs for client-server communication. Ensure the URI scheme (ws:// or wss://) matches the backend's capabilities and browser security policies. ```text ws://10.0.0.15:3773 ``` ```text wss://t3.example.com ``` -------------------------------- ### Start Local Grafana LGTM Stack Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/observability.md Launch a local Grafana LGTM stack using Docker for full observability. This includes Grafana, Tempo, and Loki. Access the Grafana UI at http://localhost:3000. ```bash docker run --name lgtm \ -p 3000:3000 \ -p 4317:4317 \ -p 4318:4318 \ --rm -ti \ grafana/otel-lgtm ``` -------------------------------- ### Activate Claude Router and Login Source: https://github.com/pingdotgg/t3code/blob/main/docs/providers/claude.md Steps to create a dedicated home directory, start the router, activate it, and log in to authenticate with Claude. This ensures a separate environment for the router. ```bash mkdir -p ~/.claude_router_home ccr start ccr activate HOME=~/.claude_router_home claude auth login ``` -------------------------------- ### Build Signed Windows Installer Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Builds a signed Windows NSIS installer using Azure Trusted Signing. Requires specific Azure environment variables for authentication and signing configuration. ```bash bun run dist:desktop:win --signed ``` -------------------------------- ### Install T3 Code on Arch Linux via AUR Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install the T3 Code desktop application on Arch Linux using an AUR helper like yay. ```bash yay -S t3code-bin ``` -------------------------------- ### Serve T3 Backend on All Interfaces Source: https://github.com/pingdotgg/t3code/blob/main/docs/user/remote-access.md Use this command to run the T3 server on all network interfaces, making it accessible from other devices on your network. Ensure you have `tailscale` installed and configured. ```bash npx t3 serve --host "$(tailscale ip -4)" ``` -------------------------------- ### Install T3 Code on macOS via Homebrew Source: https://github.com/pingdotgg/t3code/blob/main/README.md Install the T3 Code desktop application on macOS using the Homebrew package manager. ```bash brew install --cask t3-code ``` -------------------------------- ### Run Relay Local Checks Source: https://github.com/pingdotgg/t3code/blob/main/infra/relay/README.md Install dependencies and run relay-specific tests and type checks from the infra/relay directory. ```sh vp install cd infra/relay vp test run vp run typecheck ``` -------------------------------- ### Run T3 Code without Installation Source: https://github.com/pingdotgg/t3code/blob/main/README.md Execute T3 Code directly using npx without a local installation. Use the --help flag for a full command-line reference. ```bash npx t3@latest ``` -------------------------------- ### Desktop UI Link: Check Relay Client Availability Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The desktop web UI checks if a relay client is available on the local environment. If not, it prompts the user to download and install it. ```bash C->>E: Check relay client availability ``` ```bash C->>U: Prompt before download and install ``` ```bash C->>E: Stream relay-client install RPC ``` -------------------------------- ### Log in to Claude Account Source: https://github.com/pingdotgg/t3code/blob/main/docs/providers/claude.md Use this command to log in to your default Claude account. This is the standard authentication method when using a single Claude setup. ```bash claude auth login ``` -------------------------------- ### Build GhosttyKit for iOS Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/modules/t3-terminal/README.md This script builds the GhosttyKit framework for iOS, including compatibility patches and specific architecture slices. Ensure Zig 0.15.2 is installed and the Ghostty source directory is correctly set. ```bash apps/mobile/modules/t3-terminal/scripts/build-libghostty-ios16.sh ``` -------------------------------- ### Browser Startup and Client Connect Sequence Source: https://github.com/pingdotgg/t3code/blob/main/docs/architecture/overview.md Illustrates the sequence of events when a browser connects to the WebSocket server, including app loading, service startup, and initial state hydration. ```mermaid sequenceDiagram participant Browser participant Transport as WsTransport participant Server as wsServer participant Layers as serverLayers participant Ready as ServerReadiness participant Push as ServerPushBus Browser->>Transport: Load app and open WebSocket Transport->>Server: Connect Server->>Layers: Start runtime services Server->>Ready: Wait for startup barriers Ready-->>Server: Ready Server->>Push: Publish server.welcome Push-->>Transport: Ordered welcome push Transport-->>Browser: Hydrate initial state ``` -------------------------------- ### Run Production Server Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Runs the production server, serving the built web application as static files. ```bash bun run start ``` -------------------------------- ### Build Project Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Builds contracts, web app, and server through Turbo. This command is used for creating production-ready assets. ```bash bun run build ``` -------------------------------- ### Run Desktop Development Instance Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Runs the desktop development instance. Setting `T3CODE_DEV_INSTANCE` shifts all dev ports together deterministically. If `T3CODE_PORT_OFFSET` is set, it overrides the hashing mechanism for port shifting. ```bash T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop ``` -------------------------------- ### Initialize Theme Management Source: https://github.com/pingdotgg/t3code/blob/main/apps/web/index.html Initializes theme management by reading user preferences from local storage and applying the appropriate theme class to the document element. Handles potential errors during storage access. ```javascript (() => { const LIGHT_BACKGROUND = "#ffffff"; const DARK_BACKGROUND = "#161616"; const themeColorMeta = document.querySelector('meta[name="theme-color"]'); try { const storedTheme = window.localStorage.getItem("t3code:theme"); const theme = storedTheme === "light" || storedTheme === "dark" || storedTheme === "system" ? storedTheme : "system"; const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; const isDark = theme === "dark" || (theme === "system" && prefersDark); document.documentElement.classList.toggle("dark", isDark); const chromeColor = isDark ? DARK_BACKGROUND : LIGHT_BACKGROUND; document.documentElement.style.backgroundColor = chromeColor; themeColorMeta?.setAttribute("content", chromeColor); } catch { document.documentElement.classList.add("dark"); document.documentElement.style.backgroundColor = DARK_BACKGROUND; themeColorMeta?.setAttribute("content", DARK_BACKGROUND); } })(); ``` -------------------------------- ### Deploy with Local Environment File Source: https://github.com/pingdotgg/t3code/blob/main/infra/relay/README.md Deploy a stage using a local environment file for configuration. This is useful for personal deployments. ```sh vp run --filter t3code-relay deploy -- --env-file .env.local ``` -------------------------------- ### Desktop UI Link: Submit Local Link Proof Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The local environment submits a signed link proof to the desktop web UI. This endpoint requires `relay:write` permissions, rejects forwarded authority headers, and validates the loopback origin. ```bash C->>E: POST /api/connect/link-proof (local relay:write bearer) ``` ```bash E->>E: Authenticate, reject forwarded authority, get or create key pair, validate loopback origin ``` -------------------------------- ### Add Azure DevOps Extension Source: https://github.com/pingdotgg/t3code/blob/main/docs/integrations/source-control-providers.md Add the Azure DevOps extension to your Azure CLI installation. This enables Azure DevOps specific commands. ```bash az extension add --name azure-devops ``` -------------------------------- ### Launch Direct Binary with OTLP Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/observability.md Execute the T3 Code desktop application's binary directly from a shell with OTLP environment variables configured. This method ensures the application inherits the necessary observability settings. ```bash T3CODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \ T3CODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \ T3CODE_OTLP_SERVICE_NAME=t3-desktop \ ./path/to/your/desktop-app-binary ``` -------------------------------- ### Log Span Events Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/observability.md Use Effect.logInfo and Effect.logDebug within a span to create span events. This requires Logger.tracerLogger to be installed to associate logs with spans. ```typescript yield * Effect.logInfo("starting provider turn"); yield * Effect.logDebug("waiting for approval response"); ``` -------------------------------- ### Override Dev Command Flags Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Overrides server CLI-equivalent flags from root dev commands using `--`. For example, to set a custom base directory. ```bash bun run dev -- --base-dir ~/.t3-2 ``` -------------------------------- ### Build Desktop DMG Source: https://github.com/pingdotgg/t3code/blob/main/docs/getting-started/quick-start.md Create a shareable macOS .dmg file for desktop distribution. This command defaults to building for arm64 architecture. ```bash # Build a shareable macOS .dmg (arm64 by default) bun run dist:desktop:dmg ``` -------------------------------- ### Remote Connect: Get Clerk Session JWT Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html A web or mobile client obtains a Clerk session-template JWT from Clerk to initiate the remote connect process. ```bash C->>Clerk: Get Clerk session-template JWT ``` -------------------------------- ### Build Linux AppImage Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Builds a Linux AppImage file located in the `./release` directory. ```bash bun run dist:desktop:linux ``` -------------------------------- ### Remote Connect: Initiate Environment Connection Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The client initiates the connection to the managed environment by sending a POST request to the Relay Worker, using the previously obtained Relay DPoP token. ```bash C->>R: POST /v1/environments/:id/connect (relay DPoP) ``` -------------------------------- ### Verifying macOS Application Code Signing Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-connect-clerk.md Use these commands to verify the code signature and inspect entitlements of the installed macOS application. This is a crucial step after building and signing the application. ```sh codesign --verify --deep --strict "/Applications/T3 Code (Alpha).app" codesign -d --entitlements :- "/Applications/T3 Code (Alpha).app" ``` -------------------------------- ### Deploy Relay via Alchemy Source: https://github.com/pingdotgg/t3code/blob/main/infra/relay/README.md Initiate the deployment of the relay through Alchemy. Ensure the .env file is configured with deployment-specific values. ```sh vp run --filter t3code-relay deploy ``` -------------------------------- ### Headless CLI Link: Resolve Relay Client Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The t3 connect CLI resolves the relay client. If the relay client is missing, it prompts the operator for confirmation to install the managed relay-client. ```bash CLI->>CLI: Resolve relay client ``` ```bash CLI->>U: Confirm managed relay-client install ``` -------------------------------- ### Build and Run Local iOS Preview App Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Builds and runs the local iOS preview application. This is a persistent internal preview build. ```bash vp run ios:preview ``` -------------------------------- ### Build Desktop Artifact Source: https://github.com/pingdotgg/t3code/blob/main/docs/reference/scripts.md Builds a desktop artifact for a specific platform, target, and architecture. Requires specifying `--platform`, `--target`, and `--arch` flags. ```bash bun run dist:desktop:artifact -- --platform --target --arch ``` -------------------------------- ### Create Cloud Dev-Client Build (iOS) Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Creates a cloud-based dev-client build for iOS using EAS. This is for general development builds. ```bash vp run eas:ios:dev ``` -------------------------------- ### Build and Run Local iOS Dev Client Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Builds and runs the local iOS development client. Requires Expo Dev Client. ```bash vp run ios:dev ``` -------------------------------- ### Create EAS Builds (Android) Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Commands for creating EAS builds for Android. Includes development, preview, and persistent preview builds. ```bash vp run eas:android:dev ``` ```bash vp run eas:android:preview:dev ``` ```bash vp run eas:android:preview ``` -------------------------------- ### Configure Bitbucket Environment Variables Source: https://github.com/pingdotgg/t3code/blob/main/docs/integrations/source-control-providers.md Set environment variables for your Bitbucket email and API token. T3 Code uses these for authentication. ```bash export T3CODE_BITBUCKET_EMAIL="you@example.com" export T3CODE_BITBUCKET_API_TOKEN="your-token" ``` -------------------------------- ### Run t3 CLI Source: https://github.com/pingdotgg/t3code/blob/main/docs/getting-started/quick-start.md Execute the t3 command-line interface tool from any project directory after it has been published. ```bash # Or from any project directory after publishing: npx t3 ``` -------------------------------- ### Deploy Personal T3 Connect Relay Stage Locally Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/release.md Use this command to deploy a personal stage of the T3 Connect relay locally. It requires the `vp` tool and specifies the stage name based on the current user and an environment file. ```sh vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local ``` -------------------------------- ### Desktop UI Link: Request Environment Link Challenge Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The desktop web UI requests a short-lived challenge from the Relay Worker using a Clerk bearer token. ```bash C->>R: POST /v1/client/environment-link-challenges (Clerk bearer) ``` -------------------------------- ### Configure OpenRouter Environment Variables Source: https://github.com/pingdotgg/t3code/blob/main/docs/providers/claude.md Set environment variables for a Claude provider to enable OpenRouter integration. Ensure ANTHROPIC_AUTH_TOKEN is marked as sensitive. ```text ANTHROPIC_BASE_URL https://openrouter.ai/api ANTHROPIC_AUTH_TOKEN sk-or-... Sensitive ANTHROPIC_API_KEY Empty value ``` -------------------------------- ### Create Persistent Preview Build (iOS) Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Creates a persistent preview build for iOS using EAS. This build is intended for internal previews. ```bash vp run eas:ios:preview ``` -------------------------------- ### Remote Connect: Establish WebSocket Connection Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The client establishes a WebSocket connection to the managed environment using the obtained one-time WebSocket ticket. ```bash C->>E: WSS /ws with ticket ``` -------------------------------- ### Force Review Diff Highlighter Engine Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Forces the review diff highlighter engine to use a specific implementation. 'javascript' is the default and recommended setting. Use 'native' only for testing the native Shiki engine. ```bash EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=javascript vp run ios:dev ``` ```bash EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE=native vp run ios:dev ``` -------------------------------- ### Create PR Preview Dev-Client EAS Build (iOS) Source: https://github.com/pingdotgg/t3code/blob/main/apps/mobile/README.md Manually creates a PR preview dev-client build for iOS using EAS. This command is used for creating temporary builds for pull request reviews. ```bash vp run eas:ios:preview:dev ``` -------------------------------- ### Tail Server Trace File Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/observability.md Continuously monitor the server's trace log file in real-time. Use the appropriate path based on your environment (local or monorepo dev). ```bash tail -f "$T3CODE_HOME/userdata/logs/server.trace.ndjson" ``` ```bash tail -f ./dev/logs/server.trace.ndjson ``` -------------------------------- ### Create Claude OpenRouter Home Directory Source: https://github.com/pingdotgg/t3code/blob/main/docs/providers/claude.md Create a dedicated home directory for the OpenRouter Claude provider if you want to isolate it from your normal Claude account. ```bash mkdir -p ~/.claude_openrouter_home ``` -------------------------------- ### Desktop UI Link: Finalize Environment Link Source: https://github.com/pingdotgg/t3code/blob/main/docs/cloud/t3-code-connect-auth-flow.html The desktop web UI sends the environment-signed link proof to the Relay Worker to finalize the link. The Relay Worker verifies the challenge, proof, capabilities, nonce, and loopback origin, then reconciles Cloudflare resources and issues an environment bearer token. ```bash C->>R: POST /v1/client/environment-links (Clerk bearer + proof) ``` ```bash R->>R: Verify challenge, proof, capabilities, nonce, and loopback origin ``` ```bash R->>CF: Reconcile tunnel, ingress, and CNAME ``` ```bash R->>R: Upsert user/environment link and issue environment bearer ``` -------------------------------- ### Deploy Relay with Alchemy Source: https://github.com/pingdotgg/t3code/blob/main/docs/operations/relay-observability.md Use this command to deploy the relay from the infra/relay directory using the Alchemy workflow. Alchemy handles the resolution of Axiom deployment credentials. ```sh vp run deploy ```