Overview
The T3 Code CLI provides powerful options for running the server with custom configurations. Use it for development, production deployments, remote access, and CI/CD integration.Basic Usage
Start the server with default settings:CLI Flags
Mode
Set the runtime mode:- Binds to
127.0.0.1by default (security) - Disables automatic browser opening
- Uses fixed port (8080)
Port
Specify the HTTP/WebSocket server port:In web mode, if the port is taken, the server finds the next available port. In desktop mode, it fails if the port is occupied.
Host
Bind to a specific network interface:State Directory
Customize where T3 Code stores data:- SQLite database (projects, threads, messages)
keybindings.jsonconfiguration- Checkpoint metadata
- Session state
- macOS:
~/Library/Application Support/T3 Code - Windows:
%APPDATA%\T3 Code - Linux:
~/.config/t3-code
Development URL
Proxy to a Vite dev server during development:Browser Control
Disable automatic browser opening:Authentication
Require a token for WebSocket connections:Auth tokens are essential when binding to non-localhost interfaces.
Project Bootstrapping
Automatically create a project for the current directory:WebSocket Logging
Enable detailed WebSocket event logging:Environment Variables
All flags have environment variable equivalents:Common Scenarios
Local Development
Remote Access
1
Bind to all interfaces
2
Add authentication
3
Share the URL
Tailscale Setup
Production Deployment
Docker Container
Systemd Service
Security Best Practices
Generate Strong Tokens
Restrict Network Access
Use firewall rules to limit connections:Use Reverse Proxy
Run behind nginx or Caddy for HTTPS:Debugging
Verbose Logging
Enable debug logs:Connection Issues
Test WebSocket connection:Port Conflicts
Find process using a port:Performance Tuning
State Directory on SSD
Store state on fast storage for better database performance:Limit Concurrent Sessions
The server handles multiple projects and threads efficiently, but heavy workloads benefit from dedicated resources:- Light use (1-2 active threads): 2GB RAM, 2 CPU cores
- Medium use (3-5 active threads): 4GB RAM, 4 CPU cores
- Heavy use (6+ active threads): 8GB RAM, 8 CPU cores
Next Steps
- Organize codebases in Project Management
- Integrate version control with Git Workflow
- Explore the Web Interface for daily use
