tlc-claude-code 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Force LF line endings for shell scripts
2
+ *.sh text eol=lf
package/bin/init.js CHANGED
@@ -1,230 +1,234 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * TLC Init - Add TLC dev server launcher to a project
5
- * Usage: npx tlc-claude-code init
6
- */
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- const projectDir = process.cwd();
12
-
13
- // Windows batch file content
14
- const batContent = `@echo off
15
- :: ========================================
16
- :: TLC Dev Server Launcher
17
- :: ========================================
18
- :: Double-click to start your dev environment
19
- ::
20
- :: Dashboard: http://localhost:3147
21
- :: App: http://localhost:5000
22
- :: DB Admin: http://localhost:8080
23
- :: Database: localhost:5433
24
- :: ========================================
25
-
26
- setlocal
27
-
28
- :: Find TLC installation (check common locations)
29
- set TLC_DIR=
30
- if exist "C:\\Code\\TLC\\start-dev.ps1" set TLC_DIR=C:\\Code\\TLC
31
- if exist "%USERPROFILE%\\Code\\TLC\\start-dev.ps1" set TLC_DIR=%USERPROFILE%\\Code\\TLC
32
- if exist "%~dp0..\\TLC\\start-dev.ps1" set TLC_DIR=%~dp0..\\TLC
33
-
34
- :: Also check if installed globally via npm
35
- for /f "delims=" %%i in ('npm root -g 2^>nul') do (
36
- if exist "%%i\\tlc-claude-code\\start-dev.ps1" set TLC_DIR=%%i\\tlc-claude-code
37
- )
38
-
39
- if "%TLC_DIR%"=="" (
40
- echo [TLC] ERROR: Could not find TLC installation
41
- echo [TLC] Install TLC or set TLC_DIR in this script
42
- echo [TLC] See: https://github.com/jurgencalleja/TLC
43
- pause
44
- exit /b 1
45
- )
46
-
47
- :: Get project directory without trailing backslash
48
- set PROJECT_PATH=%~dp0
49
- if "%PROJECT_PATH:~-1%"=="\\" set PROJECT_PATH=%PROJECT_PATH:~0,-1%
50
-
51
- echo [TLC] Found TLC at: %TLC_DIR%
52
- echo [TLC] Starting dev server for: %PROJECT_PATH%
53
- echo.
54
-
55
- powershell -ExecutionPolicy Bypass -File "%TLC_DIR%\\start-dev.ps1" -ProjectPath "%PROJECT_PATH%"
56
-
57
- pause
58
- `;
59
-
60
- // macOS/Linux shell script
61
- const shContent = `#!/bin/bash
62
- # ========================================
63
- # TLC Dev Server Launcher
64
- # ========================================
65
- # Dashboard: http://localhost:3147
66
- # App: http://localhost:5000
67
- # DB Admin: http://localhost:8080
68
- # Database: localhost:5433
69
- # ========================================
70
-
71
- set -e
72
-
73
- # Find TLC installation
74
- TLC_DIR=""
75
- LOCATIONS=(
76
- "$HOME/.nvm/versions/node/*/lib/node_modules/tlc-claude-code"
77
- "/usr/local/lib/node_modules/tlc-claude-code"
78
- "/usr/lib/node_modules/tlc-claude-code"
79
- "$HOME/.npm-global/lib/node_modules/tlc-claude-code"
80
- )
81
-
82
- # Check npm global
83
- NPM_ROOT=$(npm root -g 2>/dev/null || echo "")
84
- if [ -n "$NPM_ROOT" ] && [ -f "$NPM_ROOT/tlc-claude-code/start-dev.sh" ]; then
85
- TLC_DIR="$NPM_ROOT/tlc-claude-code"
86
- fi
87
-
88
- # Check common locations
89
- if [ -z "$TLC_DIR" ]; then
90
- for pattern in "\${LOCATIONS[@]}"; do
91
- for dir in $pattern; do
92
- if [ -f "$dir/start-dev.sh" ]; then
93
- TLC_DIR="$dir"
94
- break 2
95
- fi
96
- done
97
- done
98
- fi
99
-
100
- if [ -z "$TLC_DIR" ]; then
101
- echo "[TLC] ERROR: Could not find TLC installation"
102
- echo "[TLC] Install with: npm install -g tlc-claude-code"
103
- exit 1
104
- fi
105
-
106
- PROJECT_PATH="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
107
-
108
- echo "[TLC] Found TLC at: $TLC_DIR"
109
- echo "[TLC] Starting dev server for: $PROJECT_PATH"
110
- echo ""
111
-
112
- exec "$TLC_DIR/start-dev.sh" "$PROJECT_PATH"
113
- `;
114
-
115
- // Detect OS - WSL counts as Windows since user will double-click .bat from Explorer
116
- const isWSL = process.platform === 'linux' && fs.existsSync('/mnt/c');
117
- const isWindows = process.platform === 'win32' || isWSL;
118
- const launcherFile = isWindows ? 'tlc-start.bat' : 'tlc-start.sh';
119
- const launcherPath = path.join(projectDir, launcherFile);
120
-
121
- // FAST PATH: If already initialized, just confirm and exit
122
- if (fs.existsSync(launcherPath) && fs.existsSync(path.join(projectDir, '.tlc.json'))) {
123
- console.log('');
124
- console.log(`[TLC] Already initialized. ${launcherFile} exists.`);
125
- console.log('');
126
- console.log('[TLC] To start: Double-click ' + launcherFile);
127
- console.log('[TLC] To rebuild: tlc rebuild');
128
- console.log('');
129
- process.exit(0);
130
- }
131
-
132
- console.log('');
133
- console.log(' ============================');
134
- console.log(' TLC Project Init');
135
- console.log(' ============================');
136
- console.log('');
137
-
138
- if (isWindows) {
139
- // Create Windows launcher
140
- const batPath = path.join(projectDir, 'tlc-start.bat');
141
-
142
- if (fs.existsSync(batPath)) {
143
- console.log('[TLC] tlc-start.bat already exists, overwriting...');
144
- }
145
- fs.writeFileSync(batPath, batContent);
146
- console.log('[TLC] Created: tlc-start.bat');
147
- } else {
148
- // Create Unix launcher (placeholder)
149
- const shPath = path.join(projectDir, 'tlc-start.sh');
150
-
151
- if (fs.existsSync(shPath)) {
152
- console.log('[TLC] tlc-start.sh already exists, overwriting...');
153
- }
154
- fs.writeFileSync(shPath, shContent, { mode: 0o755 });
155
- console.log('[TLC] Created: tlc-start.sh');
156
- console.log('[TLC] Note: Full macOS/Linux support coming soon!');
157
- }
158
-
159
- // Add to .gitignore if not already there
160
- const gitignorePath = path.join(projectDir, '.gitignore');
161
-
162
- if (fs.existsSync(gitignorePath)) {
163
- let gitignore = fs.readFileSync(gitignorePath, 'utf-8');
164
- if (!gitignore.includes('tlc-start')) {
165
- gitignore += '\\n# TLC dev server launcher (local only)\\ntlc-start.*\\n';
166
- fs.writeFileSync(gitignorePath, gitignore);
167
- console.log('[TLC] Added tlc-start.* to .gitignore');
168
- }
169
- } else {
170
- fs.writeFileSync(gitignorePath, '# TLC dev server launcher (local only)\\ntlc-start.*\\n');
171
- console.log('[TLC] Created .gitignore with tlc-start.*');
172
- }
173
-
174
- // Create/update .tlc.json if it doesn't exist
175
- const tlcConfigPath = path.join(projectDir, '.tlc.json');
176
- if (!fs.existsSync(tlcConfigPath)) {
177
- // Try to detect project settings
178
- const pkgPath = path.join(projectDir, 'package.json');
179
- let appPort = 3000;
180
- let startCommand = 'npm run dev';
181
-
182
- if (fs.existsSync(pkgPath)) {
183
- try {
184
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
185
- // Detect port from scripts if possible
186
- if (pkg.scripts?.dev?.includes('--port')) {
187
- const match = pkg.scripts.dev.match(/--port[=\\s]+(\\d+)/);
188
- if (match) appPort = parseInt(match[1]);
189
- }
190
- if (pkg.scripts?.dev?.includes('5000')) appPort = 5000;
191
- if (pkg.scripts?.dev?.includes('3000')) appPort = 3000;
192
- if (pkg.scripts?.dev?.includes('5173')) appPort = 5173;
193
- } catch (e) {
194
- // Ignore parsing errors
195
- }
196
- }
197
-
198
- const tlcConfig = {
199
- server: {
200
- startCommand: startCommand,
201
- appPort: appPort
202
- }
203
- };
204
-
205
- fs.writeFileSync(tlcConfigPath, JSON.stringify(tlcConfig, null, 2) + '\\n');
206
- console.log('[TLC] Created: .tlc.json');
207
- }
208
-
209
- console.log('');
210
- console.log('[TLC] Setup complete!');
211
- console.log('');
212
-
213
- if (isWindows) {
214
- console.log('[TLC] To start your dev server:');
215
- console.log(' Double-click tlc-start.bat');
216
- console.log('');
217
- console.log('[TLC] Or run from command line:');
218
- console.log(' .\\\\tlc-start.bat');
219
- } else {
220
- console.log('[TLC] To start your dev server:');
221
- console.log(' ./tlc-start.sh');
222
- }
223
-
224
- console.log('');
225
- console.log('[TLC] Services when running:');
226
- console.log(' Dashboard: http://localhost:3147');
227
- console.log(' App: http://localhost:5000');
228
- console.log(' DB Admin: http://localhost:8080');
229
- console.log(' Database: localhost:5433');
230
- console.log('');
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * TLC Init - Add TLC dev server launcher to a project
5
+ * Usage: npx tlc-claude-code init
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ const projectDir = process.cwd();
12
+
13
+ // Windows batch file content
14
+ const batContent = `@echo off
15
+ :: ========================================
16
+ :: TLC Dev Server Launcher
17
+ :: ========================================
18
+ :: Double-click to start your dev environment
19
+ ::
20
+ :: Dashboard: http://localhost:3147
21
+ :: App: http://localhost:5000
22
+ :: DB Admin: http://localhost:8080
23
+ :: Database: localhost:5433
24
+ :: ========================================
25
+
26
+ setlocal
27
+
28
+ :: Find TLC installation (check common locations)
29
+ set TLC_DIR=
30
+ if exist "C:\\Code\\TLC\\start-dev.ps1" set TLC_DIR=C:\\Code\\TLC
31
+ if exist "%USERPROFILE%\\Code\\TLC\\start-dev.ps1" set TLC_DIR=%USERPROFILE%\\Code\\TLC
32
+ if exist "%~dp0..\\TLC\\start-dev.ps1" set TLC_DIR=%~dp0..\\TLC
33
+
34
+ :: Also check if installed globally via npm
35
+ for /f "delims=" %%i in ('npm root -g 2^>nul') do (
36
+ if exist "%%i\\tlc-claude-code\\start-dev.ps1" set TLC_DIR=%%i\\tlc-claude-code
37
+ )
38
+
39
+ if "%TLC_DIR%"=="" (
40
+ echo [TLC] ERROR: Could not find TLC installation
41
+ echo [TLC] Install TLC or set TLC_DIR in this script
42
+ echo [TLC] See: https://github.com/jurgencalleja/TLC
43
+ pause
44
+ exit /b 1
45
+ )
46
+
47
+ :: Get project directory without trailing backslash
48
+ set PROJECT_PATH=%~dp0
49
+ if "%PROJECT_PATH:~-1%"=="\\" set PROJECT_PATH=%PROJECT_PATH:~0,-1%
50
+
51
+ echo [TLC] Found TLC at: %TLC_DIR%
52
+ echo [TLC] Starting dev server for: %PROJECT_PATH%
53
+ echo.
54
+
55
+ powershell -ExecutionPolicy Bypass -File "%TLC_DIR%\\start-dev.ps1" -ProjectPath "%PROJECT_PATH%"
56
+
57
+ pause
58
+ `;
59
+
60
+ // macOS/Linux shell script
61
+ const shContent = `#!/bin/bash
62
+ # ========================================
63
+ # TLC Dev Server Launcher
64
+ # ========================================
65
+ # Dashboard: http://localhost:3147
66
+ # App: http://localhost:5000
67
+ # DB Admin: http://localhost:8080
68
+ # Database: localhost:5433
69
+ # ========================================
70
+
71
+ set -e
72
+
73
+ # Find TLC installation
74
+ TLC_DIR=""
75
+ LOCATIONS=(
76
+ "$HOME/.nvm/versions/node/*/lib/node_modules/tlc-claude-code"
77
+ "/usr/local/lib/node_modules/tlc-claude-code"
78
+ "/usr/lib/node_modules/tlc-claude-code"
79
+ "$HOME/.npm-global/lib/node_modules/tlc-claude-code"
80
+ )
81
+
82
+ # Check npm global
83
+ NPM_ROOT=$(npm root -g 2>/dev/null || echo "")
84
+ if [ -n "$NPM_ROOT" ] && [ -f "$NPM_ROOT/tlc-claude-code/start-dev.sh" ]; then
85
+ TLC_DIR="$NPM_ROOT/tlc-claude-code"
86
+ fi
87
+
88
+ # Check common locations
89
+ if [ -z "$TLC_DIR" ]; then
90
+ for pattern in "\${LOCATIONS[@]}"; do
91
+ for dir in $pattern; do
92
+ if [ -f "$dir/start-dev.sh" ]; then
93
+ TLC_DIR="$dir"
94
+ break 2
95
+ fi
96
+ done
97
+ done
98
+ fi
99
+
100
+ if [ -z "$TLC_DIR" ]; then
101
+ echo "[TLC] ERROR: Could not find TLC installation"
102
+ echo "[TLC] Install with: npm install -g tlc-claude-code"
103
+ exit 1
104
+ fi
105
+
106
+ PROJECT_PATH="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
107
+
108
+ echo "[TLC] Found TLC at: $TLC_DIR"
109
+ echo "[TLC] Starting dev server for: $PROJECT_PATH"
110
+ echo ""
111
+
112
+ exec "$TLC_DIR/start-dev.sh" "$PROJECT_PATH"
113
+ `;
114
+
115
+ // Detect OS - WSL counts as Windows since user will double-click .bat from Explorer
116
+ const isWSL = process.platform === 'linux' && fs.existsSync('/mnt/c');
117
+ const isWindows = process.platform === 'win32' || isWSL;
118
+ const launcherFile = isWindows ? 'tlc-start.bat' : 'tlc-start.sh';
119
+ const launcherPath = path.join(projectDir, launcherFile);
120
+
121
+ // FAST PATH: If launcher exists for this OS, just confirm and exit
122
+ if (fs.existsSync(launcherPath)) {
123
+ console.log('');
124
+ console.log(`[TLC] Already initialized. ${launcherFile} exists.`);
125
+ console.log('');
126
+ if (isWindows) {
127
+ console.log('[TLC] To start: Double-click ' + launcherFile);
128
+ } else {
129
+ console.log('[TLC] To start: ./' + launcherFile);
130
+ }
131
+ console.log('[TLC] To rebuild: tlc rebuild');
132
+ console.log('');
133
+ process.exit(0);
134
+ }
135
+
136
+ console.log('');
137
+ console.log(' ============================');
138
+ console.log(' TLC Project Init');
139
+ console.log(' ============================');
140
+ console.log('');
141
+
142
+ if (isWindows) {
143
+ // Create Windows launcher
144
+ const batPath = path.join(projectDir, 'tlc-start.bat');
145
+
146
+ if (fs.existsSync(batPath)) {
147
+ console.log('[TLC] tlc-start.bat already exists, overwriting...');
148
+ }
149
+ fs.writeFileSync(batPath, batContent);
150
+ console.log('[TLC] Created: tlc-start.bat');
151
+ } else {
152
+ // Create Unix launcher (placeholder)
153
+ const shPath = path.join(projectDir, 'tlc-start.sh');
154
+
155
+ if (fs.existsSync(shPath)) {
156
+ console.log('[TLC] tlc-start.sh already exists, overwriting...');
157
+ }
158
+ fs.writeFileSync(shPath, shContent, { mode: 0o755 });
159
+ console.log('[TLC] Created: tlc-start.sh');
160
+ console.log('[TLC] Note: Full macOS/Linux support coming soon!');
161
+ }
162
+
163
+ // Add to .gitignore if not already there
164
+ const gitignorePath = path.join(projectDir, '.gitignore');
165
+
166
+ if (fs.existsSync(gitignorePath)) {
167
+ let gitignore = fs.readFileSync(gitignorePath, 'utf-8');
168
+ if (!gitignore.includes('tlc-start')) {
169
+ gitignore += '\\n# TLC dev server launcher (local only)\\ntlc-start.*\\n';
170
+ fs.writeFileSync(gitignorePath, gitignore);
171
+ console.log('[TLC] Added tlc-start.* to .gitignore');
172
+ }
173
+ } else {
174
+ fs.writeFileSync(gitignorePath, '# TLC dev server launcher (local only)\\ntlc-start.*\\n');
175
+ console.log('[TLC] Created .gitignore with tlc-start.*');
176
+ }
177
+
178
+ // Create/update .tlc.json if it doesn't exist
179
+ const tlcConfigPath = path.join(projectDir, '.tlc.json');
180
+ if (!fs.existsSync(tlcConfigPath)) {
181
+ // Try to detect project settings
182
+ const pkgPath = path.join(projectDir, 'package.json');
183
+ let appPort = 3000;
184
+ let startCommand = 'npm run dev';
185
+
186
+ if (fs.existsSync(pkgPath)) {
187
+ try {
188
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
189
+ // Detect port from scripts if possible
190
+ if (pkg.scripts?.dev?.includes('--port')) {
191
+ const match = pkg.scripts.dev.match(/--port[=\\s]+(\\d+)/);
192
+ if (match) appPort = parseInt(match[1]);
193
+ }
194
+ if (pkg.scripts?.dev?.includes('5000')) appPort = 5000;
195
+ if (pkg.scripts?.dev?.includes('3000')) appPort = 3000;
196
+ if (pkg.scripts?.dev?.includes('5173')) appPort = 5173;
197
+ } catch (e) {
198
+ // Ignore parsing errors
199
+ }
200
+ }
201
+
202
+ const tlcConfig = {
203
+ server: {
204
+ startCommand: startCommand,
205
+ appPort: appPort
206
+ }
207
+ };
208
+
209
+ fs.writeFileSync(tlcConfigPath, JSON.stringify(tlcConfig, null, 2) + '\\n');
210
+ console.log('[TLC] Created: .tlc.json');
211
+ }
212
+
213
+ console.log('');
214
+ console.log('[TLC] Setup complete!');
215
+ console.log('');
216
+
217
+ if (isWindows) {
218
+ console.log('[TLC] To start your dev server:');
219
+ console.log(' Double-click tlc-start.bat');
220
+ console.log('');
221
+ console.log('[TLC] Or run from command line:');
222
+ console.log(' .\\\\tlc-start.bat');
223
+ } else {
224
+ console.log('[TLC] To start your dev server:');
225
+ console.log(' ./tlc-start.sh');
226
+ }
227
+
228
+ console.log('');
229
+ console.log('[TLC] Services when running:');
230
+ console.log(' Dashboard: http://localhost:3147');
231
+ console.log(' App: http://localhost:5000');
232
+ console.log(' DB Admin: http://localhost:8080');
233
+ console.log(' Database: localhost:5433');
234
+ console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",
@@ -16,7 +16,8 @@
16
16
  "start-dev.sh",
