@cpretzinger/boss-claude 1.0.0
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/LICENSE +21 -0
- package/README.md +264 -0
- package/bin/boss-claude.js +150 -0
- package/lib/identity.js +115 -0
- package/lib/init.js +133 -0
- package/lib/memory.js +94 -0
- package/lib/postgres.js +398 -0
- package/lib/session.js +158 -0
- package/package.json +37 -0
- package/scripts/install.js +82 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import { execSync } from 'child_process';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
12
|
+
|
|
13
|
+
console.log(chalk.blue.bold('\n🎮 Installing Boss Claude...\n'));
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
// Create ~/.boss-claude directory
|
|
17
|
+
const bossDirPath = join(os.homedir(), '.boss-claude');
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(bossDirPath)) {
|
|
20
|
+
fs.mkdirSync(bossDirPath, { recursive: true });
|
|
21
|
+
console.log(chalk.green('✅ Created ~/.boss-claude directory'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Copy .env.example to ~/.boss-claude/.env if it doesn't exist
|
|
25
|
+
const envDestPath = join(bossDirPath, '.env');
|
|
26
|
+
|
|
27
|
+
if (!fs.existsSync(envDestPath)) {
|
|
28
|
+
const envSourcePath = join(__dirname, '..', 'config', '.env.example');
|
|
29
|
+
|
|
30
|
+
if (fs.existsSync(envSourcePath)) {
|
|
31
|
+
fs.copyFileSync(envSourcePath, envDestPath);
|
|
32
|
+
console.log(chalk.green('✅ Created ~/.boss-claude/.env from template'));
|
|
33
|
+
console.log(chalk.yellow('\n⚠️ IMPORTANT: Edit ~/.boss-claude/.env with your credentials:'));
|
|
34
|
+
console.log(chalk.gray(' - REDIS_URL (required)'));
|
|
35
|
+
console.log(chalk.gray(' - GITHUB_TOKEN (required)'));
|
|
36
|
+
console.log(chalk.gray(' - GITHUB_OWNER (optional)'));
|
|
37
|
+
console.log(chalk.gray(' - GITHUB_MEMORY_REPO (optional)\n'));
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
console.log(chalk.blue('ℹ️ ~/.boss-claude/.env already exists (skipping)'));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Update ~/.claude/CLAUDE.md to auto-load Boss
|
|
44
|
+
const claudeDirPath = join(os.homedir(), '.claude');
|
|
45
|
+
const claudeMdPath = join(claudeDirPath, 'CLAUDE.md');
|
|
46
|
+
|
|
47
|
+
const bossAutoLoadBlock = `
|
|
48
|
+
# BOSS CLAUDE AUTO-LOAD
|
|
49
|
+
\`\`\`javascript
|
|
50
|
+
import { formatStatusForClaude } from '@cpretzinger/boss-claude/lib/init.js';
|
|
51
|
+
console.log(await formatStatusForClaude());
|
|
52
|
+
\`\`\`
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
if (!fs.existsSync(claudeDirPath)) {
|
|
56
|
+
fs.mkdirSync(claudeDirPath, { recursive: true });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (fs.existsSync(claudeMdPath)) {
|
|
60
|
+
const content = fs.readFileSync(claudeMdPath, 'utf8');
|
|
61
|
+
|
|
62
|
+
if (!content.includes('BOSS CLAUDE AUTO-LOAD')) {
|
|
63
|
+
fs.appendFileSync(claudeMdPath, bossAutoLoadBlock);
|
|
64
|
+
console.log(chalk.green('✅ Added Boss Claude auto-load to ~/.claude/CLAUDE.md'));
|
|
65
|
+
} else {
|
|
66
|
+
console.log(chalk.blue('ℹ️ Boss Claude auto-load already in ~/.claude/CLAUDE.md'));
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
fs.writeFileSync(claudeMdPath, bossAutoLoadBlock);
|
|
70
|
+
console.log(chalk.green('✅ Created ~/.claude/CLAUDE.md with Boss Claude auto-load'));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log(chalk.green.bold('\n✨ Boss Claude installed successfully!\n'));
|
|
74
|
+
console.log(chalk.bold('Next steps:'));
|
|
75
|
+
console.log(chalk.gray('1. Edit ~/.boss-claude/.env with your credentials'));
|
|
76
|
+
console.log(chalk.gray('2. Run: boss-claude init'));
|
|
77
|
+
console.log(chalk.gray('3. Start using Boss Claude in any repository!\n'));
|
|
78
|
+
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(chalk.red('\n❌ Installation failed:'), error.message);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|