tlc-claude-code 0.9.5 → 0.9.7
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/bin/init.js +90 -35
- package/bin/install.js +1 -0
- package/docker-compose.dev.yml +3 -3
- package/package.json +1 -1
- package/start.md +24 -0
package/bin/init.js
CHANGED
|
@@ -70,46 +70,53 @@ const shContent = `#!/bin/bash
|
|
|
70
70
|
|
|
71
71
|
set -e
|
|
72
72
|
|
|
73
|
-
|
|
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
|
-
)
|
|
73
|
+
PROJECT_PATH="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
|
|
74
|
+
TLC_DIR="$PROJECT_PATH/.tlc"
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
TLC_DIR="$NPM_ROOT/tlc-claude-code"
|
|
76
|
+
if [ ! -f "$TLC_DIR/docker-compose.dev.yml" ]; then
|
|
77
|
+
echo "[TLC] ERROR: .tlc folder not found. Run: tlc init"
|
|
78
|
+
exit 1
|
|
86
79
|
fi
|
|
87
80
|
|
|
88
|
-
# Check
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
81
|
+
# Check Docker
|
|
82
|
+
echo "[TLC] Checking Docker..."
|
|
83
|
+
if ! docker info >/dev/null 2>&1; then
|
|
84
|
+
echo "[TLC] Starting Docker..."
|
|
85
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
86
|
+
open -a Docker
|
|
87
|
+
fi
|
|
88
|
+
echo "[TLC] Waiting for Docker..."
|
|
89
|
+
for i in {1..30}; do
|
|
90
|
+
sleep 2
|
|
91
|
+
docker info >/dev/null 2>&1 && break
|
|
92
|
+
printf "."
|
|
97
93
|
done
|
|
94
|
+
echo ""
|
|
98
95
|
fi
|
|
99
96
|
|
|
100
|
-
if
|
|
101
|
-
echo "[TLC] ERROR:
|
|
102
|
-
echo "[TLC] Install with: npm install -g tlc-claude-code"
|
|
97
|
+
if ! docker info >/dev/null 2>&1; then
|
|
98
|
+
echo "[TLC] ERROR: Docker not running"
|
|
103
99
|
exit 1
|
|
104
100
|
fi
|
|
105
101
|
|
|
106
|
-
|
|
102
|
+
echo "[TLC] Docker ready!"
|
|
103
|
+
|
|
104
|
+
PROJECT_NAME=$(basename "$PROJECT_PATH" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9')
|
|
105
|
+
export PROJECT_DIR="$PROJECT_PATH"
|
|
106
|
+
export COMPOSE_PROJECT_NAME="\${PROJECT_NAME:-dev}"
|
|
107
107
|
|
|
108
|
-
echo "[TLC]
|
|
109
|
-
echo "
|
|
108
|
+
echo "[TLC] Project: $PROJECT_PATH"
|
|
109
|
+
echo ""
|
|
110
|
+
echo "[TLC] Starting services..."
|
|
111
|
+
echo " Dashboard: http://localhost:3147"
|
|
112
|
+
echo " App: http://localhost:5001"
|
|
113
|
+
echo " DB Admin: http://localhost:8080"
|
|
114
|
+
echo ""
|
|
115
|
+
echo "[TLC] Press Ctrl+C to stop"
|
|
110
116
|
echo ""
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
cd "$TLC_DIR"
|
|
119
|
+
docker-compose -f docker-compose.dev.yml up --build
|
|
113
120
|
`;
|
|
114
121
|
|
|
115
122
|
// Detect OS - WSL counts as Windows since user will double-click .bat from Explorer
|
|
@@ -118,10 +125,11 @@ const isWindows = process.platform === 'win32' || isWSL;
|
|
|
118
125
|
const launcherFile = isWindows ? 'tlc-start.bat' : 'tlc-start.sh';
|
|
119
126
|
const launcherPath = path.join(projectDir, launcherFile);
|
|
120
127
|
|
|
121
|
-
// FAST PATH: If launcher
|
|
122
|
-
|
|
128
|
+
// FAST PATH: If launcher and .tlc folder exist, just confirm and exit
|
|
129
|
+
const tlcFolderExists = fs.existsSync(path.join(projectDir, '.tlc', 'docker-compose.dev.yml'));
|
|
130
|
+
if (fs.existsSync(launcherPath) && tlcFolderExists) {
|
|
123
131
|
console.log('');
|
|
124
|
-
console.log(`[TLC] Already initialized
|
|
132
|
+
console.log(`[TLC] Already initialized.`);
|
|
125
133
|
console.log('');
|
|
126
134
|
if (isWindows) {
|
|
127
135
|
console.log('[TLC] To start: Double-click ' + launcherFile);
|
|
@@ -160,19 +168,66 @@ if (isWindows) {
|
|
|
160
168
|
console.log('[TLC] Note: Full macOS/Linux support coming soon!');
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
// Copy TLC files to project's .tlc/ directory for Docker access
|
|
172
|
+
const tlcLocalDir = path.join(projectDir, '.tlc');
|
|
173
|
+
const tlcInstallDir = path.join(__dirname, '..');
|
|
174
|
+
|
|
175
|
+
if (!fs.existsSync(tlcLocalDir)) {
|
|
176
|
+
fs.mkdirSync(tlcLocalDir, { recursive: true });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Copy server folder
|
|
180
|
+
const serverSrc = path.join(tlcInstallDir, 'server');
|
|
181
|
+
const serverDest = path.join(tlcLocalDir, 'server');
|
|
182
|
+
if (fs.existsSync(serverSrc)) {
|
|
183
|
+
copyDirSync(serverSrc, serverDest);
|
|
184
|
+
console.log('[TLC] Copied server to .tlc/server');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Copy docker-compose.dev.yml
|
|
188
|
+
const composeSrc = path.join(tlcInstallDir, 'docker-compose.dev.yml');
|
|
189
|
+
const composeDest = path.join(tlcLocalDir, 'docker-compose.dev.yml');
|
|
190
|
+
if (fs.existsSync(composeSrc)) {
|
|
191
|
+
fs.copyFileSync(composeSrc, composeDest);
|
|
192
|
+
console.log('[TLC] Copied docker-compose.dev.yml to .tlc/');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Helper to copy directory recursively
|
|
196
|
+
function copyDirSync(src, dest) {
|
|
197
|
+
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
|
198
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
199
|
+
const srcPath = path.join(src, entry.name);
|
|
200
|
+
const destPath = path.join(dest, entry.name);
|
|
201
|
+
if (entry.name === 'node_modules') continue; // Skip node_modules
|
|
202
|
+
if (entry.isDirectory()) {
|
|
203
|
+
copyDirSync(srcPath, destPath);
|
|
204
|
+
} else {
|
|
205
|
+
fs.copyFileSync(srcPath, destPath);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
163
210
|
// Add to .gitignore if not already there
|
|
164
211
|
const gitignorePath = path.join(projectDir, '.gitignore');
|
|
165
212
|
|
|
166
213
|
if (fs.existsSync(gitignorePath)) {
|
|
167
214
|
let gitignore = fs.readFileSync(gitignorePath, 'utf-8');
|
|
215
|
+
let updated = false;
|
|
168
216
|
if (!gitignore.includes('tlc-start')) {
|
|
169
|
-
gitignore += '
|
|
217
|
+
gitignore += '\n# TLC dev server (local only)\ntlc-start.*\n';
|
|
218
|
+
updated = true;
|
|
219
|
+
}
|
|
220
|
+
if (!gitignore.includes('.tlc/')) {
|
|
221
|
+
gitignore += '.tlc/\n';
|
|
222
|
+
updated = true;
|
|
223
|
+
}
|
|
224
|
+
if (updated) {
|
|
170
225
|
fs.writeFileSync(gitignorePath, gitignore);
|
|
171
|
-
console.log('[TLC]
|
|
226
|
+
console.log('[TLC] Updated .gitignore');
|
|
172
227
|
}
|
|
173
228
|
} else {
|
|
174
|
-
fs.writeFileSync(gitignorePath, '# TLC dev server
|
|
175
|
-
console.log('[TLC] Created .gitignore
|
|
229
|
+
fs.writeFileSync(gitignorePath, '# TLC dev server (local only)\ntlc-start.*\n.tlc/\n');
|
|
230
|
+
console.log('[TLC] Created .gitignore');
|
|
176
231
|
}
|
|
177
232
|
|
|
178
233
|
// Create/update .tlc.json if it doesn't exist
|
package/bin/install.js
CHANGED
package/docker-compose.dev.yml
CHANGED
|
@@ -40,7 +40,7 @@ services:
|
|
|
40
40
|
ports:
|
|
41
41
|
- "${APP_PORT:-5001}:5001"
|
|
42
42
|
volumes:
|
|
43
|
-
-
|
|
43
|
+
- ..:/app
|
|
44
44
|
- /app/node_modules
|
|
45
45
|
depends_on:
|
|
46
46
|
db:
|
|
@@ -74,7 +74,7 @@ services:
|
|
|
74
74
|
- "${DASHBOARD_PORT:-3147}:3147"
|
|
75
75
|
volumes:
|
|
76
76
|
- ./server:/tlc/server
|
|
77
|
-
-
|
|
77
|
+
- ..:/project
|
|
78
78
|
depends_on:
|
|
79
79
|
- app
|
|
80
80
|
restart: on-failure
|
|
@@ -91,7 +91,7 @@ services:
|
|
|
91
91
|
- BASE_URL=http://app:5001
|
|
92
92
|
- CI=true
|
|
93
93
|
volumes:
|
|
94
|
-
-
|
|
94
|
+
- ..:/app
|
|
95
95
|
depends_on:
|
|
96
96
|
- app
|
|
97
97
|
|
package/package.json
CHANGED
package/start.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# /tlc:start - Start TLC Dev Server
|
|
2
|
+
|
|
3
|
+
Start the Docker development environment.
|
|
4
|
+
|
|
5
|
+
## Instructions for Claude
|
|
6
|
+
|
|
7
|
+
Check which launcher exists and run the appropriate one:
|
|
8
|
+
|
|
9
|
+
**On Mac/Linux (or WSL):**
|
|
10
|
+
```bash
|
|
11
|
+
./tlc-start.sh
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**On Windows (CMD/PowerShell):**
|
|
15
|
+
```cmd
|
|
16
|
+
tlc-start.bat
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If neither file exists, tell the user:
|
|
20
|
+
```
|
|
21
|
+
No launcher found. Run 'tlc init' first.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Don't analyze the codebase. Just run the launcher.**
|