tlc-claude-code 0.9.3 → 0.9.5

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/README.md CHANGED
@@ -154,7 +154,7 @@ tlc init
154
154
  | URL | Service |
155
155
  |-----|---------|
156
156
  | http://localhost:3147 | Dashboard — Live preview, logs, tasks |
157
- | http://localhost:5000 | App — Your running application |
157
+ | http://localhost:5001 | App — Your running application |
158
158
  | http://localhost:8080 | DB Admin — Database GUI (Adminer) |
159
159
  | localhost:5433 | Database — PostgreSQL |
160
160
 
package/bin/init.js CHANGED
@@ -1,234 +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 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('');
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:5001
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:5001
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('5001')) appPort = 5001;
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:5001');
232
+ console.log(' DB Admin: http://localhost:8080');
233
+ console.log(' Database: localhost:5433');
234
+ console.log('');
@@ -36,9 +36,9 @@ services:
36
36
  environment:
37
37
  - NODE_ENV=development
38
38
  - DATABASE_URL=postgres://postgres:postgres@db:5432/app
39
- - PORT=5000
39
+ - PORT=5001
40
40
  ports:
41
- - "${APP_PORT:-5000}:5000"
41
+ - "${APP_PORT:-5001}:5001"
42
42
  volumes:
43
43
  - ${PROJECT_DIR:-.}:/app
44
44
  - /app/node_modules
@@ -69,7 +69,7 @@ services:
69
69
  environment:
70
70
  - TLC_PORT=3147
71
71
  - TLC_PROXY_ONLY=true
72
- - TLC_APP_PORT=5000
72
+ - TLC_APP_PORT=5001
73
73
  ports:
74
74
  - "${DASHBOARD_PORT:-3147}:3147"
75
75
  volumes:
@@ -88,7 +88,7 @@ services:
88
88
  - test
89
89
  command: npx playwright test
90
90
  environment:
91
- - BASE_URL=http://app:5000
91
+ - BASE_URL=http://app:5001
92
92
  - CI=true
93
93
  volumes:
94
94
  - ${PROJECT_DIR:-.}:/app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
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",
@@ -589,9 +589,9 @@
589
589
  <div class="sidebar-section">
590
590
  <h3>Links</h3>
591
591
  <div class="links">
592
- <a class="link" href="http://localhost:5000" target="_blank">
592
+ <a class="link" href="http://localhost:5001" target="_blank">
593
593
  <span>App</span>
594
- <span class="url">:5000</span>
594
+ <span class="url">:5001</span>
595
595
  </a>
596
596
  <a class="link" href="http://localhost:8080" target="_blank">
597
597
  <span>Database Admin</span>
package/server.md CHANGED
@@ -26,7 +26,7 @@ To start your dev environment:
26
26
 
27
27
  Services when running:
28
28
  Dashboard: http://localhost:3147
29
- App: http://localhost:5000
29
+ App: http://localhost:5001
30
30
  DB Admin: http://localhost:8080
31
31
  Database: localhost:5433
32
32
 
package/start-dev.ps1 CHANGED
@@ -81,7 +81,7 @@ Set-Location $scriptDir
81
81
  Write-Host ""
82
82
  Write-Host "[TLC] Starting services..." -ForegroundColor Yellow
83
83
  Write-Host " Dashboard: http://localhost:3147" -ForegroundColor White
84
- Write-Host " App: http://localhost:5000" -ForegroundColor White
84
+ Write-Host " App: http://localhost:5001" -ForegroundColor White
85
85
  Write-Host " DB Admin: http://localhost:8080" -ForegroundColor White
86
86
  Write-Host " Database: localhost:5433 (postgres/postgres)" -ForegroundColor Gray
87
87
  Write-Host ""
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:5001"
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."