17
17
  "start-dev.bat",
18
18
  "*.md",
19
- "install.sh"
19
+ "install.sh",
20
+ ".gitattributes"
20
21
  ],
21
22
  "scripts": {
22
23
  "build": "cd dashboard && npm run build",
package/start-dev.sh CHANGED
@@ -1,91 +1,91 @@
1
- #!/bin/bash
2
-
3
- # TLC Dev Server Launcher
4
- # Usage: ./start-dev.sh [project-path]
5
-
6
- set -e
7
-
8
- PROJECT_PATH="${1:-$(pwd)}"
9
-
10
- echo ""
11
- echo " ============================"
12
- echo " TLC Dev Server"
13
- echo " ============================"
14
- echo ""
15
-
16
- # Check Docker
17
- echo "[TLC] Checking Docker..."
18
- if ! docker info >/dev/null 2>&1; then
19
- echo "[TLC] Docker is not running."
20
-
21
- # Try to start Docker based on OS
22
- if [[ "$OSTYPE" == "darwin"* ]]; then
23
- echo "[TLC] Starting Docker Desktop..."
24
- open -a Docker
25
- elif [[ -f /etc/debian_version ]] || [[ -f /etc/redhat-release ]]; then
26
- echo "[TLC] Starting Docker service..."
27
- sudo systemctl start docker 2>/dev/null || sudo service docker start 2>/dev/null || true
28
- fi
29
-
30
- echo "[TLC] Waiting for Docker..."
31
- TIMEOUT=60
32
- ELAPSED=0
33
- while [ $ELAPSED -lt $TIMEOUT ]; do
34
- sleep 2
35
- ELAPSED=$((ELAPSED + 2))
36
- if docker info >/dev/null 2>&1; then
37
- break
38
- fi
39
- printf "."
40
- done
41
- echo ""
42
-
43
- if ! docker info >/dev/null 2>&1; then
44
- echo "[TLC] ERROR: Docker failed to start"
45
- echo "[TLC] Please start Docker manually and try again"
46
- exit 1
47
- fi
48
- fi
49
-
50
- echo "[TLC] Docker is ready!"
51
-
52
- # Resolve project path
53
- PROJECT_PATH="$(cd "$PROJECT_PATH" 2>/dev/null && pwd)"
54
- if [ -z "$PROJECT_PATH" ]; then
55
- echo "[TLC] ERROR: Invalid project path"
56
- exit 1
57
- fi
58
-
59
- # Get project name from directory
60
- PROJECT_NAME=$(basename "$PROJECT_PATH" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9')
61
- if [ -z "$PROJECT_NAME" ]; then
62
- PROJECT_NAME="dev"
63
- fi
64
-
65
- echo "[TLC] Project: $PROJECT_PATH"
66
- echo "[TLC] Name: $PROJECT_NAME"
67
-
68
- # Set environment
69
- export PROJECT_DIR="$PROJECT_PATH"
70
- export COMPOSE_PROJECT_NAME="$PROJECT_NAME"
71
-
72
- # Find TLC installation directory
73
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
74
- cd "$SCRIPT_DIR"
75
-
76
- echo ""
77
- echo "[TLC] Starting services..."
78
- echo " Dashboard: http://localhost:3147"
79
- echo " App: http://localhost:5000"
80
- echo " DB Admin: http://localhost:8080"
81
- echo " Database: localhost:5433 (postgres/postgres)"
82
- echo ""
83
- echo "[TLC] Containers: tlc-$PROJECT_NAME-*"
84
- echo "[TLC] Press Ctrl+C to stop"
85
- echo ""
86
-
87
- # Run docker-compose
88
- docker-compose -f docker-compose.dev.yml up --build
89
-
90
- echo ""
91
- echo "[TLC] Stopped."
1
+ #!/bin/bash
2
+
3
+ # TLC Dev Server Launcher
4
+ # Usage: ./start-dev.sh [project-path]
5
+
6
+ set -e
7
+
8
+ PROJECT_PATH="${1:-$(pwd)}"
9
+
10
+ echo ""
11
+ echo " ============================"
12
+ echo " TLC Dev Server"
13
+ echo " ============================"
14
+ echo ""
15
+
16
+ # Check Docker
17
+ echo "[TLC] Checking Docker..."
18
+ if ! docker info >/dev/null 2>&1; then
19
+ echo "[TLC] Docker is not running."
20
+
21
+ # Try to start Docker based on OS
22
+ if [[ "$OSTYPE" == "darwin"* ]]; then
23
+ echo "[TLC] Starting Docker Desktop..."
24
+ open -a Docker
25
+ elif [[ -f /etc/debian_version ]] || [[ -f /etc/redhat-release ]]; then
26
+ echo "[TLC] Starting Docker service..."
27
+ sudo systemctl start docker 2>/dev/null || sudo service docker start 2>/dev/null || true
28
+ fi
29
+
30
+ echo "[TLC] Waiting for Docker..."
31
+ TIMEOUT=60
32
+ ELAPSED=0
33
+ while [ $ELAPSED -lt $TIMEOUT ]; do
34
+ sleep 2
35
+ ELAPSED=$((ELAPSED + 2))
36
+ if docker info >/dev/null 2>&1; then
37
+ break
38
+ fi
39
+ printf "."
40
+ done
41
+ echo ""
42
+
43
+ if ! docker info >/dev/null 2>&1; then
44
+ echo "[TLC] ERROR: Docker failed to start"
45
+ echo "[TLC] Please start Docker manually and try again"
46
+ exit 1
47
+ fi
48
+ fi
49
+
50
+ echo "[TLC] Docker is ready!"
51
+
52
+ # Resolve project path
53
+ PROJECT_PATH="$(cd "$PROJECT_PATH" 2>/dev/null && pwd)"
54
+ if [ -z "$PROJECT_PATH" ]; then
55
+ echo "[TLC] ERROR: Invalid project path"
56
+ exit 1
57
+ fi
58
+
59
+ # Get project name from directory
60
+ PROJECT_NAME=$(basename "$PROJECT_PATH" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9')
61
+ if [ -z "$PROJECT_NAME" ]; then
62
+ PROJECT_NAME="dev"
63
+ fi
64
+
65
+ echo "[TLC] Project: $PROJECT_PATH"
66
+ echo "[TLC] Name: $PROJECT_NAME"
67
+
68
+ # Set environment
69
+ export PROJECT_DIR="$PROJECT_PATH"
70
+ export COMPOSE_PROJECT_NAME="$PROJECT_NAME"
71
+
72
+ # Find TLC installation directory
73
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
74
+ cd "$SCRIPT_DIR"
75
+
76
+ echo ""
77
+ echo "[TLC] Starting services..."
78
+ echo " Dashboard: http://localhost:3147"
79
+ echo " App: http://localhost:5000"
80
+ echo " DB Admin: http://localhost:8080"
81
+ echo " Database: localhost:5433 (postgres/postgres)"
82
+ echo ""
83
+ echo "[TLC] Containers: tlc-$PROJECT_NAME-*"
84
+ echo "[TLC] Press Ctrl+C to stop"
85
+ echo ""
86
+
87
+ # Run docker-compose
88
+ docker-compose -f docker-compose.dev.yml up --build
89
+
90
+ echo ""
91
+ echo "[TLC] Stopped."