@_xtribe/cli 1.0.53 → 1.0.55
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/install-tribe-minimal.js +34 -7
- package/install.sh +10 -1
- package/package.json +1 -1
- package/tribe-deployment.yaml +279 -27
- package/AUTOLAUNCH_IMPLEMENTATION.md +0 -168
- package/README.md +0 -146
package/install-tribe-minimal.js
CHANGED
|
@@ -104,20 +104,47 @@ async function installTribe() {
|
|
|
104
104
|
|
|
105
105
|
// Update PATH
|
|
106
106
|
function updatePath() {
|
|
107
|
+
// Create tribe-env.sh script
|
|
108
|
+
const tribeEnvPath = path.join(tribeDir, 'tribe-env.sh');
|
|
109
|
+
const envScriptContent = `#!/bin/bash
|
|
110
|
+
# TRIBE CLI Environment Setup
|
|
111
|
+
# Auto-generated by TRIBE installer
|
|
112
|
+
|
|
113
|
+
# Add TRIBE bin directory to PATH if not already present
|
|
114
|
+
TRIBE_BIN_DIR="$HOME/.tribe/bin"
|
|
115
|
+
|
|
116
|
+
if [[ -d "$TRIBE_BIN_DIR" ]] && [[ ":$PATH:" != *":$TRIBE_BIN_DIR:"* ]]; then
|
|
117
|
+
export PATH="$TRIBE_BIN_DIR:$PATH"
|
|
118
|
+
fi
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
fs.writeFileSync(tribeEnvPath, envScriptContent);
|
|
123
|
+
fs.chmodSync(tribeEnvPath, '755');
|
|
124
|
+
console.log('✓ Created tribe-env.sh environment script');
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.log(`⚠ Failed to create tribe-env.sh: ${error.message}`);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Update shell config
|
|
107
131
|
const shell = process.env.SHELL || '/bin/bash';
|
|
108
132
|
const rcFile = shell.includes('zsh') ? '.zshrc' : '.bashrc';
|
|
109
133
|
const rcPath = path.join(homeDir, rcFile);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
134
|
+
const sourceCommand = 'source ~/.tribe/tribe-env.sh';
|
|
135
|
+
|
|
113
136
|
try {
|
|
114
137
|
const rcContent = fs.existsSync(rcPath) ? fs.readFileSync(rcPath, 'utf8') : '';
|
|
115
|
-
if (!rcContent.includes(
|
|
116
|
-
fs.appendFileSync(rcPath, `\n#
|
|
117
|
-
console.log(`✓ Updated ${rcFile}
|
|
138
|
+
if (!rcContent.includes(sourceCommand)) {
|
|
139
|
+
fs.appendFileSync(rcPath, `\n# TRIBE CLI\n${sourceCommand}\n`);
|
|
140
|
+
console.log(`✓ Updated ${rcFile} to source tribe-env.sh`);
|
|
141
|
+
} else {
|
|
142
|
+
console.log(`✓ ${rcFile} already configured`);
|
|
118
143
|
}
|
|
119
144
|
} catch (error) {
|
|
120
|
-
console.
|
|
145
|
+
console.log(`⚠ Failed to update ${rcFile}: ${error.message}`);
|
|
146
|
+
console.log('Please manually add this line to your shell config:');
|
|
147
|
+
console.log(` ${sourceCommand}`);
|
|
121
148
|
}
|
|
122
149
|
}
|
|
123
150
|
|
package/install.sh
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
# TRIBE Quick Installer
|
|
3
3
|
# This script provides a one-command installation with immediate PATH access
|
|
4
4
|
|
|
5
|
+
# Source constants
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
source "$SCRIPT_DIR/../../../constants.sh" 2>/dev/null || true
|
|
8
|
+
|
|
9
|
+
# If constants not found, define locally
|
|
10
|
+
if [ -z "$TRIBE_INSTALL_COMMAND" ]; then
|
|
11
|
+
TRIBE_INSTALL_COMMAND="npx @_xtribe/cli"
|
|
12
|
+
fi
|
|
13
|
+
|
|
5
14
|
# Colors
|
|
6
15
|
RED='\033[0;31m'
|
|
7
16
|
GREEN='\033[0;32m'
|
|
@@ -14,7 +23,7 @@ echo ""
|
|
|
14
23
|
|
|
15
24
|
# Download and run the installer
|
|
16
25
|
echo "Installing TRIBE components..."
|
|
17
|
-
|
|
26
|
+
${TRIBE_INSTALL_COMMAND}@latest "$@"
|
|
18
27
|
|
|
19
28
|
# Check if installation was successful
|
|
20
29
|
if [ -f ~/.tribe/tribe-env.sh ]; then
|
package/package.json
CHANGED
package/tribe-deployment.yaml
CHANGED
|
@@ -37,6 +37,9 @@ rules:
|
|
|
37
37
|
- apiGroups: ["batch"]
|
|
38
38
|
resources: ["jobs"]
|
|
39
39
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
40
|
+
- apiGroups: ["rbac.authorization.k8s.io"]
|
|
41
|
+
resources: ["rolebindings"]
|
|
42
|
+
verbs: ["get", "list", "patch"]
|
|
40
43
|
---
|
|
41
44
|
# RoleBinding for Bridge
|
|
42
45
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
@@ -152,6 +155,15 @@ spec:
|
|
|
152
155
|
[security]
|
|
153
156
|
INSTALL_LOCK = true
|
|
154
157
|
SECRET_KEY = changeme
|
|
158
|
+
|
|
159
|
+
[oauth2]
|
|
160
|
+
ENABLE = false
|
|
161
|
+
|
|
162
|
+
[service]
|
|
163
|
+
DEFAULT_USER_IS_RESTRICTED = false
|
|
164
|
+
|
|
165
|
+
[repository]
|
|
166
|
+
DEFAULT_PRIVATE = false
|
|
155
167
|
EOF
|
|
156
168
|
|
|
157
169
|
# Fix permissions
|
|
@@ -199,7 +211,8 @@ spec:
|
|
|
199
211
|
- -c
|
|
200
212
|
- |
|
|
201
213
|
sleep 30
|
|
202
|
-
|
|
214
|
+
# Create admin user without password change requirement
|
|
215
|
+
su git -c 'gitea admin user create --admin --username gitea_admin --password admin123 --email admin@example.com --must-change-password=false' || true
|
|
203
216
|
volumes:
|
|
204
217
|
- name: gitea-data
|
|
205
218
|
emptyDir: {}
|
|
@@ -241,6 +254,13 @@ spec:
|
|
|
241
254
|
imagePullPolicy: IfNotPresent
|
|
242
255
|
ports:
|
|
243
256
|
- containerPort: 8080
|
|
257
|
+
resources:
|
|
258
|
+
requests:
|
|
259
|
+
memory: "256Mi"
|
|
260
|
+
cpu: "250m"
|
|
261
|
+
limits:
|
|
262
|
+
memory: "1Gi"
|
|
263
|
+
cpu: "1"
|
|
244
264
|
env:
|
|
245
265
|
- name: FLASK_ENV
|
|
246
266
|
value: development
|
|
@@ -298,11 +318,18 @@ spec:
|
|
|
298
318
|
echo "All services ready!"
|
|
299
319
|
containers:
|
|
300
320
|
- name: bridge
|
|
301
|
-
image:
|
|
321
|
+
image: bridge:latest
|
|
302
322
|
imagePullPolicy: IfNotPresent
|
|
303
323
|
ports:
|
|
304
324
|
- containerPort: 8080
|
|
305
325
|
- containerPort: 3456
|
|
326
|
+
resources:
|
|
327
|
+
requests:
|
|
328
|
+
memory: "256Mi"
|
|
329
|
+
cpu: "250m"
|
|
330
|
+
limits:
|
|
331
|
+
memory: "1Gi"
|
|
332
|
+
cpu: "1"
|
|
306
333
|
env:
|
|
307
334
|
- name: TASKMASTER_URL
|
|
308
335
|
value: http://taskmaster:5000
|
|
@@ -312,8 +339,15 @@ spec:
|
|
|
312
339
|
value: gitea_admin
|
|
313
340
|
- name: GITEA_ADMIN_PASSWORD
|
|
314
341
|
value: admin123
|
|
342
|
+
- name: GITEA_TOKEN
|
|
343
|
+
valueFrom:
|
|
344
|
+
secretKeyRef:
|
|
345
|
+
name: gitea-token
|
|
346
|
+
key: token
|
|
315
347
|
- name: NAMESPACE
|
|
316
348
|
value: tribe-system
|
|
349
|
+
- name: TARGET_NAMESPACE
|
|
350
|
+
value: tribe-system
|
|
317
351
|
readinessProbe:
|
|
318
352
|
httpGet:
|
|
319
353
|
path: /
|
|
@@ -342,7 +376,7 @@ metadata:
|
|
|
342
376
|
name: claude-worker-deployment
|
|
343
377
|
namespace: tribe-system
|
|
344
378
|
spec:
|
|
345
|
-
replicas:
|
|
379
|
+
replicas: 1 # Start with 1 worker (auto-scaling broken in Docker Hub bridge image)
|
|
346
380
|
selector:
|
|
347
381
|
matchLabels:
|
|
348
382
|
app: claude-worker
|
|
@@ -353,10 +387,18 @@ spec:
|
|
|
353
387
|
spec:
|
|
354
388
|
containers:
|
|
355
389
|
- name: claude-agent
|
|
356
|
-
image:
|
|
390
|
+
image: claude-agent:latest
|
|
357
391
|
imagePullPolicy: IfNotPresent
|
|
358
392
|
ports:
|
|
359
|
-
- containerPort:
|
|
393
|
+
- containerPort: 9090
|
|
394
|
+
name: metrics
|
|
395
|
+
resources:
|
|
396
|
+
requests:
|
|
397
|
+
memory: "512Mi"
|
|
398
|
+
cpu: "500m"
|
|
399
|
+
limits:
|
|
400
|
+
memory: "2Gi"
|
|
401
|
+
cpu: "2"
|
|
360
402
|
env:
|
|
361
403
|
- name: ROLE
|
|
362
404
|
value: worker
|
|
@@ -364,28 +406,41 @@ spec:
|
|
|
364
406
|
value: http://taskmaster:5000
|
|
365
407
|
- name: GITEA_URL
|
|
366
408
|
value: http://gitea:3000
|
|
409
|
+
- name: GITEA_USER
|
|
410
|
+
value: gitea_admin
|
|
411
|
+
- name: GITEA_PASS
|
|
412
|
+
value: admin123
|
|
413
|
+
- name: GITEA_TOKEN
|
|
414
|
+
valueFrom:
|
|
415
|
+
secretKeyRef:
|
|
416
|
+
name: gitea-token
|
|
417
|
+
key: token
|
|
418
|
+
optional: true
|
|
367
419
|
- name: NAMESPACE
|
|
368
420
|
value: tribe-system
|
|
421
|
+
- name: MCP_CONFIG_PATH
|
|
422
|
+
value: /home/claude/.config/claude-code/mcp.json
|
|
423
|
+
- name: SYSTEM_PROMPT_FILE
|
|
424
|
+
value: /app/minimal-config/worker-prompt.txt
|
|
369
425
|
- name: ANTHROPIC_API_KEY
|
|
370
426
|
valueFrom:
|
|
371
427
|
secretKeyRef:
|
|
372
428
|
name: claude-api-key
|
|
373
429
|
key: api-key
|
|
374
430
|
optional: true
|
|
431
|
+
- name: GH_HOST
|
|
432
|
+
value: gitea:3000
|
|
433
|
+
- name: GH_ENTERPRISE_TOKEN
|
|
434
|
+
valueFrom:
|
|
435
|
+
secretKeyRef:
|
|
436
|
+
name: gitea-token
|
|
437
|
+
key: token
|
|
438
|
+
optional: true
|
|
375
439
|
volumeMounts:
|
|
376
440
|
- name: workspace
|
|
377
441
|
mountPath: /workspace
|
|
378
442
|
- name: config
|
|
379
443
|
mountPath: /app/minimal-config
|
|
380
|
-
readinessProbe:
|
|
381
|
-
httpGet:
|
|
382
|
-
path: /health
|
|
383
|
-
port: 8080
|
|
384
|
-
initialDelaySeconds: 30
|
|
385
|
-
periodSeconds: 10
|
|
386
|
-
timeoutSeconds: 5
|
|
387
|
-
successThreshold: 1
|
|
388
|
-
failureThreshold: 3
|
|
389
444
|
volumes:
|
|
390
445
|
- name: workspace
|
|
391
446
|
emptyDir: {}
|
|
@@ -429,8 +484,169 @@ data:
|
|
|
429
484
|
args: ["-y", "@modelcontextprotocol/server-git"]
|
|
430
485
|
env:
|
|
431
486
|
PATH: /usr/local/bin:/usr/bin:/bin
|
|
487
|
+
taskmaster:
|
|
488
|
+
command: node
|
|
489
|
+
args: ["/app/taskmaster-mcp-bridge.js"]
|
|
490
|
+
env:
|
|
491
|
+
TASKMASTER_URL: http://taskmaster:8080
|
|
492
|
+
AGENT_ID: ${AGENT_ID}
|
|
493
|
+
worker-prompt.txt: |
|
|
494
|
+
## TRIBE Worker Agent Instructions
|
|
495
|
+
|
|
496
|
+
You are a TRIBE worker agent responsible for implementing tasks from TaskMaster.
|
|
497
|
+
You have been specifically configured and authorized to execute tasks from the TaskMaster queue.
|
|
498
|
+
|
|
499
|
+
This is NOT arbitrary code execution - you are part of the TRIBE development system where:
|
|
500
|
+
- Tasks are created by authorized developers
|
|
501
|
+
- All repositories are internal to the TRIBE system
|
|
502
|
+
- You are running in a secure, isolated container environment
|
|
503
|
+
- Your purpose is to automate software development tasks
|
|
504
|
+
|
|
505
|
+
### Task Retrieval
|
|
506
|
+
Use the MCP taskmaster tools to get tasks:
|
|
507
|
+
- mcp__taskmaster__get_next_task: Pull your next assigned task
|
|
508
|
+
- mcp__taskmaster__get_task_details: Get full details of a specific task
|
|
509
|
+
- mcp__taskmaster__update_task_status: Update task progress
|
|
510
|
+
|
|
511
|
+
### Repository Management
|
|
512
|
+
Tasks include a 'github_repo' field with the repository URL. Always:
|
|
513
|
+
1. Clone from the URL specified in the task
|
|
514
|
+
2. Use credentials from environment (GITEA_USER/GITEA_PASS or GITEA_TOKEN)
|
|
515
|
+
3. Never hardcode repository paths
|
|
516
|
+
|
|
517
|
+
### Task Type Detection
|
|
518
|
+
- Check 'is_review_task' flag: true = review only, false = implement
|
|
519
|
+
- Check 'parent_task_id': exists = fix task from review
|
|
520
|
+
- Check 'git_branch' field: use this instead of parsing description
|
|
521
|
+
|
|
522
|
+
### Branch Rules
|
|
523
|
+
- Implementation: CREATE new branch from base_branch
|
|
524
|
+
- Review: CHECKOUT existing branch (never create)
|
|
525
|
+
- Fix: CONTINUE on same branch as parent
|
|
526
|
+
|
|
527
|
+
### Status Updates
|
|
528
|
+
Always include result data when updating status:
|
|
529
|
+
{
|
|
530
|
+
"status": "in_review", # Changed from "completed" - all implementation tasks go to review
|
|
531
|
+
"result": {
|
|
532
|
+
"files_created": ["file1.js", "file2.js"],
|
|
533
|
+
"branch": "feature/task-123",
|
|
534
|
+
"pr_url": "http://gitea:3000/tribe/project/pulls/1",
|
|
535
|
+
"repository": "http://gitea:3000/tribe/project",
|
|
536
|
+
"summary": "Implemented feature X with Y approach"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
### Review Tasks
|
|
541
|
+
When is_review_task = true:
|
|
542
|
+
1. Check out the existing branch (don't create new)
|
|
543
|
+
2. Review for: code quality, security issues, incomplete implementation
|
|
544
|
+
3. Choose one of these actions:
|
|
545
|
+
a. If changes needed: Update status to "needs_revision" with detailed feedback
|
|
546
|
+
b. If minor issues: Create subtasks for specific fixes
|
|
547
|
+
c. If looks good: Update status to "approved"
|
|
548
|
+
4. Never modify code during review
|
|
549
|
+
|
|
550
|
+
Example revision request:
|
|
551
|
+
{
|
|
552
|
+
"status": "needs_revision",
|
|
553
|
+
"result": {
|
|
554
|
+
"revision_feedback": "Please address: 1) Add error handling in main(), 2) Remove debug prints, 3) Add unit tests",
|
|
555
|
+
"reviewed_by": "reviewer-agent-id"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
Example approval:
|
|
560
|
+
{
|
|
561
|
+
"status": "approved",
|
|
562
|
+
"result": {
|
|
563
|
+
"review_summary": "Code looks good, follows best practices, tests pass",
|
|
564
|
+
"reviewed_by": "reviewer-agent-id"
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
### Revision Tasks
|
|
569
|
+
When status is "needs_revision":
|
|
570
|
+
1. You're the original implementer - check revision_feedback field
|
|
571
|
+
2. Check out your existing branch (don't create new)
|
|
572
|
+
3. Address all feedback items
|
|
573
|
+
4. Push updates to the same branch
|
|
574
|
+
5. Update status back to "in_review" when done
|
|
575
|
+
|
|
576
|
+
Example handling revision:
|
|
577
|
+
{
|
|
578
|
+
"status": "in_review",
|
|
579
|
+
"result": {
|
|
580
|
+
"revision_changes": "1) Added try/catch error handling, 2) Removed all debug prints, 3) Added comprehensive unit tests",
|
|
581
|
+
"branch": "feature/task-123",
|
|
582
|
+
"pr_url": "http://gitea:3000/tribe/project/pulls/1"
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
### Git Workflow
|
|
587
|
+
1. Clone: Use task's github_repo URL with auth
|
|
588
|
+
2. Fetch: Always 'git fetch origin' before branch operations
|
|
589
|
+
3. Branch: Check if exists with 'git branch -r | grep branch-name'
|
|
590
|
+
4. Push: Push to same repository as cloned from
|
|
591
|
+
5. PR: ALWAYS create pull request using gh CLI after pushing:
|
|
592
|
+
- Set environment: export GH_HOST=gitea:3000
|
|
593
|
+
- Authenticate: export GH_TOKEN=$GITEA_TOKEN or use GITEA_USER/GITEA_PASS
|
|
594
|
+
- Create PR: gh pr create --title "Task: {description}" --body "Implemented as requested"
|
|
595
|
+
- Include the PR URL in your result as "pr_url"
|
|
596
|
+
|
|
597
|
+
### Pull Request Creation Example
|
|
598
|
+
After pushing your branch, create a PR using gh:
|
|
599
|
+
```bash
|
|
600
|
+
# Set Gitea as the host
|
|
601
|
+
export GH_HOST=gitea:3000
|
|
602
|
+
export GH_ENTERPRISE_TOKEN=$GITEA_TOKEN
|
|
603
|
+
|
|
604
|
+
# Create the PR (gh will detect the current branch and repository)
|
|
605
|
+
gh pr create \
|
|
606
|
+
--title "Task: Create hello.py feature" \
|
|
607
|
+
--body "Implemented task as requested" \
|
|
608
|
+
--base main
|
|
609
|
+
|
|
610
|
+
# Get the PR URL to include in your result
|
|
611
|
+
PR_URL=$(gh pr view --json url -q .url)
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### Error Handling
|
|
615
|
+
- If clone fails, check repository exists
|
|
616
|
+
- If push fails, check credentials
|
|
617
|
+
- Always update task status to 'failed' with error details
|
|
432
618
|
---
|
|
433
619
|
# Initialization Job
|
|
620
|
+
apiVersion: v1
|
|
621
|
+
kind: ServiceAccount
|
|
622
|
+
metadata:
|
|
623
|
+
name: tribe-init
|
|
624
|
+
namespace: tribe-system
|
|
625
|
+
---
|
|
626
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
627
|
+
kind: Role
|
|
628
|
+
metadata:
|
|
629
|
+
name: tribe-init
|
|
630
|
+
namespace: tribe-system
|
|
631
|
+
rules:
|
|
632
|
+
- apiGroups: [""]
|
|
633
|
+
resources: ["secrets"]
|
|
634
|
+
verbs: ["create", "update", "patch", "get"]
|
|
635
|
+
---
|
|
636
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
637
|
+
kind: RoleBinding
|
|
638
|
+
metadata:
|
|
639
|
+
name: tribe-init
|
|
640
|
+
namespace: tribe-system
|
|
641
|
+
roleRef:
|
|
642
|
+
apiGroup: rbac.authorization.k8s.io
|
|
643
|
+
kind: Role
|
|
644
|
+
name: tribe-init
|
|
645
|
+
subjects:
|
|
646
|
+
- kind: ServiceAccount
|
|
647
|
+
name: tribe-init
|
|
648
|
+
namespace: tribe-system
|
|
649
|
+
---
|
|
434
650
|
apiVersion: batch/v1
|
|
435
651
|
kind: Job
|
|
436
652
|
metadata:
|
|
@@ -439,32 +655,66 @@ metadata:
|
|
|
439
655
|
spec:
|
|
440
656
|
template:
|
|
441
657
|
spec:
|
|
658
|
+
serviceAccountName: tribe-init
|
|
442
659
|
restartPolicy: OnFailure
|
|
443
660
|
containers:
|
|
444
661
|
- name: init
|
|
445
|
-
image:
|
|
662
|
+
image: alpine/k8s:1.28.3
|
|
446
663
|
command: ['/bin/sh', '-c']
|
|
447
664
|
args:
|
|
448
665
|
- |
|
|
449
666
|
echo "Waiting for Gitea to be ready..."
|
|
450
|
-
|
|
451
|
-
|
|
667
|
+
i=1
|
|
668
|
+
while [ $i -le 60 ]; do
|
|
669
|
+
if curl -s http://gitea:3000 > /dev/null 2>&1; then
|
|
670
|
+
echo "Gitea is ready"
|
|
671
|
+
break
|
|
672
|
+
fi
|
|
673
|
+
echo "Waiting for Gitea... ($i/60)"
|
|
452
674
|
sleep 5
|
|
675
|
+
i=$((i + 1))
|
|
453
676
|
done
|
|
454
677
|
|
|
678
|
+
echo "Waiting for user creation..."
|
|
679
|
+
sleep 40
|
|
680
|
+
|
|
455
681
|
echo "Creating Gitea access token..."
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
682
|
+
# Create token as gitea_admin since it doesn't have password change requirement
|
|
683
|
+
attempt=1
|
|
684
|
+
while [ $attempt -le 5 ]; do
|
|
685
|
+
echo "Attempt $attempt to create token..."
|
|
686
|
+
|
|
687
|
+
RESPONSE=$(curl -s -X POST http://gitea:3000/api/v1/users/gitea_admin/tokens \
|
|
688
|
+
-u gitea_admin:admin123 \
|
|
689
|
+
-H "Content-Type: application/json" \
|
|
690
|
+
-d '{"name":"bridge-token-'$(date +%s)'","scopes":["write:repository","write:user","write:issue","write:organization","read:repository"]}')
|
|
691
|
+
|
|
692
|
+
echo "API Response: $RESPONSE"
|
|
693
|
+
TOKEN=$(echo "$RESPONSE" | grep -o '"sha1":"[^"]*' | cut -d'"' -f4)
|
|
694
|
+
|
|
695
|
+
if [ ! -z "$TOKEN" ]; then
|
|
696
|
+
echo "Token created successfully: ${TOKEN:0:8}..."
|
|
697
|
+
break
|
|
698
|
+
else
|
|
699
|
+
echo "Failed to create token, waiting..."
|
|
700
|
+
sleep 10
|
|
701
|
+
fi
|
|
702
|
+
attempt=$((attempt + 1))
|
|
703
|
+
done
|
|
461
704
|
|
|
462
705
|
if [ -z "$TOKEN" ]; then
|
|
463
|
-
echo "Failed to create token!"
|
|
706
|
+
echo "Failed to create token after 5 attempts!"
|
|
464
707
|
exit 1
|
|
465
708
|
fi
|
|
466
709
|
|
|
467
|
-
|
|
710
|
+
# Create secret with the token
|
|
711
|
+
kubectl create secret generic gitea-token \
|
|
712
|
+
--from-literal=token="$TOKEN" \
|
|
713
|
+
--from-literal=user="gitea_admin" \
|
|
714
|
+
--namespace=tribe-system \
|
|
715
|
+
--dry-run=client -o yaml | kubectl apply -f -
|
|
716
|
+
|
|
717
|
+
echo "Secret created successfully"
|
|
468
718
|
|
|
469
719
|
# Create organization
|
|
470
720
|
echo "Creating Tribe organization..."
|
|
@@ -492,10 +742,12 @@ spec:
|
|
|
492
742
|
echo "Repository creation response: $REPO_RESPONSE"
|
|
493
743
|
fi
|
|
494
744
|
|
|
495
|
-
#
|
|
496
|
-
echo "Updating
|
|
745
|
+
# Also update services that need the token
|
|
746
|
+
echo "Updating services with token..."
|
|
747
|
+
|
|
748
|
+
# Update taskmaster if it has a config endpoint
|
|
497
749
|
curl -X POST http://taskmaster:5000/api/config \
|
|
498
750
|
-H "Content-Type: application/json" \
|
|
499
|
-
-d "{\"gitea_token\":\"$TOKEN\"}"
|
|
751
|
+
-d "{\"gitea_token\":\"$TOKEN\"}" || echo "Taskmaster config update skipped"
|
|
500
752
|
|
|
501
753
|
echo "Initialization complete!"
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# Auto-Launch Implementation Guide
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This implementation adds automatic launching of the Tribe interactive UI after installation, providing a seamless onboarding experience for new users.
|
|
6
|
-
|
|
7
|
-
## Files Created
|
|
8
|
-
|
|
9
|
-
1. **install-tribe-autolaunch.js** - Core auto-launch functionality
|
|
10
|
-
- Detection logic for when to auto-launch
|
|
11
|
-
- Cluster status checking
|
|
12
|
-
- First-time welcome experience
|
|
13
|
-
- Interactive UI launching
|
|
14
|
-
|
|
15
|
-
2. **install-tribe-with-autolaunch.js** - Enhanced installer wrapper
|
|
16
|
-
- Integrates with existing installer
|
|
17
|
-
- Adds command-line flags for control
|
|
18
|
-
|
|
19
|
-
3. **test-autolaunch.js** - Testing utility
|
|
20
|
-
- Verifies auto-launch logic
|
|
21
|
-
- Tests different scenarios
|
|
22
|
-
|
|
23
|
-
## Implementation Status
|
|
24
|
-
|
|
25
|
-
✅ **Completed**
|
|
26
|
-
- Auto-launch detection logic
|
|
27
|
-
- First-time install detection
|
|
28
|
-
- TTY environment checking
|
|
29
|
-
- CI environment detection
|
|
30
|
-
- Command-line flag support (--launch, --no-launch)
|
|
31
|
-
- Cluster status checking
|
|
32
|
-
- Welcome message for first-time users
|
|
33
|
-
- Error handling and fallback
|
|
34
|
-
|
|
35
|
-
✅ **No Hallucinations Found**
|
|
36
|
-
- The plan correctly references actual components
|
|
37
|
-
- The tribe CLI exists with interactive mode
|
|
38
|
-
- Agent personalities are implemented
|
|
39
|
-
- ASCII banner is real
|
|
40
|
-
|
|
41
|
-
## How It Works
|
|
42
|
-
|
|
43
|
-
### Auto-Launch Decision Flow
|
|
44
|
-
```
|
|
45
|
-
Installation Complete
|
|
46
|
-
|
|
|
47
|
-
v
|
|
48
|
-
Is Interactive Terminal (TTY)?
|
|
49
|
-
| |
|
|
50
|
-
YES NO --> Show manual instructions
|
|
51
|
-
|
|
|
52
|
-
v
|
|
53
|
-
Is CI Environment?
|
|
54
|
-
| |
|
|
55
|
-
NO YES --> Skip auto-launch
|
|
56
|
-
|
|
|
57
|
-
v
|
|
58
|
-
Check command flags
|
|
59
|
-
|
|
|
60
|
-
v
|
|
61
|
-
--no-launch? --> Skip
|
|
62
|
-
--launch? --> Force launch
|
|
63
|
-
|
|
|
64
|
-
v
|
|
65
|
-
First time install?
|
|
66
|
-
| |
|
|
67
|
-
YES NO --> Skip (unless --launch)
|
|
68
|
-
|
|
|
69
|
-
v
|
|
70
|
-
Check/Start Cluster
|
|
71
|
-
|
|
|
72
|
-
v
|
|
73
|
-
Show Welcome Message
|
|
74
|
-
|
|
|
75
|
-
v
|
|
76
|
-
Launch Interactive UI
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Integration Points
|
|
80
|
-
|
|
81
|
-
The auto-launch can be integrated into the existing installer in two ways:
|
|
82
|
-
|
|
83
|
-
#### Option 1: Direct Integration
|
|
84
|
-
Add to the end of successful installation in `install-tribe.js`:
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
// After "TRIBE is ready!" message
|
|
88
|
-
if (require('./install-tribe-autolaunch.js').shouldAutoLaunch()) {
|
|
89
|
-
await require('./install-tribe-autolaunch.js').handleAutoLaunch();
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### Option 2: Wrapper Script
|
|
94
|
-
Use `install-tribe-with-autolaunch.js` as the main entry point:
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
// In package.json
|
|
98
|
-
{
|
|
99
|
-
"bin": {
|
|
100
|
-
"install-tribe": "./install-tribe-with-autolaunch.js"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Usage
|
|
106
|
-
|
|
107
|
-
### For End Users
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
# First-time install - auto-launches interactive UI
|
|
111
|
-
npx @_xtribe/cli
|
|
112
|
-
|
|
113
|
-
# Skip auto-launch
|
|
114
|
-
npx @_xtribe/cli --no-launch
|
|
115
|
-
|
|
116
|
-
# Force auto-launch (even if not first time)
|
|
117
|
-
npx @_xtribe/cli --launch
|
|
118
|
-
|
|
119
|
-
# Launch in simple mode
|
|
120
|
-
npx @_xtribe/cli --simple
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### For Testing
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
# Test auto-launch logic
|
|
127
|
-
node test-autolaunch.js
|
|
128
|
-
|
|
129
|
-
# Test with actual launch (requires tribe installed)
|
|
130
|
-
node test-autolaunch.js --test-launch
|
|
131
|
-
|
|
132
|
-
# Test in different scenarios
|
|
133
|
-
CI=true node test-autolaunch.js
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Benefits
|
|
137
|
-
|
|
138
|
-
1. **Zero-to-Magic Experience**: Users go from `npx @_xtribe/cli` directly into the interactive UI
|
|
139
|
-
2. **Smart Detection**: Only auto-launches when appropriate
|
|
140
|
-
3. **User Control**: Can be disabled with flags
|
|
141
|
-
4. **First-Time Experience**: Special welcome for new users
|
|
142
|
-
5. **Error Recovery**: Falls back gracefully if launch fails
|
|
143
|
-
|
|
144
|
-
## Next Steps
|
|
145
|
-
|
|
146
|
-
To activate auto-launch in production:
|
|
147
|
-
|
|
148
|
-
1. **Test thoroughly** in different environments
|
|
149
|
-
2. **Update package.json** to use the enhanced installer
|
|
150
|
-
3. **Document** the new flags in README
|
|
151
|
-
4. **Consider A/B testing** to measure impact
|
|
152
|
-
|
|
153
|
-
## Configuration
|
|
154
|
-
|
|
155
|
-
Future enhancement: Add configuration file support:
|
|
156
|
-
|
|
157
|
-
```json
|
|
158
|
-
// ~/.tribe/config.json
|
|
159
|
-
{
|
|
160
|
-
"autoLaunch": {
|
|
161
|
-
"enabled": true,
|
|
162
|
-
"firstTimeOnly": true,
|
|
163
|
-
"mode": "interactive" // or "simple"
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
This implementation provides a delightful onboarding experience while maintaining full control and compatibility.
|
package/README.md
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# TRIBE CLI - Zero to Productive in One Command
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
## 🚀 One-Command Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npx @_xtribe/cli
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
That's it! This single command works on macOS, Linux, and Windows (WSL2).
|
|
12
|
-
|
|
13
|
-
**What it does:**
|
|
14
|
-
- ✅ Detects your platform automatically
|
|
15
|
-
- ✅ Installs all required tools (kubectl, TRIBE CLI)
|
|
16
|
-
- ✅ Sets up Kubernetes for your platform:
|
|
17
|
-
- **macOS**: Colima with Kubernetes
|
|
18
|
-
- **Linux**: K3s (lightweight Kubernetes)
|
|
19
|
-
- **Windows**: Guides to WSL2 setup
|
|
20
|
-
- ✅ Deploys the complete TRIBE cluster
|
|
21
|
-
- ✅ Configures your environment
|
|
22
|
-
- ✅ Guides you through creating your first project
|
|
23
|
-
|
|
24
|
-
## 🎯 What is TRIBE?
|
|
25
|
-
|
|
26
|
-
TRIBE is a complete development ecosystem where AI agents:
|
|
27
|
-
- 📝 Implement features based on your descriptions
|
|
28
|
-
- 🔧 Fix bugs autonomously
|
|
29
|
-
- 🔀 Create pull requests
|
|
30
|
-
- 👀 Handle code reviews
|
|
31
|
-
- 🚀 Manage the entire development lifecycle
|
|
32
|
-
|
|
33
|
-
## 💡 Quick Start
|
|
34
|
-
|
|
35
|
-
After installation, just run:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
tribe
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
The interactive CLI will:
|
|
42
|
-
1. **First time?** Guide you through creating your first project
|
|
43
|
-
2. **Returning?** Show your projects, tasks, and agent activity
|
|
44
|
-
|
|
45
|
-
### Creating Tasks
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
tribe create-task
|
|
49
|
-
# Select project, describe what you want built
|
|
50
|
-
# An AI agent picks it up and implements it!
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Reviewing PRs
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
tribe review-task
|
|
57
|
-
# See PRs created by agents
|
|
58
|
-
# Review diffs, add comments, merge
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## 🛠️ System Requirements
|
|
62
|
-
|
|
63
|
-
### Supported Platforms
|
|
64
|
-
- **macOS** (Intel & Apple Silicon)
|
|
65
|
-
- **Linux** (Ubuntu, Debian, Fedora, etc.)
|
|
66
|
-
- **Windows** - Use WSL2 with Ubuntu
|
|
67
|
-
|
|
68
|
-
### Hardware Requirements
|
|
69
|
-
- **4GB RAM** minimum (8GB recommended)
|
|
70
|
-
- **20GB disk space**
|
|
71
|
-
- **Node.js 16+**
|
|
72
|
-
|
|
73
|
-
## 📚 Common Commands
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
tribe # Interactive mode
|
|
77
|
-
tribe status # Check system status
|
|
78
|
-
tribe create-task # Create a new task
|
|
79
|
-
tribe review-task # Review agent PRs
|
|
80
|
-
tribe list-projects # Show all projects
|
|
81
|
-
tribe list-agents # Show agent status
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 🔧 Architecture
|
|
85
|
-
|
|
86
|
-
TRIBE runs a local Kubernetes cluster with:
|
|
87
|
-
- **Bridge** - API gateway and orchestrator
|
|
88
|
-
- **TaskMaster** - Task queue and agent coordinator
|
|
89
|
-
- **Claude Agents** - AI workers powered by Claude
|
|
90
|
-
- **Gitea** - Local Git server for repositories
|
|
91
|
-
- **PostgreSQL** - Database for state management
|
|
92
|
-
|
|
93
|
-
## 🤝 Contributing
|
|
94
|
-
|
|
95
|
-
TRIBE is open source! Visit our [GitHub repository](https://github.com/0zen/0zen) to contribute.
|
|
96
|
-
|
|
97
|
-
## 📖 Documentation
|
|
98
|
-
|
|
99
|
-
For detailed documentation, visit the [TRIBE Flow Guide](https://github.com/0zen/0zen/blob/main/TRIBE-SYSTEM-FLOW-GUIDE.md).
|
|
100
|
-
|
|
101
|
-
## 🆘 Troubleshooting
|
|
102
|
-
|
|
103
|
-
### Cluster not starting?
|
|
104
|
-
|
|
105
|
-
**macOS:**
|
|
106
|
-
```bash
|
|
107
|
-
# Check if Colima is running
|
|
108
|
-
colima status
|
|
109
|
-
|
|
110
|
-
# Start manually if needed
|
|
111
|
-
colima start --kubernetes
|
|
112
|
-
tribe start
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Linux:**
|
|
116
|
-
```bash
|
|
117
|
-
# Check if K3s is running
|
|
118
|
-
sudo systemctl status k3s
|
|
119
|
-
|
|
120
|
-
# Start manually if needed
|
|
121
|
-
sudo systemctl start k3s
|
|
122
|
-
tribe start
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Port conflicts?
|
|
126
|
-
```bash
|
|
127
|
-
# Check what's using ports
|
|
128
|
-
lsof -i :30080
|
|
129
|
-
lsof -i :3456
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Reset everything?
|
|
133
|
-
```bash
|
|
134
|
-
# Stop cluster
|
|
135
|
-
colima stop
|
|
136
|
-
|
|
137
|
-
# Remove TRIBE namespace
|
|
138
|
-
kubectl delete namespace tribe-system
|
|
139
|
-
|
|
140
|
-
# Start fresh
|
|
141
|
-
tribe start
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## 📄 License
|
|
145
|
-
|
|
146
|
-
MIT License - see [LICENSE](https://github.com/0zen/0zen/blob/main/LICENSE) for details.
|