@_xtribe/cli 1.0.0-beta.5 → 1.0.0-beta.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/README.md +76 -130
- package/install-tribe.js +225 -34
- package/package.json +11 -6
- package/tribe +0 -0
- package/tribe-deployment.yaml +448 -0
package/README.md
CHANGED
|
@@ -1,177 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TRIBE CLI - Zero to Productive in One Command
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TRIBE is an AI-powered multi-agent development system that manages your entire development workflow. From project creation to task implementation and PR reviews, TRIBE's AI agents handle it all.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🚀 One-Command Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @_xtribe/cli
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This single command
|
|
12
|
-
- ✅ Docker
|
|
13
|
-
- ✅ Colima
|
|
14
|
-
- ✅
|
|
15
|
-
- ✅
|
|
16
|
-
- ✅
|
|
17
|
-
- ✅ TRIBE CLI (multi-agent orchestration)
|
|
11
|
+
That's it! This single command will:
|
|
12
|
+
- ✅ Install all required tools (Docker, Kubernetes, kubectl)
|
|
13
|
+
- ✅ Set up Colima container runtime (macOS)
|
|
14
|
+
- ✅ Deploy the complete TRIBE cluster
|
|
15
|
+
- ✅ Configure everything automatically
|
|
16
|
+
- ✅ Guide you through creating your first project
|
|
18
17
|
|
|
19
|
-
##
|
|
18
|
+
## 🎯 What is TRIBE?
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
TRIBE is a complete development ecosystem where AI agents:
|
|
21
|
+
- 📝 Implement features based on your descriptions
|
|
22
|
+
- 🔧 Fix bugs autonomously
|
|
23
|
+
- 🔀 Create pull requests
|
|
24
|
+
- 👀 Handle code reviews
|
|
25
|
+
- 🚀 Manage the entire development lifecycle
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
# Option 1: Use installed Colima
|
|
25
|
-
colima start --cpu 2 --memory 4
|
|
26
|
-
|
|
27
|
-
# Option 2: Use Docker Desktop
|
|
28
|
-
# Download from: https://docs.docker.com/desktop/install/mac-install/
|
|
27
|
+
## 💡 Quick Start
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
brew install colima docker
|
|
32
|
-
colima start
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Then start your TRIBE development environment:
|
|
29
|
+
After installation, just run:
|
|
36
30
|
|
|
37
31
|
```bash
|
|
38
|
-
tribe
|
|
39
|
-
tribe status
|
|
40
|
-
tribe deploy-task --prompt "Create REST API" --repo "https://github.com/your/repo"
|
|
32
|
+
tribe
|
|
41
33
|
```
|
|
42
34
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## System Requirements
|
|
48
|
-
|
|
49
|
-
- macOS or Linux
|
|
50
|
-
- Node.js 16+
|
|
51
|
-
- Internet connection for downloads
|
|
52
|
-
|
|
53
|
-
## Support
|
|
35
|
+
The interactive CLI will:
|
|
36
|
+
1. **First time?** Guide you through creating your first project
|
|
37
|
+
2. **Returning?** Show your projects, tasks, and agent activity
|
|
54
38
|
|
|
55
|
-
|
|
56
|
-
- Documentation: https://github.com/0zen/0zen
|
|
57
|
-
|
|
58
|
-
## License
|
|
59
|
-
|
|
60
|
-
MIT
|
|
61
|
-
|
|
62
|
-
## Overview
|
|
63
|
-
|
|
64
|
-
The TRIBE CLI GUI provides both interactive and non-interactive modes for:
|
|
65
|
-
- Listing and viewing tasks
|
|
66
|
-
- Managing projects
|
|
67
|
-
- Monitoring agents
|
|
68
|
-
- Creating new tasks (interactive mode)
|
|
69
|
-
|
|
70
|
-
## Installation
|
|
39
|
+
### Creating Tasks
|
|
71
40
|
|
|
72
41
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
42
|
+
tribe create-task
|
|
43
|
+
# Select project, describe what you want built
|
|
44
|
+
# An AI agent picks it up and implements it!
|
|
75
45
|
```
|
|
76
46
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### Interactive Mode
|
|
80
|
-
|
|
81
|
-
Simply run the CLI without arguments:
|
|
47
|
+
### Reviewing PRs
|
|
82
48
|
|
|
83
49
|
```bash
|
|
84
|
-
|
|
50
|
+
tribe review-task
|
|
51
|
+
# See PRs created by agents
|
|
52
|
+
# Review diffs, add comments, merge
|
|
85
53
|
```
|
|
86
54
|
|
|
87
|
-
|
|
88
|
-
1. List all tasks
|
|
89
|
-
2. List all projects
|
|
90
|
-
3. List all agents
|
|
91
|
-
4. Create a new task
|
|
92
|
-
5. View task details
|
|
55
|
+
## 🛠️ System Requirements
|
|
93
56
|
|
|
94
|
-
|
|
57
|
+
- **macOS** or **Linux**
|
|
58
|
+
- **4GB RAM** minimum (8GB recommended)
|
|
59
|
+
- **20GB disk space**
|
|
60
|
+
- **Node.js 16+**
|
|
95
61
|
|
|
96
|
-
|
|
62
|
+
## 📚 Common Commands
|
|
97
63
|
|
|
98
64
|
```bash
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
# List all agents
|
|
106
|
-
./cli-gui --non-interactive --cmd list-agents
|
|
107
|
-
|
|
108
|
-
# View task details
|
|
109
|
-
./cli-gui --non-interactive --cmd task-details --task-id task-8e4999d6
|
|
110
|
-
|
|
111
|
-
# Get JSON output
|
|
112
|
-
./cli-gui --non-interactive --cmd list-tasks --format json
|
|
65
|
+
tribe # Interactive mode
|
|
66
|
+
tribe status # Check system status
|
|
67
|
+
tribe create-task # Create a new task
|
|
68
|
+
tribe review-task # Review agent PRs
|
|
69
|
+
tribe list-projects # Show all projects
|
|
70
|
+
tribe list-agents # Show agent status
|
|
113
71
|
```
|
|
114
72
|
|
|
115
|
-
|
|
73
|
+
## 🔧 Architecture
|
|
116
74
|
|
|
117
|
-
|
|
75
|
+
TRIBE runs a local Kubernetes cluster with:
|
|
76
|
+
- **Bridge** - API gateway and orchestrator
|
|
77
|
+
- **TaskMaster** - Task queue and agent coordinator
|
|
78
|
+
- **Claude Agents** - AI workers powered by Claude
|
|
79
|
+
- **Gitea** - Local Git server for repositories
|
|
80
|
+
- **PostgreSQL** - Database for state management
|
|
118
81
|
|
|
119
|
-
|
|
120
|
-
export TASKMASTER_URL=http://localhost:8080
|
|
121
|
-
export BRIDGE_URL=http://localhost:3456
|
|
122
|
-
export GITEA_URL=http://localhost:3000
|
|
123
|
-
```
|
|
82
|
+
## 🤝 Contributing
|
|
124
83
|
|
|
125
|
-
|
|
84
|
+
TRIBE is open source! Visit our [GitHub repository](https://github.com/0zen/0zen) to contribute.
|
|
126
85
|
|
|
127
|
-
|
|
128
|
-
- `--cmd <command>`: Command to execute (required in non-interactive mode)
|
|
129
|
-
- `list-tasks`: List all tasks
|
|
130
|
-
- `list-projects`: List all projects
|
|
131
|
-
- `list-agents`: List all agents
|
|
132
|
-
- `task-details`: View details of a specific task
|
|
133
|
-
- `--task-id <id>`: Task ID (required for task-details command)
|
|
134
|
-
- `--format <format>`: Output format (text or json, default: text)
|
|
86
|
+
## 📖 Documentation
|
|
135
87
|
|
|
136
|
-
|
|
88
|
+
For detailed documentation, visit the [TRIBE Flow Guide](https://github.com/0zen/0zen/blob/main/TRIBE-SYSTEM-FLOW-GUIDE.md).
|
|
137
89
|
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
./cli-gui --non-interactive --cmd list-tasks --format json
|
|
141
|
-
```
|
|
90
|
+
## 🆘 Troubleshooting
|
|
142
91
|
|
|
143
|
-
###
|
|
92
|
+
### Cluster not starting?
|
|
144
93
|
```bash
|
|
145
|
-
|
|
94
|
+
# Check if Colima is running
|
|
95
|
+
colima status
|
|
96
|
+
|
|
97
|
+
# Start manually if needed
|
|
98
|
+
colima start --kubernetes
|
|
99
|
+
tribe start
|
|
146
100
|
```
|
|
147
101
|
|
|
148
|
-
###
|
|
102
|
+
### Port conflicts?
|
|
149
103
|
```bash
|
|
150
|
-
|
|
104
|
+
# Check what's using ports
|
|
105
|
+
lsof -i :30080
|
|
106
|
+
lsof -i :3456
|
|
151
107
|
```
|
|
152
108
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
## Development
|
|
158
|
-
|
|
159
|
-
### Adding New Commands
|
|
160
|
-
|
|
161
|
-
1. Add the command to the switch statement in `runNonInteractive()`
|
|
162
|
-
2. Implement the corresponding function
|
|
163
|
-
3. Add any necessary API methods to `api.go`
|
|
164
|
-
4. Update this README with the new command
|
|
109
|
+
### Reset everything?
|
|
110
|
+
```bash
|
|
111
|
+
# Stop cluster
|
|
112
|
+
colima stop
|
|
165
113
|
|
|
166
|
-
|
|
114
|
+
# Remove TRIBE namespace
|
|
115
|
+
kubectl delete namespace tribe-system
|
|
167
116
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
117
|
+
# Start fresh
|
|
118
|
+
tribe start
|
|
119
|
+
```
|
|
171
120
|
|
|
172
|
-
|
|
173
|
-
GOOS=darwin GOARCH=amd64 go build -o cli-gui-macos .
|
|
121
|
+
## 📄 License
|
|
174
122
|
|
|
175
|
-
|
|
176
|
-
GOOS=windows GOARCH=amd64 go build -o cli-gui.exe .
|
|
177
|
-
```
|
|
123
|
+
MIT License - see [LICENSE](https://github.com/0zen/0zen/blob/main/LICENSE) for details.
|
package/install-tribe.js
CHANGED
|
@@ -13,12 +13,18 @@ const platform = os.platform();
|
|
|
13
13
|
const arch = os.arch();
|
|
14
14
|
const homeDir = os.homedir();
|
|
15
15
|
const binDir = path.join(homeDir, 'bin');
|
|
16
|
+
const tribeDir = path.join(homeDir, '.tribe');
|
|
16
17
|
|
|
17
18
|
// Ensure local bin directory exists
|
|
18
19
|
if (!fs.existsSync(binDir)) {
|
|
19
20
|
fs.mkdirSync(binDir, { recursive: true });
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
// Ensure TRIBE config directory exists
|
|
24
|
+
if (!fs.existsSync(tribeDir)) {
|
|
25
|
+
fs.mkdirSync(tribeDir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
const log = {
|
|
23
29
|
success: (msg) => console.log(chalk.green('✓'), msg),
|
|
24
30
|
error: (msg) => console.log(chalk.red('✗'), msg),
|
|
@@ -391,6 +397,17 @@ async function installTribeCli() {
|
|
|
391
397
|
const spinner = ora('Installing TRIBE CLI...').start();
|
|
392
398
|
|
|
393
399
|
try {
|
|
400
|
+
const tribeDest = path.join(binDir, 'tribe');
|
|
401
|
+
|
|
402
|
+
// First check if we have a bundled binary
|
|
403
|
+
const bundledBinary = path.join(__dirname, 'tribe');
|
|
404
|
+
if (fs.existsSync(bundledBinary)) {
|
|
405
|
+
fs.copyFileSync(bundledBinary, tribeDest);
|
|
406
|
+
fs.chmodSync(tribeDest, '755');
|
|
407
|
+
spinner.succeed('TRIBE CLI installed from bundled binary');
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
|
|
394
411
|
// Check if we have local source
|
|
395
412
|
const sourceFile = path.join(__dirname, 'cluster-cli.go');
|
|
396
413
|
if (fs.existsSync(sourceFile)) {
|
|
@@ -398,7 +415,6 @@ async function installTribeCli() {
|
|
|
398
415
|
try {
|
|
399
416
|
execSync('go version', { stdio: 'ignore' });
|
|
400
417
|
execSync(`cd ${__dirname} && go build -o tribe cluster-cli.go client.go`);
|
|
401
|
-
const tribeDest = path.join(binDir, 'tribe');
|
|
402
418
|
fs.copyFileSync(path.join(__dirname, 'tribe'), tribeDest);
|
|
403
419
|
fs.chmodSync(tribeDest, '755');
|
|
404
420
|
spinner.succeed('TRIBE CLI built from source');
|
|
@@ -408,9 +424,8 @@ async function installTribeCli() {
|
|
|
408
424
|
}
|
|
409
425
|
}
|
|
410
426
|
|
|
411
|
-
// Try pre-built binary
|
|
427
|
+
// Try pre-built binary from GitHub
|
|
412
428
|
const tribeUrl = `https://github.com/0zen/0zen/releases/latest/download/tribe-${platform}-${arch}`;
|
|
413
|
-
const tribeDest = path.join(binDir, 'tribe');
|
|
414
429
|
|
|
415
430
|
try {
|
|
416
431
|
await downloadFile(tribeUrl, tribeDest);
|
|
@@ -418,14 +433,23 @@ async function installTribeCli() {
|
|
|
418
433
|
spinner.succeed('TRIBE CLI installed');
|
|
419
434
|
return true;
|
|
420
435
|
} catch {
|
|
421
|
-
// Fallback:
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
436
|
+
// Fallback: look for any existing tribe binary
|
|
437
|
+
const possiblePaths = [
|
|
438
|
+
path.join(__dirname, '..', 'tribe-cli'),
|
|
439
|
+
path.join(__dirname, '..', 'tribe'),
|
|
440
|
+
'./tribe-cli',
|
|
441
|
+
'./tribe'
|
|
442
|
+
];
|
|
443
|
+
|
|
444
|
+
for (const possiblePath of possiblePaths) {
|
|
445
|
+
if (fs.existsSync(possiblePath)) {
|
|
446
|
+
fs.copyFileSync(possiblePath, tribeDest);
|
|
447
|
+
fs.chmodSync(tribeDest, '755');
|
|
448
|
+
spinner.succeed('TRIBE CLI installed from local binary');
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
428
451
|
}
|
|
452
|
+
|
|
429
453
|
throw new Error('No TRIBE CLI binary available');
|
|
430
454
|
}
|
|
431
455
|
} catch (error) {
|
|
@@ -450,11 +474,11 @@ async function startContainerRuntime() {
|
|
|
450
474
|
const spinner = ora('Starting Colima container runtime...').start();
|
|
451
475
|
|
|
452
476
|
try {
|
|
453
|
-
// Strategy 1: Quick start with minimal resources
|
|
454
|
-
spinner.text = 'Starting Colima
|
|
455
|
-
execSync('colima start --cpu
|
|
477
|
+
// Strategy 1: Quick start with minimal resources and Kubernetes
|
|
478
|
+
spinner.text = 'Starting Colima with Kubernetes...';
|
|
479
|
+
execSync('colima start --cpu 2 --memory 4 --disk 10 --kubernetes --vm-type=vz', {
|
|
456
480
|
stdio: 'pipe',
|
|
457
|
-
timeout:
|
|
481
|
+
timeout: 60000 // 60 second timeout for K8s
|
|
458
482
|
});
|
|
459
483
|
|
|
460
484
|
// Test if it worked
|
|
@@ -463,10 +487,10 @@ async function startContainerRuntime() {
|
|
|
463
487
|
return true;
|
|
464
488
|
|
|
465
489
|
} catch (error) {
|
|
466
|
-
// Strategy 2: Start in background
|
|
490
|
+
// Strategy 2: Start in background with Kubernetes
|
|
467
491
|
try {
|
|
468
|
-
spinner.text = 'Starting Colima in background...';
|
|
469
|
-
const child = spawn(path.join(binDir, 'colima'), ['start', '--cpu', '2', '--memory', '4'], {
|
|
492
|
+
spinner.text = 'Starting Colima with Kubernetes in background...';
|
|
493
|
+
const child = spawn(path.join(binDir, 'colima'), ['start', '--cpu', '2', '--memory', '4', '--disk', '10', '--kubernetes'], {
|
|
470
494
|
detached: true,
|
|
471
495
|
stdio: 'ignore',
|
|
472
496
|
env: { ...process.env, PATH: `${binDir}:${process.env.PATH}` }
|
|
@@ -528,7 +552,7 @@ async function updatePath() {
|
|
|
528
552
|
async function verifyInstallation() {
|
|
529
553
|
const spinner = ora('Verifying installation...').start();
|
|
530
554
|
|
|
531
|
-
const tools = ['docker', '
|
|
555
|
+
const tools = ['docker', 'kubectl', 'tribe', 'colima'];
|
|
532
556
|
const results = {};
|
|
533
557
|
|
|
534
558
|
for (const tool of tools) {
|
|
@@ -565,6 +589,133 @@ async function verifyInstallation() {
|
|
|
565
589
|
return Object.values(results).every(r => r) && containerWorking;
|
|
566
590
|
}
|
|
567
591
|
|
|
592
|
+
async function checkClusterExists() {
|
|
593
|
+
try {
|
|
594
|
+
// Check if TRIBE namespace exists in any context
|
|
595
|
+
execSync('kubectl get namespace tribe-system', { stdio: 'ignore' });
|
|
596
|
+
return true;
|
|
597
|
+
} catch {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
async function checkColimaRunning() {
|
|
603
|
+
try {
|
|
604
|
+
execSync('colima status', { stdio: 'ignore' });
|
|
605
|
+
return true;
|
|
606
|
+
} catch {
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
async function startColimaWithKubernetes() {
|
|
612
|
+
const spinner = ora('Starting Colima with Kubernetes...').start();
|
|
613
|
+
|
|
614
|
+
try {
|
|
615
|
+
// Check if already running
|
|
616
|
+
if (await checkColimaRunning()) {
|
|
617
|
+
spinner.succeed('Colima is already running');
|
|
618
|
+
return true;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// Start Colima with Kubernetes enabled
|
|
622
|
+
spinner.text = 'Starting Colima (this may take a few minutes on first run)...';
|
|
623
|
+
execSync('colima start --kubernetes --cpu 4 --memory 8 --disk 20', {
|
|
624
|
+
stdio: 'pipe',
|
|
625
|
+
env: { ...process.env, PATH: `${binDir}:${process.env.PATH}` }
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
// Verify it's working
|
|
629
|
+
execSync('kubectl version --client', { stdio: 'ignore' });
|
|
630
|
+
spinner.succeed('Colima started with Kubernetes');
|
|
631
|
+
return true;
|
|
632
|
+
} catch (error) {
|
|
633
|
+
spinner.fail('Failed to start Colima with Kubernetes');
|
|
634
|
+
log.error(error.message);
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
async function deployTribeCluster() {
|
|
640
|
+
const spinner = ora('Deploying TRIBE cluster...').start();
|
|
641
|
+
|
|
642
|
+
try {
|
|
643
|
+
// Create a marker file to indicate first-run deployment
|
|
644
|
+
const deploymentMarker = path.join(tribeDir, '.cluster-deployed');
|
|
645
|
+
|
|
646
|
+
// Check if we've already deployed
|
|
647
|
+
if (fs.existsSync(deploymentMarker)) {
|
|
648
|
+
// Check if cluster actually exists
|
|
649
|
+
if (await checkClusterExists()) {
|
|
650
|
+
spinner.succeed('TRIBE cluster already deployed');
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
// Marker exists but cluster doesn't - remove marker and redeploy
|
|
654
|
+
fs.unlinkSync(deploymentMarker);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Copy deployment YAML to .tribe directory
|
|
658
|
+
const sourceYaml = path.join(__dirname, 'tribe-deployment.yaml');
|
|
659
|
+
const destYaml = path.join(tribeDir, 'tribe-deployment.yaml');
|
|
660
|
+
|
|
661
|
+
if (fs.existsSync(sourceYaml)) {
|
|
662
|
+
fs.copyFileSync(sourceYaml, destYaml);
|
|
663
|
+
log.info('Copied deployment configuration');
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// Run tribe start command with deployment YAML path
|
|
667
|
+
spinner.text = 'Running TRIBE cluster deployment...';
|
|
668
|
+
const tribePath = path.join(binDir, 'tribe');
|
|
669
|
+
|
|
670
|
+
// Set environment variable for the deployment YAML location
|
|
671
|
+
const env = {
|
|
672
|
+
...process.env,
|
|
673
|
+
PATH: `${binDir}:${process.env.PATH}`,
|
|
674
|
+
TRIBE_DEPLOYMENT_YAML: destYaml
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
// Execute tribe start
|
|
678
|
+
execSync(`${tribePath} start`, {
|
|
679
|
+
stdio: 'pipe',
|
|
680
|
+
env: env
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
// Create marker file
|
|
684
|
+
fs.writeFileSync(deploymentMarker, new Date().toISOString());
|
|
685
|
+
|
|
686
|
+
spinner.succeed('TRIBE cluster deployed successfully');
|
|
687
|
+
return true;
|
|
688
|
+
} catch (error) {
|
|
689
|
+
spinner.fail('Failed to deploy TRIBE cluster');
|
|
690
|
+
log.error(error.message);
|
|
691
|
+
log.info('You can manually deploy later with: tribe start');
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
async function promptForClusterSetup() {
|
|
697
|
+
// Simple prompt without external dependencies
|
|
698
|
+
return new Promise((resolve) => {
|
|
699
|
+
console.log('\n' + chalk.bold('🚀 TRIBE Cluster Setup'));
|
|
700
|
+
console.log('\nWould you like to set up the TRIBE cluster now?');
|
|
701
|
+
console.log('This will:');
|
|
702
|
+
console.log(' • Start Colima with Kubernetes');
|
|
703
|
+
console.log(' • Deploy all TRIBE services');
|
|
704
|
+
console.log(' • Set up port forwarding');
|
|
705
|
+
console.log('\n' + chalk.yellow('Note: This requires ~2GB disk space and may take a few minutes'));
|
|
706
|
+
|
|
707
|
+
process.stdout.write('\nSet up now? [Y/n]: ');
|
|
708
|
+
|
|
709
|
+
process.stdin.resume();
|
|
710
|
+
process.stdin.setEncoding('utf8');
|
|
711
|
+
process.stdin.once('data', (data) => {
|
|
712
|
+
process.stdin.pause();
|
|
713
|
+
const answer = data.toString().trim().toLowerCase();
|
|
714
|
+
resolve(answer === '' || answer === 'y' || answer === 'yes');
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
|
|
568
719
|
async function main() {
|
|
569
720
|
console.log(chalk.bold.blue('\n🚀 TRIBE CLI Complete Installer\n'));
|
|
570
721
|
|
|
@@ -575,10 +726,7 @@ async function main() {
|
|
|
575
726
|
await updatePath();
|
|
576
727
|
|
|
577
728
|
const tasks = [
|
|
578
|
-
{ name: 'Docker CLI', fn: installDocker },
|
|
579
729
|
{ name: 'Colima', fn: installColima },
|
|
580
|
-
{ name: 'Lima', fn: installLima },
|
|
581
|
-
{ name: 'KIND', fn: installKind },
|
|
582
730
|
{ name: 'kubectl', fn: installKubectl },
|
|
583
731
|
{ name: 'TRIBE CLI', fn: installTribeCli }
|
|
584
732
|
];
|
|
@@ -597,17 +745,60 @@ async function main() {
|
|
|
597
745
|
// Verify everything
|
|
598
746
|
const verified = await verifyInstallation();
|
|
599
747
|
|
|
600
|
-
console.log('\n' + chalk.bold('Next Steps:'));
|
|
601
748
|
if (verified) {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
749
|
+
// Check if cluster already exists
|
|
750
|
+
const clusterExists = await checkClusterExists();
|
|
751
|
+
|
|
752
|
+
if (!clusterExists) {
|
|
753
|
+
// Prompt for cluster setup
|
|
754
|
+
const shouldSetup = await promptForClusterSetup();
|
|
755
|
+
|
|
756
|
+
if (shouldSetup) {
|
|
757
|
+
console.log('');
|
|
758
|
+
|
|
759
|
+
// Start Colima with Kubernetes if on macOS
|
|
760
|
+
if (platform === 'darwin') {
|
|
761
|
+
const colimaStarted = await startColimaWithKubernetes();
|
|
762
|
+
if (!colimaStarted) {
|
|
763
|
+
log.error('Failed to start Colima. Please run manually:');
|
|
764
|
+
console.log(' colima start --kubernetes');
|
|
765
|
+
console.log(' tribe start');
|
|
766
|
+
process.exit(1);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Deploy TRIBE cluster
|
|
771
|
+
const deployed = await deployTribeCluster();
|
|
772
|
+
|
|
773
|
+
if (deployed) {
|
|
774
|
+
console.log('\n' + chalk.bold.green('✨ TRIBE is ready!'));
|
|
775
|
+
console.log('');
|
|
776
|
+
log.info('Quick start:');
|
|
777
|
+
console.log(' tribe # Launch interactive CLI');
|
|
778
|
+
console.log(' tribe status # Check cluster status');
|
|
779
|
+
console.log(' tribe create-task # Create a new task');
|
|
780
|
+
console.log('');
|
|
781
|
+
log.info('First time? The CLI will guide you through creating your first project!');
|
|
782
|
+
} else {
|
|
783
|
+
log.warning('Cluster deployment failed, but you can try manually:');
|
|
784
|
+
console.log(' tribe start');
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
console.log('\n' + chalk.bold('Setup Complete!'));
|
|
788
|
+
log.info('You can set up the cluster later with:');
|
|
789
|
+
console.log(' tribe start');
|
|
790
|
+
}
|
|
791
|
+
} else {
|
|
792
|
+
console.log('\n' + chalk.bold.green('✨ TRIBE is ready!'));
|
|
793
|
+
log.success('Cluster is already running');
|
|
794
|
+
console.log('');
|
|
795
|
+
log.info('Commands:');
|
|
796
|
+
console.log(' tribe # Launch interactive CLI');
|
|
797
|
+
console.log(' tribe status # Check status');
|
|
798
|
+
console.log(' tribe create-task # Create a new task');
|
|
799
|
+
}
|
|
610
800
|
} else {
|
|
801
|
+
console.log('\n' + chalk.bold('Next Steps:'));
|
|
611
802
|
log.warning('Some components need attention:');
|
|
612
803
|
console.log('');
|
|
613
804
|
// Check container runtime for guidance
|
|
@@ -626,6 +817,7 @@ async function main() {
|
|
|
626
817
|
}
|
|
627
818
|
console.log('');
|
|
628
819
|
log.info('Restart your shell or run: source ~/.zshrc');
|
|
820
|
+
log.info('Then run: tribe start');
|
|
629
821
|
}
|
|
630
822
|
}
|
|
631
823
|
|
|
@@ -644,9 +836,8 @@ if (require.main === module) {
|
|
|
644
836
|
console.log(' --help, -h Show this help message');
|
|
645
837
|
console.log(' --verify Only verify existing installation');
|
|
646
838
|
console.log(' --dry-run Show what would be installed');
|
|
647
|
-
|
|
648
|
-
console.log('•
|
|
649
|
-
console.log('• KIND (Kubernetes in Docker)');
|
|
839
|
+
console.log('\nThis installer sets up the complete TRIBE development environment:');
|
|
840
|
+
console.log('• Colima (Container runtime with Kubernetes)');
|
|
650
841
|
console.log('• kubectl (Kubernetes CLI)');
|
|
651
842
|
console.log('• TRIBE CLI (Multi-agent orchestration)');
|
|
652
843
|
console.log('\nAfter installation:');
|
|
@@ -671,7 +862,7 @@ if (require.main === module) {
|
|
|
671
862
|
console.log('• Docker CLI (if not present)');
|
|
672
863
|
console.log('• Colima container runtime (macOS only)');
|
|
673
864
|
console.log('• Lima virtualization (macOS only)');
|
|
674
|
-
|
|
865
|
+
console.log('• Colima - Container runtime with Kubernetes');
|
|
675
866
|
console.log('• kubectl - Kubernetes CLI');
|
|
676
867
|
console.log('• TRIBE CLI - Multi-agent system');
|
|
677
868
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_xtribe/cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
4
|
-
"description": "TRIBE multi-agent development system
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
|
+
"description": "TRIBE multi-agent development system - Zero to productive with one command",
|
|
5
5
|
"main": "install-tribe.js",
|
|
6
|
-
"bin":
|
|
6
|
+
"bin": {
|
|
7
|
+
"tribe": "install-tribe.js"
|
|
8
|
+
},
|
|
7
9
|
"scripts": {
|
|
8
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
11
|
},
|
|
@@ -15,7 +17,9 @@
|
|
|
15
17
|
"colima",
|
|
16
18
|
"multi-agent",
|
|
17
19
|
"ai",
|
|
18
|
-
"development"
|
|
20
|
+
"development",
|
|
21
|
+
"autonomous",
|
|
22
|
+
"agents"
|
|
19
23
|
],
|
|
20
24
|
"engines": {
|
|
21
25
|
"node": ">=16.0.0"
|
|
@@ -32,6 +36,7 @@
|
|
|
32
36
|
"files": [
|
|
33
37
|
"install-tribe.js",
|
|
34
38
|
"lima-guestagent.Linux-aarch64.gz",
|
|
39
|
+
"tribe-deployment.yaml",
|
|
35
40
|
"tribe",
|
|
36
41
|
"README.md",
|
|
37
42
|
"package.json"
|
|
@@ -45,7 +50,7 @@
|
|
|
45
50
|
},
|
|
46
51
|
"repository": {
|
|
47
52
|
"type": "git",
|
|
48
|
-
"url": "https://github.com/0zen/0zen.git"
|
|
53
|
+
"url": "git+https://github.com/0zen/0zen.git"
|
|
49
54
|
},
|
|
50
55
|
"author": "0zen",
|
|
51
56
|
"license": "MIT",
|
|
@@ -53,4 +58,4 @@
|
|
|
53
58
|
"bugs": {
|
|
54
59
|
"url": "https://github.com/0zen/0zen/issues"
|
|
55
60
|
}
|
|
56
|
-
}
|
|
61
|
+
}
|
package/tribe
CHANGED
|
Binary file
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
---
|
|
2
|
+
# TRIBE Complete Deployment - Bundled with NPM Package
|
|
3
|
+
# This file is automatically deployed by 'npx @_xtribe/cli'
|
|
4
|
+
---
|
|
5
|
+
apiVersion: v1
|
|
6
|
+
kind: Namespace
|
|
7
|
+
metadata:
|
|
8
|
+
name: tribe-system
|
|
9
|
+
---
|
|
10
|
+
# ServiceAccount for Bridge
|
|
11
|
+
apiVersion: v1
|
|
12
|
+
kind: ServiceAccount
|
|
13
|
+
metadata:
|
|
14
|
+
name: bridge
|
|
15
|
+
namespace: tribe-system
|
|
16
|
+
---
|
|
17
|
+
# Role for Bridge
|
|
18
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
19
|
+
kind: Role
|
|
20
|
+
metadata:
|
|
21
|
+
name: bridge-role
|
|
22
|
+
namespace: tribe-system
|
|
23
|
+
rules:
|
|
24
|
+
- apiGroups: [""]
|
|
25
|
+
resources: ["pods", "services", "pods/exec", "pods/log", "configmaps", "secrets", "namespaces"]
|
|
26
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
27
|
+
- apiGroups: ["apps"]
|
|
28
|
+
resources: ["deployments", "replicasets"]
|
|
29
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
30
|
+
- apiGroups: ["batch"]
|
|
31
|
+
resources: ["jobs"]
|
|
32
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
33
|
+
---
|
|
34
|
+
# RoleBinding for Bridge
|
|
35
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
36
|
+
kind: RoleBinding
|
|
37
|
+
metadata:
|
|
38
|
+
name: bridge-rolebinding
|
|
39
|
+
namespace: tribe-system
|
|
40
|
+
subjects:
|
|
41
|
+
- kind: ServiceAccount
|
|
42
|
+
name: bridge
|
|
43
|
+
namespace: tribe-system
|
|
44
|
+
roleRef:
|
|
45
|
+
kind: Role
|
|
46
|
+
name: bridge-role
|
|
47
|
+
apiGroup: rbac.authorization.k8s.io
|
|
48
|
+
---
|
|
49
|
+
# PostgreSQL
|
|
50
|
+
apiVersion: apps/v1
|
|
51
|
+
kind: Deployment
|
|
52
|
+
metadata:
|
|
53
|
+
name: postgres
|
|
54
|
+
namespace: tribe-system
|
|
55
|
+
spec:
|
|
56
|
+
replicas: 1
|
|
57
|
+
selector:
|
|
58
|
+
matchLabels:
|
|
59
|
+
app: postgres
|
|
60
|
+
template:
|
|
61
|
+
metadata:
|
|
62
|
+
labels:
|
|
63
|
+
app: postgres
|
|
64
|
+
spec:
|
|
65
|
+
containers:
|
|
66
|
+
- name: postgres
|
|
67
|
+
image: postgres:15
|
|
68
|
+
env:
|
|
69
|
+
- name: POSTGRES_DB
|
|
70
|
+
value: gitea
|
|
71
|
+
- name: POSTGRES_USER
|
|
72
|
+
value: gitea
|
|
73
|
+
- name: POSTGRES_PASSWORD
|
|
74
|
+
value: gitea
|
|
75
|
+
ports:
|
|
76
|
+
- containerPort: 5432
|
|
77
|
+
readinessProbe:
|
|
78
|
+
exec:
|
|
79
|
+
command:
|
|
80
|
+
- pg_isready
|
|
81
|
+
- -U
|
|
82
|
+
- gitea
|
|
83
|
+
initialDelaySeconds: 5
|
|
84
|
+
periodSeconds: 5
|
|
85
|
+
---
|
|
86
|
+
apiVersion: v1
|
|
87
|
+
kind: Service
|
|
88
|
+
metadata:
|
|
89
|
+
name: postgres
|
|
90
|
+
namespace: tribe-system
|
|
91
|
+
spec:
|
|
92
|
+
selector:
|
|
93
|
+
app: postgres
|
|
94
|
+
ports:
|
|
95
|
+
- port: 5432
|
|
96
|
+
---
|
|
97
|
+
# Gitea
|
|
98
|
+
apiVersion: apps/v1
|
|
99
|
+
kind: Deployment
|
|
100
|
+
metadata:
|
|
101
|
+
name: gitea
|
|
102
|
+
namespace: tribe-system
|
|
103
|
+
spec:
|
|
104
|
+
replicas: 1
|
|
105
|
+
selector:
|
|
106
|
+
matchLabels:
|
|
107
|
+
app: gitea
|
|
108
|
+
template:
|
|
109
|
+
metadata:
|
|
110
|
+
labels:
|
|
111
|
+
app: gitea
|
|
112
|
+
spec:
|
|
113
|
+
initContainers:
|
|
114
|
+
- name: wait-for-db
|
|
115
|
+
image: busybox:1.35
|
|
116
|
+
command: ['sh', '-c', 'until nc -z postgres 5432; do echo waiting for db; sleep 2; done']
|
|
117
|
+
- name: init-gitea
|
|
118
|
+
image: gitea/gitea:1.20.5
|
|
119
|
+
command: ['/bin/bash', '-c']
|
|
120
|
+
args:
|
|
121
|
+
- |
|
|
122
|
+
# Create app.ini
|
|
123
|
+
mkdir -p /data/gitea/conf
|
|
124
|
+
cat > /data/gitea/conf/app.ini << 'EOF'
|
|
125
|
+
APP_NAME = Gitea
|
|
126
|
+
RUN_MODE = prod
|
|
127
|
+
|
|
128
|
+
[database]
|
|
129
|
+
DB_TYPE = postgres
|
|
130
|
+
HOST = postgres:5432
|
|
131
|
+
NAME = gitea
|
|
132
|
+
USER = gitea
|
|
133
|
+
PASSWD = gitea
|
|
134
|
+
|
|
135
|
+
[server]
|
|
136
|
+
DOMAIN = gitea
|
|
137
|
+
ROOT_URL = http://gitea:3000/
|
|
138
|
+
HTTP_PORT = 3000
|
|
139
|
+
|
|
140
|
+
[service]
|
|
141
|
+
DISABLE_REGISTRATION = true
|
|
142
|
+
|
|
143
|
+
[security]
|
|
144
|
+
INSTALL_LOCK = true
|
|
145
|
+
SECRET_KEY = changeme
|
|
146
|
+
EOF
|
|
147
|
+
|
|
148
|
+
# Run migrations
|
|
149
|
+
gitea migrate
|
|
150
|
+
|
|
151
|
+
# Create admin user
|
|
152
|
+
gitea admin user create --admin --username gitea_admin --password admin123 --email admin@example.com || true
|
|
153
|
+
env:
|
|
154
|
+
- name: GITEA_WORK_DIR
|
|
155
|
+
value: /data
|
|
156
|
+
- name: GITEA_CUSTOM
|
|
157
|
+
value: /data/gitea
|
|
158
|
+
volumeMounts:
|
|
159
|
+
- name: gitea-data
|
|
160
|
+
mountPath: /data
|
|
161
|
+
containers:
|
|
162
|
+
- name: gitea
|
|
163
|
+
image: gitea/gitea:1.20.5
|
|
164
|
+
ports:
|
|
165
|
+
- containerPort: 3000
|
|
166
|
+
env:
|
|
167
|
+
- name: GITEA_WORK_DIR
|
|
168
|
+
value: /data
|
|
169
|
+
- name: GITEA_CUSTOM
|
|
170
|
+
value: /data/gitea
|
|
171
|
+
volumeMounts:
|
|
172
|
+
- name: gitea-data
|
|
173
|
+
mountPath: /data
|
|
174
|
+
readinessProbe:
|
|
175
|
+
httpGet:
|
|
176
|
+
path: /
|
|
177
|
+
port: 3000
|
|
178
|
+
initialDelaySeconds: 30
|
|
179
|
+
periodSeconds: 10
|
|
180
|
+
volumes:
|
|
181
|
+
- name: gitea-data
|
|
182
|
+
emptyDir: {}
|
|
183
|
+
---
|
|
184
|
+
apiVersion: v1
|
|
185
|
+
kind: Service
|
|
186
|
+
metadata:
|
|
187
|
+
name: gitea
|
|
188
|
+
namespace: tribe-system
|
|
189
|
+
spec:
|
|
190
|
+
selector:
|
|
191
|
+
app: gitea
|
|
192
|
+
ports:
|
|
193
|
+
- port: 3000
|
|
194
|
+
---
|
|
195
|
+
# TaskMaster
|
|
196
|
+
apiVersion: apps/v1
|
|
197
|
+
kind: Deployment
|
|
198
|
+
metadata:
|
|
199
|
+
name: taskmaster
|
|
200
|
+
namespace: tribe-system
|
|
201
|
+
spec:
|
|
202
|
+
replicas: 1
|
|
203
|
+
selector:
|
|
204
|
+
matchLabels:
|
|
205
|
+
app: taskmaster
|
|
206
|
+
template:
|
|
207
|
+
metadata:
|
|
208
|
+
labels:
|
|
209
|
+
app: taskmaster
|
|
210
|
+
spec:
|
|
211
|
+
initContainers:
|
|
212
|
+
- name: wait-for-db
|
|
213
|
+
image: busybox:1.35
|
|
214
|
+
command: ['sh', '-c', 'until nc -z postgres 5432; do echo waiting for db; sleep 2; done']
|
|
215
|
+
containers:
|
|
216
|
+
- name: taskmaster
|
|
217
|
+
image: taskmaster:latest
|
|
218
|
+
imagePullPolicy: IfNotPresent
|
|
219
|
+
ports:
|
|
220
|
+
- containerPort: 5000
|
|
221
|
+
env:
|
|
222
|
+
- name: FLASK_ENV
|
|
223
|
+
value: development
|
|
224
|
+
- name: DATABASE_URL
|
|
225
|
+
value: postgresql://gitea:gitea@postgres:5432/gitea
|
|
226
|
+
- name: GITEA_URL
|
|
227
|
+
value: http://gitea:3000
|
|
228
|
+
- name: GITEA_TOKEN
|
|
229
|
+
value: will-be-set-by-init-job
|
|
230
|
+
readinessProbe:
|
|
231
|
+
httpGet:
|
|
232
|
+
path: /
|
|
233
|
+
port: 5000
|
|
234
|
+
initialDelaySeconds: 10
|
|
235
|
+
periodSeconds: 5
|
|
236
|
+
---
|
|
237
|
+
apiVersion: v1
|
|
238
|
+
kind: Service
|
|
239
|
+
metadata:
|
|
240
|
+
name: taskmaster
|
|
241
|
+
namespace: tribe-system
|
|
242
|
+
spec:
|
|
243
|
+
selector:
|
|
244
|
+
app: taskmaster
|
|
245
|
+
ports:
|
|
246
|
+
- port: 5000
|
|
247
|
+
---
|
|
248
|
+
# Bridge
|
|
249
|
+
apiVersion: apps/v1
|
|
250
|
+
kind: Deployment
|
|
251
|
+
metadata:
|
|
252
|
+
name: bridge
|
|
253
|
+
namespace: tribe-system
|
|
254
|
+
spec:
|
|
255
|
+
replicas: 1
|
|
256
|
+
selector:
|
|
257
|
+
matchLabels:
|
|
258
|
+
app: bridge
|
|
259
|
+
template:
|
|
260
|
+
metadata:
|
|
261
|
+
labels:
|
|
262
|
+
app: bridge
|
|
263
|
+
spec:
|
|
264
|
+
serviceAccountName: bridge
|
|
265
|
+
initContainers:
|
|
266
|
+
- name: wait-for-services
|
|
267
|
+
image: busybox:1.35
|
|
268
|
+
command: ['sh', '-c']
|
|
269
|
+
args:
|
|
270
|
+
- |
|
|
271
|
+
echo "Waiting for services..."
|
|
272
|
+
until nc -z taskmaster 5000; do echo waiting for taskmaster; sleep 2; done
|
|
273
|
+
until nc -z gitea 3000; do echo waiting for gitea; sleep 2; done
|
|
274
|
+
echo "All services ready!"
|
|
275
|
+
containers:
|
|
276
|
+
- name: bridge
|
|
277
|
+
image: bridge:latest
|
|
278
|
+
imagePullPolicy: IfNotPresent
|
|
279
|
+
ports:
|
|
280
|
+
- containerPort: 8080
|
|
281
|
+
- containerPort: 3456
|
|
282
|
+
env:
|
|
283
|
+
- name: TASKMASTER_URL
|
|
284
|
+
value: http://taskmaster:5000
|
|
285
|
+
- name: GITEA_URL
|
|
286
|
+
value: http://gitea:3000
|
|
287
|
+
- name: GITEA_ADMIN_USER
|
|
288
|
+
value: gitea_admin
|
|
289
|
+
- name: GITEA_ADMIN_PASSWORD
|
|
290
|
+
value: admin123
|
|
291
|
+
- name: NAMESPACE
|
|
292
|
+
value: tribe-system
|
|
293
|
+
readinessProbe:
|
|
294
|
+
httpGet:
|
|
295
|
+
path: /health
|
|
296
|
+
port: 8080
|
|
297
|
+
initialDelaySeconds: 10
|
|
298
|
+
periodSeconds: 5
|
|
299
|
+
---
|
|
300
|
+
apiVersion: v1
|
|
301
|
+
kind: Service
|
|
302
|
+
metadata:
|
|
303
|
+
name: bridge
|
|
304
|
+
namespace: tribe-system
|
|
305
|
+
spec:
|
|
306
|
+
selector:
|
|
307
|
+
app: bridge
|
|
308
|
+
ports:
|
|
309
|
+
- name: http
|
|
310
|
+
port: 8080
|
|
311
|
+
- name: websocket
|
|
312
|
+
port: 3456
|
|
313
|
+
---
|
|
314
|
+
# Claude Worker Deployment (starts with 0 replicas)
|
|
315
|
+
apiVersion: apps/v1
|
|
316
|
+
kind: Deployment
|
|
317
|
+
metadata:
|
|
318
|
+
name: claude-worker-deployment
|
|
319
|
+
namespace: tribe-system
|
|
320
|
+
spec:
|
|
321
|
+
replicas: 0
|
|
322
|
+
selector:
|
|
323
|
+
matchLabels:
|
|
324
|
+
app: claude-worker
|
|
325
|
+
template:
|
|
326
|
+
metadata:
|
|
327
|
+
labels:
|
|
328
|
+
app: claude-worker
|
|
329
|
+
spec:
|
|
330
|
+
containers:
|
|
331
|
+
- name: claude-agent
|
|
332
|
+
image: claude-agent:latest
|
|
333
|
+
imagePullPolicy: IfNotPresent
|
|
334
|
+
env:
|
|
335
|
+
- name: ROLE
|
|
336
|
+
value: worker
|
|
337
|
+
- name: TASKMASTER_URL
|
|
338
|
+
value: http://taskmaster:5000
|
|
339
|
+
- name: GITEA_URL
|
|
340
|
+
value: http://gitea:3000
|
|
341
|
+
- name: NAMESPACE
|
|
342
|
+
value: tribe-system
|
|
343
|
+
- name: ANTHROPIC_API_KEY
|
|
344
|
+
valueFrom:
|
|
345
|
+
secretKeyRef:
|
|
346
|
+
name: claude-api-key
|
|
347
|
+
key: api-key
|
|
348
|
+
optional: true
|
|
349
|
+
volumeMounts:
|
|
350
|
+
- name: workspace
|
|
351
|
+
mountPath: /workspace
|
|
352
|
+
- name: config
|
|
353
|
+
mountPath: /app/minimal-config
|
|
354
|
+
readinessProbe:
|
|
355
|
+
exec:
|
|
356
|
+
command:
|
|
357
|
+
- /bin/sh
|
|
358
|
+
- -c
|
|
359
|
+
- test -f /tmp/worker-ready
|
|
360
|
+
initialDelaySeconds: 30
|
|
361
|
+
periodSeconds: 10
|
|
362
|
+
volumes:
|
|
363
|
+
- name: workspace
|
|
364
|
+
emptyDir: {}
|
|
365
|
+
- name: config
|
|
366
|
+
configMap:
|
|
367
|
+
name: claude-config
|
|
368
|
+
optional: true
|
|
369
|
+
---
|
|
370
|
+
# NodePort service for easy access
|
|
371
|
+
apiVersion: v1
|
|
372
|
+
kind: Service
|
|
373
|
+
metadata:
|
|
374
|
+
name: bridge-nodeport
|
|
375
|
+
namespace: tribe-system
|
|
376
|
+
spec:
|
|
377
|
+
type: NodePort
|
|
378
|
+
selector:
|
|
379
|
+
app: bridge
|
|
380
|
+
ports:
|
|
381
|
+
- name: http
|
|
382
|
+
port: 8080
|
|
383
|
+
nodePort: 30080
|
|
384
|
+
- name: websocket
|
|
385
|
+
port: 3456
|
|
386
|
+
nodePort: 30456
|
|
387
|
+
---
|
|
388
|
+
# ConfigMap for Claude agent configuration
|
|
389
|
+
apiVersion: v1
|
|
390
|
+
kind: ConfigMap
|
|
391
|
+
metadata:
|
|
392
|
+
name: claude-config
|
|
393
|
+
namespace: tribe-system
|
|
394
|
+
data:
|
|
395
|
+
config.yaml: |
|
|
396
|
+
mcp_servers:
|
|
397
|
+
filesystem:
|
|
398
|
+
command: npx
|
|
399
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
|
|
400
|
+
git:
|
|
401
|
+
command: npx
|
|
402
|
+
args: ["-y", "@modelcontextprotocol/server-git"]
|
|
403
|
+
env:
|
|
404
|
+
PATH: /usr/local/bin:/usr/bin:/bin
|
|
405
|
+
---
|
|
406
|
+
# Initialization Job
|
|
407
|
+
apiVersion: batch/v1
|
|
408
|
+
kind: Job
|
|
409
|
+
metadata:
|
|
410
|
+
name: tribe-init
|
|
411
|
+
namespace: tribe-system
|
|
412
|
+
spec:
|
|
413
|
+
template:
|
|
414
|
+
spec:
|
|
415
|
+
restartPolicy: OnFailure
|
|
416
|
+
containers:
|
|
417
|
+
- name: init
|
|
418
|
+
image: curlimages/curl:8.4.0
|
|
419
|
+
command: ['/bin/sh', '-c']
|
|
420
|
+
args:
|
|
421
|
+
- |
|
|
422
|
+
echo "Waiting for Gitea to be ready..."
|
|
423
|
+
until curl -s http://gitea:3000 > /dev/null; do
|
|
424
|
+
echo "Waiting for Gitea..."
|
|
425
|
+
sleep 5
|
|
426
|
+
done
|
|
427
|
+
|
|
428
|
+
echo "Creating Gitea access token..."
|
|
429
|
+
TOKEN=$(curl -s -X POST http://gitea:3000/api/v1/users/gitea_admin/tokens \
|
|
430
|
+
-u gitea_admin:admin123 \
|
|
431
|
+
-H "Content-Type: application/json" \
|
|
432
|
+
-d '{"name":"taskmaster-'$(date +%s)'","scopes":["write:repository","write:user","write:issue","write:organization","read:repository"]}' \
|
|
433
|
+
| grep -o '"sha1":"[^"]*' | cut -d'"' -f4)
|
|
434
|
+
|
|
435
|
+
if [ -z "$TOKEN" ]; then
|
|
436
|
+
echo "Failed to create token!"
|
|
437
|
+
exit 1
|
|
438
|
+
fi
|
|
439
|
+
|
|
440
|
+
echo "Token created successfully"
|
|
441
|
+
|
|
442
|
+
# Update TaskMaster with the token
|
|
443
|
+
echo "Updating TaskMaster configuration..."
|
|
444
|
+
curl -X POST http://taskmaster:5000/api/config \
|
|
445
|
+
-H "Content-Type: application/json" \
|
|
446
|
+
-d "{\"gitea_token\":\"$TOKEN\"}"
|
|
447
|
+
|
|
448
|
+
echo "Initialization complete!"
|