tlc-claude-code 0.8.2 → 0.8.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/README.md CHANGED
@@ -265,8 +265,8 @@ C:\Code\TLC\ (or your install location)
265
265
  npm install -g tlc-claude-code
266
266
 
267
267
  # Then use anywhere:
268
- tlc # Install slash commands
269
- tlc init # Add dev server to project
268
+ tlc # Install slash commands to Claude Code
269
+ tlc init # Add Docker launcher to project (creates tlc-start.bat)
270
270
  tlc --help # See all options
271
271
  ```
272
272
 
package/bin/rebuild.js ADDED
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * TLC Rebuild - Trigger full Docker rebuild
5
+ * Usage: tlc rebuild
6
+ */
7
+
8
+ const { spawn } = require('child_process');
9
+ const path = require('path');
10
+ const fs = require('fs');
11
+
12
+ // Find TLC installation directory
13
+ function findTlcDir() {
14
+ const isWSL = process.platform === 'linux' && fs.existsSync('/mnt/c');
15
+
16
+ // Check common locations (adjust for WSL)
17
+ const locations = [
18
+ path.join(__dirname, '..'), // Where this script lives (most reliable)
19
+ ];
20
+
21
+ if (isWSL) {
22
+ locations.push('/mnt/c/Code/TLC');
23
+ locations.push(path.join(require('os').homedir(), 'Code', 'TLC'));
24
+ } else {
25
+ locations.push('C:\\Code\\TLC');
26
+ locations.push(path.join(require('os').homedir(), 'Code', 'TLC'));
27
+ }
28
+
29
+ // Check npm global
30
+ try {
31
+ const { execSync } = require('child_process');
32
+ const globalRoot = execSync('npm root -g', { encoding: 'utf-8' }).trim();
33
+ locations.push(path.join(globalRoot, 'tlc-claude-code'));
34
+ } catch (e) {
35
+ // Ignore
36
+ }
37
+
38
+ for (const loc of locations) {
39
+ if (fs.existsSync(path.join(loc, 'docker-compose.dev.yml'))) {
40
+ return loc;
41
+ }
42
+ }
43
+
44
+ return null;
45
+ }
46
+
47
+ // Get project name from current directory
48
+ function getProjectName() {
49
+ const projectDir = process.cwd();
50
+ return path.basename(projectDir).toLowerCase().replace(/[^a-z0-9]/g, '');
51
+ }
52
+
53
+ async function main() {
54
+ console.log('');
55
+ console.log(' TLC Rebuild');
56
+ console.log(' ===========');
57
+ console.log('');
58
+
59
+ const tlcDir = findTlcDir();
60
+ if (!tlcDir) {
61
+ console.error(' [ERROR] Could not find TLC installation');
62
+ console.error(' Make sure docker-compose.dev.yml exists');
63
+ process.exit(1);
64
+ }
65
+
66
+ const projectName = getProjectName();
67
+ const composePath = path.join(tlcDir, 'docker-compose.dev.yml');
68
+
69
+ console.log(` TLC Dir: ${tlcDir}`);
70
+ console.log(` Project: ${projectName}`);
71
+ console.log('');
72
+
73
+ // Set environment variables
74
+ process.env.PROJECT_DIR = process.cwd();
75
+ process.env.COMPOSE_PROJECT_NAME = projectName;
76
+
77
+ console.log(' [1/2] Stopping containers...');
78
+
79
+ // Run docker-compose down
80
+ const down = spawn('docker-compose', ['-f', composePath, 'down'], {
81
+ stdio: 'inherit',
82
+ shell: true,
83
+ env: process.env
84
+ });
85
+
86
+ down.on('close', (code) => {
87
+ if (code !== 0) {
88
+ console.error(' [ERROR] Failed to stop containers');
89
+ process.exit(1);
90
+ }
91
+
92
+ console.log('');
93
+ console.log(' [2/2] Rebuilding and starting...');
94
+ console.log('');
95
+
96
+ // Run docker-compose up --build
97
+ const up = spawn('docker-compose', ['-f', composePath, 'up', '--build'], {
98
+ stdio: 'inherit',
99
+ shell: true,
100
+ env: process.env
101
+ });
102
+
103
+ up.on('close', (upCode) => {
104
+ process.exit(upCode || 0);
105
+ });
106
+ });
107
+ }
108
+
109
+ main();
package/bin/tlc.js CHANGED
@@ -4,10 +4,8 @@
4
4
  * TLC CLI - Simple entry point
5
5
  *
6
6
  * Usage:
7
- * tlc - Install TLC commands (interactive)
8
- * tlc init - Add dev server launcher to project
9
- * tlc server - Start dev server
10
- * tlc setup - Setup server requirements (Linux/macOS)
7
+ * tlc - Install TLC slash commands to Claude Code
8
+ * tlc init - Add Docker dev launcher (tlc-start.bat) to project
11
9
  */
12
10
 
13
11
  const args = process.argv.slice(2);
@@ -17,11 +15,8 @@ switch (command) {
17
15
  case 'init':
18
16
  require('./init.js');
19
17
  break;
20
- case 'server':
21
- require('./server.js');
22
- break;
23
- case 'setup':
24
- require('./setup.js');
18
+ case 'rebuild':
19
+ require('./rebuild.js');
25
20
  break;
26
21
  case 'help':
27
22
  case '--help':
@@ -30,18 +25,22 @@ switch (command) {
30
25
  TLC - Test Led Coding
31
26
 
32
27
  Usage:
33
- tlc Install TLC commands to Claude Code
34
- tlc init Add dev server launcher (tlc-start.bat) to project
35
- tlc server Start the TLC dev server
36
- tlc setup Setup server requirements (Linux/macOS)
28
+ tlc Install TLC slash commands to Claude Code
29
+ tlc init Add Docker launcher to your project
30
+ tlc rebuild Stop, rebuild, and restart Docker containers
37
31
 
38
32
  Options:
39
- --global, -g Install commands globally
40
- --local, -l Install commands locally
33
+ --global, -g Install commands globally (~/.claude/commands)
34
+ --local, -l Install commands locally (./.claude/commands)
35
+
36
+ After 'tlc init':
37
+ Double-click tlc-start.bat to launch Docker dev environment:
38
+ - Dashboard: http://localhost:3147
39
+ - App: http://localhost:5000
40
+ - DB Admin: http://localhost:8080
41
+ - Database: localhost:5433
41
42
 
42
- Examples:
43
- tlc --global Install commands for all projects
44
- tlc init Add Docker launcher to current project
43
+ Requires: Docker Desktop (https://docker.com/products/docker-desktop)
45
44
  `);
46
45
  break;
47
46
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",
@@ -8,7 +8,8 @@
8
8
  "tlc-dashboard": "./dashboard/dist/index.js",
9
9
  "tlc-server": "./bin/server.js",
10
10
  "tlc-setup": "./bin/setup.js",
11
- "tlc-init": "./bin/init.js"
11
+ "tlc-init": "./bin/init.js",
12
+ "tlc-rebuild": "./bin/rebuild.js"
12
13
  },
13
14
  "files": [
14
15
  "bin/",