tlc-claude-code 0.8.3 → 0.8.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/README.md CHANGED
@@ -163,6 +163,12 @@ tlc init
163
163
  - **Bug submission** — Web form for QA
164
164
  - **Task board** — Who's working on what
165
165
  - **Multi-project** — Containers named `tlc-{project}-*` for simultaneous projects
166
+ - **Hot reload** — Code changes apply instantly (no restart needed)
167
+
168
+ **Rebuild when needed:**
169
+ ```bash
170
+ tlc rebuild # After package.json changes or to get a clean slate
171
+ ```
166
172
 
167
173
  **Requirements:** [Docker Desktop](https://www.docker.com/products/docker-desktop)
168
174
 
@@ -267,6 +273,7 @@ npm install -g tlc-claude-code
267
273
  # Then use anywhere:
268
274
  tlc # Install slash commands to Claude Code
269
275
  tlc init # Add Docker launcher to project (creates tlc-start.bat)
276
+ tlc rebuild # Full Docker rebuild (after package.json changes)
270
277
  tlc --help # See all options
271
278
  ```
272
279
 
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
@@ -15,6 +15,9 @@ switch (command) {
15
15
  case 'init':
16
16
  require('./init.js');
17
17
  break;
18
+ case 'rebuild':
19
+ require('./rebuild.js');
20
+ break;
18
21
  case 'help':
19
22
  case '--help':
20
23
  case '-h':
@@ -24,6 +27,7 @@ switch (command) {
24
27
  Usage:
25
28
  tlc Install TLC slash commands to Claude Code
26
29
  tlc init Add Docker launcher to your project
30
+ tlc rebuild Stop, rebuild, and restart Docker containers
27
31
 
28
32
  Options:
29
33
  --global, -g Install commands globally (~/.claude/commands)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
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/",
package/server.md CHANGED
@@ -1,110 +1,89 @@
1
1
  # /tlc:server - TLC Development Server
2
2
 
3
- Launch a unified development environment with live app preview, real-time logs, and team collaboration.
3
+ Launch a Docker-based development environment with dashboard, database, and live reload.
4
4
 
5
5
  ## Instructions for Claude
6
6
 
7
- **DO NOT generate server code. Run the pre-built server from the TLC package.**
7
+ ### Step 1: Run tlc init
8
8
 
9
- ### Step 1: Start Server
10
-
11
- Run this command in the user's project directory:
9
+ Run this command in the user's project directory to create the Docker launcher:
12
10
 
13
11
  ```bash
14
- npx -p tlc-claude-code tlc-server
12
+ npx tlc-claude-code init
15
13
  ```
16
14
 
17
- That's it. The server will:
18
- - Auto-detect the project type
19
- - Start the user's app
20
- - Open dashboard at http://localhost:3147
15
+ This creates `tlc-start.bat` in the project folder.
21
16
 
22
- ### Step 2: Show User the URLs
17
+ ### Step 2: Show User Instructions
23
18
 
24
19
  ```
25
- TLC Dev Server running!
20
+ TLC Dev Server Setup Complete!
21
+
22
+ Created: tlc-start.bat
23
+
24
+ To start your dev environment:
25
+ 1. Double-click tlc-start.bat (Windows)
26
+ 2. Wait for Docker containers to start
26
27
 
27
- Dashboard: http://localhost:3147
28
- Share: http://{local-ip}:3147
28
+ Services:
29
+ Dashboard: http://localhost:3147
30
+ App: http://localhost:5000
31
+ DB Admin: http://localhost:8080
32
+ Database: localhost:5433
29
33
 
30
- Open dashboard in browser to see:
31
- - Live app preview
32
- - Real-time logs (App / Tests / Git)
33
- - Task board
34
- - Bug submission form
34
+ Requirements: Docker Desktop (https://docker.com/products/docker-desktop)
35
+
36
+ Other commands:
37
+ tlc rebuild # Full rebuild after package.json changes
35
38
  ```
36
39
 
37
40
  ---
38
41
 
39
- ## What the Server Does
42
+ ## What You Get
43
+
44
+ | URL | Service |
45
+ |-----|---------|
46
+ | http://localhost:3147 | Dashboard - Logs, tasks, bugs |
47
+ | http://localhost:5000 | App - Your running application |
48
+ | http://localhost:8080 | DB Admin - Adminer database GUI |
49
+ | localhost:5433 | PostgreSQL database |
50
+
51
+ ## Features
40
52
 
41
- - **Auto-detects** project type (Node, Python, Go, Ruby, Rust)
42
- - **Starts your app** using detected dev command
43
- - **Proxies** app at `/app/` to avoid CORS
44
- - **Streams logs** via WebSocket
45
- - **Shows tasks** from `.planning/phases/*-PLAN.md`
46
- - **Accepts bugs** via web form → `.planning/BUGS.md`
53
+ - **Hot reload** - Code changes apply instantly
54
+ - **Real-time logs** - App, tests, git activity
55
+ - **Bug submission** - Web form for QA
56
+ - **Task board** - Who's working on what
57
+ - **Multi-project** - Run multiple projects simultaneously
47
58
 
48
59
  ## Configuration
49
60
 
50
- Override auto-detection in `.tlc.json`:
61
+ Override settings in `.tlc.json`:
51
62
 
52
63
  ```json
53
64
  {
54
65
  "server": {
55
66
  "startCommand": "npm run dev",
56
- "appPort": 3000,
57
- "dashboardPort": 3147
67
+ "appPort": 3000
58
68
  }
59
69
  }
60
70
  ```
61
71
 
62
- ## Supported Project Types
72
+ ## Rebuild
63
73
 
64
- | File | Detected As | Command |
65
- |------|-------------|---------|
66
- | `package.json` (next) | Next.js | `npm run dev` |
67
- | `package.json` (vite) | Vite | `npm run dev` |
68
- | `package.json` (express) | Express | `npm start` |
69
- | `pyproject.toml` | FastAPI | `uvicorn main:app --reload` |
70
- | `requirements.txt` | Flask | `flask run` |
71
- | `go.mod` | Go | `go run .` |
72
- | `Gemfile` (rails) | Rails | `rails server` |
73
- | `Cargo.toml` | Rust | `cargo run` |
74
+ After changing `package.json` or dependencies:
74
75
 
75
- ## Dashboard Features
76
-
77
- ```
78
- ┌─────────────────────────────────────────────────────────────────┐
79
- │ TLC Dev Server [Run Tests] [Restart] │
80
- ├─────────────────────────────────────────────────────────────────┤
81
- │ │ │
82
- │ ┌─────────────────┐ │ ┌────────────────────────────┐ │
83
- │ │ LIVE PREVIEW │ │ │ LOGS [App] [Tests] [Git] │ │
84
- │ │ (your app) │ │ │ > Server started :3000 │ │
85
- │ └─────────────────┘ │ │ > GET /api/users 200 12ms │ │
86
- │ │ └────────────────────────────┘ │
87
- │ ┌─────────────────┐ │ ┌────────────────────────────┐ │
88
- │ │ REPORT BUG │ │ │ TASKS (from PLAN.md) │ │
89
- │ │ [textarea] │ │ │ ✓ Task 1 @alice │ │
90
- │ │ [Submit] │ │ │ → Task 2 @bob │ │
91
- │ └─────────────────┘ │ │ ○ Task 3 (available) │ │
92
- │ │ └────────────────────────────┘ │
93
- └─────────────────────────────────────────────────────────────────┘
76
+ ```bash
77
+ tlc rebuild
94
78
  ```
95
79
 
96
- ## QA Workflow
97
-
98
- 1. Engineer runs `/tlc:server`
99
- 2. QA opens `http://192.168.x.x:3147` in browser
100
- 3. QA tests app in live preview
101
- 4. QA submits bugs via web form
102
- 5. Bugs appear in `.planning/BUGS.md`
103
- 6. Engineer fixes, app hot-reloads
104
- 7. QA re-tests
80
+ Or manually:
81
+ ```bash
82
+ # Stop containers (Ctrl+C in the terminal)
83
+ # Double-click tlc-start.bat again
84
+ ```
105
85
 
106
- ## Notes
86
+ ## Requirements
107
87
 
108
- - Works on local network (share IP with QA)
109
- - For remote: `ngrok http 3147`
110
- - All data flows through git
88
+ - [Docker Desktop](https://www.docker.com/products/docker-desktop)
89
+ - Windows (macOS/Linux support coming soon)