claudepod 1.1.2 → 1.2.1
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/.devcontainer/.env +18 -0
- package/.devcontainer/CHANGELOG.md +68 -0
- package/.devcontainer/CLAUDE.md +100 -0
- package/.devcontainer/README.md +220 -0
- package/.devcontainer/config/main-system-prompt.md +118 -0
- package/.devcontainer/config/settings.json +41 -0
- package/.devcontainer/devcontainer.json +71 -113
- package/.devcontainer/features/README.md +113 -0
- package/.devcontainer/features/ast-grep/README.md +24 -0
- package/.devcontainer/features/ast-grep/devcontainer-feature.json +24 -0
- package/.devcontainer/features/ast-grep/install.sh +51 -0
- package/.devcontainer/features/ccstatusline/README.md +296 -0
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +19 -0
- package/.devcontainer/features/ccstatusline/install.sh +290 -0
- package/.devcontainer/features/ccusage/README.md +205 -0
- package/.devcontainer/features/ccusage/devcontainer-feature.json +38 -0
- package/.devcontainer/features/ccusage/install.sh +132 -0
- package/.devcontainer/features/claude-code/README.md +498 -0
- package/.devcontainer/features/claude-code/config/settings.json +36 -0
- package/.devcontainer/features/claude-code/config/system-prompt.md +118 -0
- package/.devcontainer/features/claude-code/config/world-building-sp.md +1432 -0
- package/.devcontainer/features/claude-code/devcontainer-feature.json +42 -0
- package/.devcontainer/features/claude-code/install.sh +466 -0
- package/.devcontainer/features/claude-monitor/README.md +74 -0
- package/.devcontainer/features/claude-monitor/devcontainer-feature.json +38 -0
- package/.devcontainer/features/claude-monitor/install.sh +99 -0
- package/.devcontainer/features/lsp-servers/README.md +85 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +34 -0
- package/.devcontainer/features/lsp-servers/install.sh +92 -0
- package/.devcontainer/features/mcp-qdrant/CHANGES.md +399 -0
- package/.devcontainer/features/mcp-qdrant/README.md +474 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +57 -0
- package/.devcontainer/features/mcp-qdrant/install.sh +295 -0
- package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +129 -0
- package/.devcontainer/features/mcp-reasoner/README.md +177 -0
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +20 -0
- package/.devcontainer/features/mcp-reasoner/install.sh +177 -0
- package/.devcontainer/features/mcp-reasoner/poststart-hook.sh +67 -0
- package/.devcontainer/features/splitrail/README.md +140 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +34 -0
- package/.devcontainer/features/splitrail/install.sh +129 -0
- package/.devcontainer/features/tree-sitter/README.md +138 -0
- package/.devcontainer/features/tree-sitter/devcontainer-feature.json +52 -0
- package/.devcontainer/features/tree-sitter/install.sh +173 -0
- package/.devcontainer/scripts/setup-aliases.sh +52 -0
- package/.devcontainer/scripts/setup-config.sh +28 -0
- package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
- package/.devcontainer/scripts/setup-lsp.sh +20 -0
- package/.devcontainer/scripts/setup-plugins.sh +31 -0
- package/.devcontainer/scripts/setup.sh +60 -0
- package/README.md +153 -187
- package/package.json +5 -9
- package/setup.js +2 -2
- package/.devcontainer/config/claude/mcp.json +0 -76
- package/.devcontainer/config/claude/mcp.json.template +0 -117
- package/.devcontainer/config/claude/output-styles/strict-development.md +0 -158
- package/.devcontainer/config/claude/settings.json +0 -10
- package/.devcontainer/config/claude/system-prompt.md +0 -3
- package/.devcontainer/config/searxng/ods_config.json +0 -22
- package/.devcontainer/config/searxng/searxng_env_template +0 -71
- package/.devcontainer/config/serena/serena_config.yml +0 -72
- package/.devcontainer/config/taskmaster/config.json +0 -37
- package/.devcontainer/ods_config.json +0 -21
- package/.devcontainer/post-create.sh +0 -1077
- package/.devcontainer/post-start.sh +0 -551
- package/.devcontainer/sanitize-system-prompt.sh +0 -31
- package/.devcontainer/scripts/config/claude-core.sh +0 -210
- package/.devcontainer/scripts/config/searxng.sh +0 -411
- package/.devcontainer/scripts/config/serena.sh +0 -47
- package/.devcontainer/scripts/config/taskmaster.sh +0 -41
- package/.devcontainer/scripts/generate-mcp-config.js +0 -205
- package/.devcontainer/scripts/install/claude-code.sh +0 -112
- package/.devcontainer/scripts/shell/zsh-config.sh +0 -271
- package/.devcontainer/scripts/utils.sh +0 -44
- package/.devcontainer/setup-zsh.sh +0 -234
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# TaskMaster Configuration Module
|
|
4
|
-
# Handles TaskMaster AI configuration setup
|
|
5
|
-
|
|
6
|
-
setup_taskmaster_config() {
|
|
7
|
-
echo "🔧 Setting up TaskMaster configuration..."
|
|
8
|
-
|
|
9
|
-
local taskmaster_source="/workspace/.devcontainer/config/taskmaster/config.json"
|
|
10
|
-
local taskmaster_target_workspace="/workspace/.taskmaster/config.json"
|
|
11
|
-
|
|
12
|
-
if [ ! -f "$taskmaster_source" ]; then
|
|
13
|
-
echo "⚠️ TaskMaster configuration template not found, using defaults"
|
|
14
|
-
return 1
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
# Ensure TaskMaster directory exists
|
|
18
|
-
mkdir -p "/workspace/.taskmaster"
|
|
19
|
-
|
|
20
|
-
local copy_taskmaster=false
|
|
21
|
-
if [ "${OVERRIDE_TASKMASTER_CONFIG:-false}" = "true" ]; then
|
|
22
|
-
echo "📝 OVERRIDE_TASKMASTER_CONFIG=true: Forcing overwrite of TaskMaster configuration"
|
|
23
|
-
copy_taskmaster=true
|
|
24
|
-
elif [ ! -f "$taskmaster_target_workspace" ]; then
|
|
25
|
-
echo "📝 Creating TaskMaster configuration (no existing files found)"
|
|
26
|
-
copy_taskmaster=true
|
|
27
|
-
else
|
|
28
|
-
echo "📁 Preserving existing TaskMaster configuration (set OVERRIDE_TASKMASTER_CONFIG=true to overwrite)"
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
if [ "$copy_taskmaster" = "true" ]; then
|
|
32
|
-
# Copy to workspace
|
|
33
|
-
cp "$taskmaster_source" "$taskmaster_target_workspace"
|
|
34
|
-
chown node:node "$taskmaster_target_workspace"
|
|
35
|
-
chmod 600 "$taskmaster_target_workspace"
|
|
36
|
-
|
|
37
|
-
echo "📋 Copied optimized TaskMaster configuration"
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
echo "✅ TaskMaster configuration ready"
|
|
41
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Generate MCP configuration from template based on environment variables
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const path = require('path');
|
|
8
|
-
|
|
9
|
-
// Load environment variables from .env file (industry standard approach)
|
|
10
|
-
const ENV_FILE_PATH = '/workspace/.devcontainer/.env';
|
|
11
|
-
try {
|
|
12
|
-
require('dotenv').config({ path: ENV_FILE_PATH, override: true });
|
|
13
|
-
console.log(`[MCP Config Generator] Loaded environment from ${ENV_FILE_PATH}`);
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.log(`[MCP Config Generator] dotenv not available, using process.env: ${error.message}`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const CONFIG_DIR = '/workspace/.devcontainer/config/claude';
|
|
19
|
-
const TEMPLATE_PATH = path.join(CONFIG_DIR, 'mcp.json.template');
|
|
20
|
-
const OUTPUT_PATH = path.join(CONFIG_DIR, 'mcp.json');
|
|
21
|
-
const BACKUP_PATH = path.join(CONFIG_DIR, 'mcp.json.backup');
|
|
22
|
-
|
|
23
|
-
function log(message) {
|
|
24
|
-
console.log(`[MCP Config Generator] ${message}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function parseBoolean(value, defaultValue = false) {
|
|
28
|
-
if (!value) return defaultValue;
|
|
29
|
-
const lowerValue = value.toLowerCase().trim();
|
|
30
|
-
return lowerValue === 'true' || lowerValue === '1' || lowerValue === 'yes';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function expandEnvironmentVariables(text, env) {
|
|
34
|
-
return text.replace(/\$\{([^}:-]+)(:-([^}]*))?\}/g, (match, varName, _, defaultValue) => {
|
|
35
|
-
const envValue = env[varName];
|
|
36
|
-
if (envValue !== undefined) {
|
|
37
|
-
return envValue;
|
|
38
|
-
}
|
|
39
|
-
return defaultValue || '';
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function hasRequiredApiKeys(requires, env) {
|
|
44
|
-
if (!requires || requires.length === 0) return true;
|
|
45
|
-
|
|
46
|
-
return requires.every(key => {
|
|
47
|
-
const value = env[key];
|
|
48
|
-
return value && value.trim() !== '';
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function validateMcpConfiguration(config) {
|
|
53
|
-
try {
|
|
54
|
-
// Validate top-level structure
|
|
55
|
-
if (!config || typeof config !== 'object') {
|
|
56
|
-
log('Validation Error: Configuration must be an object');
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
61
|
-
log('Validation Error: Configuration must have mcpServers object');
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Validate each server configuration
|
|
66
|
-
for (const [serverName, serverConfig] of Object.entries(config.mcpServers)) {
|
|
67
|
-
if (!validateServerConfig(serverName, serverConfig)) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
log('MCP configuration validation passed');
|
|
73
|
-
return true;
|
|
74
|
-
} catch (error) {
|
|
75
|
-
log(`Validation Error: ${error.message}`);
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function validateServerConfig(serverName, config) {
|
|
81
|
-
// Check for required fields based on server type
|
|
82
|
-
if (config.command) {
|
|
83
|
-
// Command-based server
|
|
84
|
-
if (!Array.isArray(config.args)) {
|
|
85
|
-
log(`Validation Error: Server ${serverName} with command must have args array`);
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
} else if (config.type === 'http') {
|
|
89
|
-
// HTTP-based server
|
|
90
|
-
if (!config.url || typeof config.url !== 'string') {
|
|
91
|
-
log(`Validation Error: HTTP server ${serverName} must have valid url`);
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Validate URL format
|
|
96
|
-
try {
|
|
97
|
-
new URL(config.url);
|
|
98
|
-
} catch (urlError) {
|
|
99
|
-
log(`Validation Error: Server ${serverName} has invalid URL: ${config.url}`);
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
log(`Validation Error: Server ${serverName} must have either 'command' or 'type' field`);
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function generateMcpConfig() {
|
|
111
|
-
try {
|
|
112
|
-
// Check if template exists
|
|
113
|
-
if (!fs.existsSync(TEMPLATE_PATH)) {
|
|
114
|
-
log(`Template file not found: ${TEMPLATE_PATH}`);
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Read template
|
|
119
|
-
const templateContent = fs.readFileSync(TEMPLATE_PATH, 'utf8');
|
|
120
|
-
let templateData;
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
// First expand environment variables in the template
|
|
124
|
-
const expandedTemplate = expandEnvironmentVariables(templateContent, process.env);
|
|
125
|
-
templateData = JSON.parse(expandedTemplate);
|
|
126
|
-
} catch (error) {
|
|
127
|
-
log(`Failed to parse template: ${error.message}`);
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Create backup of existing config if it exists
|
|
132
|
-
if (fs.existsSync(OUTPUT_PATH)) {
|
|
133
|
-
fs.copyFileSync(OUTPUT_PATH, BACKUP_PATH);
|
|
134
|
-
log(`Created backup: ${BACKUP_PATH}`);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Generate output configuration
|
|
138
|
-
const outputConfig = {
|
|
139
|
-
mcpServers: {}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
let enabledCount = 0;
|
|
143
|
-
let disabledCount = 0;
|
|
144
|
-
|
|
145
|
-
// Process each server
|
|
146
|
-
for (const [serverName, serverData] of Object.entries(templateData.servers)) {
|
|
147
|
-
const enabled = parseBoolean(serverData.enabled, false);
|
|
148
|
-
const hasApiKeys = hasRequiredApiKeys(serverData.requires, process.env);
|
|
149
|
-
|
|
150
|
-
if (enabled && hasApiKeys) {
|
|
151
|
-
// Server is enabled and has required API keys
|
|
152
|
-
// Flatten the config structure - remove the nested "config" wrapper
|
|
153
|
-
outputConfig.mcpServers[serverName] = serverData.config;
|
|
154
|
-
enabledCount++;
|
|
155
|
-
log(`✓ Enabled: ${serverName}`);
|
|
156
|
-
} else {
|
|
157
|
-
// Server is disabled or missing API keys
|
|
158
|
-
disabledCount++;
|
|
159
|
-
if (!enabled) {
|
|
160
|
-
log(`✗ Disabled: ${serverName} (ENABLE_${serverName.toUpperCase().replace(/-/g, '_')}_MCP=false)`);
|
|
161
|
-
} else {
|
|
162
|
-
log(`✗ Disabled: ${serverName} (missing required API keys: ${serverData.requires?.join(', ')})`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// Keep environment variables as references, don't expand them
|
|
168
|
-
const finalConfigText = JSON.stringify(outputConfig, null, 2);
|
|
169
|
-
|
|
170
|
-
// Write output
|
|
171
|
-
fs.writeFileSync(OUTPUT_PATH, finalConfigText);
|
|
172
|
-
|
|
173
|
-
// Basic validation - ensure output is valid JSON
|
|
174
|
-
try {
|
|
175
|
-
JSON.parse(finalConfigText);
|
|
176
|
-
} catch (parseError) {
|
|
177
|
-
log(`Error: Generated configuration is not valid JSON: ${parseError.message}`);
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Advanced validation - validate MCP configuration structure
|
|
182
|
-
if (!validateMcpConfiguration(outputConfig)) {
|
|
183
|
-
log(`Error: Generated MCP configuration failed validation`);
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
log(`Configuration generated successfully!`);
|
|
188
|
-
log(`Servers enabled: ${enabledCount}, disabled: ${disabledCount}`);
|
|
189
|
-
log(`Output: ${OUTPUT_PATH}`);
|
|
190
|
-
|
|
191
|
-
return true;
|
|
192
|
-
|
|
193
|
-
} catch (error) {
|
|
194
|
-
log(`Error generating configuration: ${error.message}`);
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Main execution
|
|
200
|
-
if (require.main === module) {
|
|
201
|
-
const success = generateMcpConfig();
|
|
202
|
-
process.exit(success ? 0 : 1);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
module.exports = { generateMcpConfig };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Claude Code Installation Module
|
|
4
|
-
# Handles Claude Code installation using focused functions
|
|
5
|
-
|
|
6
|
-
# State tracking directory
|
|
7
|
-
STATE_DIR="/workspace/.devcontainer/state"
|
|
8
|
-
|
|
9
|
-
# Function to create state marker
|
|
10
|
-
create_state_marker() {
|
|
11
|
-
local component="$1"
|
|
12
|
-
local method="${2:-unknown}"
|
|
13
|
-
|
|
14
|
-
mkdir -p "$STATE_DIR"
|
|
15
|
-
echo "$(date '+%Y-%m-%d %H:%M:%S') - $method" > "$STATE_DIR/${component}.installed"
|
|
16
|
-
chown -R node:node "$STATE_DIR"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
# Function to check if component is already installed
|
|
20
|
-
is_component_installed() {
|
|
21
|
-
local component="$1"
|
|
22
|
-
|
|
23
|
-
[ -f "$STATE_DIR/${component}.installed" ]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
# Function to verify Claude Code installation
|
|
27
|
-
verify_claude_installation() {
|
|
28
|
-
local installation_method="$1"
|
|
29
|
-
|
|
30
|
-
if command -v claude &> /dev/null || [ -f "/home/node/.local/bin/claude" ]; then
|
|
31
|
-
local version=$(claude --version 2>/dev/null || echo "installed")
|
|
32
|
-
echo "📌 Claude Code version: $version"
|
|
33
|
-
echo "✅ Claude Code verification successful ($installation_method)"
|
|
34
|
-
return 0
|
|
35
|
-
else
|
|
36
|
-
echo "⚠️ Claude Code installed via $installation_method but 'claude' command not found"
|
|
37
|
-
echo "📍 Checking installation location..."
|
|
38
|
-
find /home/node/.local -name "claude" -type f 2>/dev/null || echo " No claude binary found"
|
|
39
|
-
return 1
|
|
40
|
-
fi
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
# Function to install Claude Code via native binary
|
|
44
|
-
install_claude_code_native() {
|
|
45
|
-
echo "📦 Installing Claude Code via native binary..."
|
|
46
|
-
|
|
47
|
-
if retry_command 3 5 bash -c 'curl -fsSL claude.ai/install.sh | bash'; then
|
|
48
|
-
echo "✅ Claude Code native binary installation completed"
|
|
49
|
-
return 0
|
|
50
|
-
else
|
|
51
|
-
echo "❌ Failed to install Claude Code native binary after multiple attempts"
|
|
52
|
-
return 1
|
|
53
|
-
fi
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
# Function to install Claude Code via npm fallback
|
|
57
|
-
install_claude_code_npm() {
|
|
58
|
-
echo "📦 Installing Claude Code via npm fallback..."
|
|
59
|
-
|
|
60
|
-
# Ensure npm environment is configured
|
|
61
|
-
export npm_config_prefix="/home/node/.local"
|
|
62
|
-
|
|
63
|
-
if retry_command 3 5 npm install -g @anthropic-ai/claude-code; then
|
|
64
|
-
echo "✅ Claude Code npm installation completed"
|
|
65
|
-
return 0
|
|
66
|
-
else
|
|
67
|
-
echo "❌ Failed to install Claude Code via npm"
|
|
68
|
-
return 1
|
|
69
|
-
fi
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
# Main Claude Code installation function
|
|
73
|
-
install_claude_code() {
|
|
74
|
-
# Check if Claude Code is already installed
|
|
75
|
-
if is_component_installed "claude-code"; then
|
|
76
|
-
echo "✅ Claude Code already installed (marker found)"
|
|
77
|
-
if verify_claude_installation "cached"; then
|
|
78
|
-
return 0
|
|
79
|
-
else
|
|
80
|
-
echo "⚠️ Marker exists but verification failed, reinstalling..."
|
|
81
|
-
rm -f "$STATE_DIR/claude-code.installed"
|
|
82
|
-
fi
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
echo "📦 Installing Claude Code (Native Binary)..."
|
|
86
|
-
|
|
87
|
-
# Attempt native binary installation first
|
|
88
|
-
if install_claude_code_native; then
|
|
89
|
-
if verify_claude_installation "native binary"; then
|
|
90
|
-
create_state_marker "claude-code" "native binary"
|
|
91
|
-
return 0
|
|
92
|
-
else
|
|
93
|
-
echo "⚠️ Native binary installation completed but verification failed"
|
|
94
|
-
fi
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
# Fallback to npm installation
|
|
98
|
-
echo "⚠️ Falling back to npm installation..."
|
|
99
|
-
|
|
100
|
-
if install_claude_code_npm; then
|
|
101
|
-
if verify_claude_installation "npm fallback"; then
|
|
102
|
-
create_state_marker "claude-code" "npm fallback"
|
|
103
|
-
return 0
|
|
104
|
-
else
|
|
105
|
-
echo "❌ npm installation completed but verification failed"
|
|
106
|
-
return 1
|
|
107
|
-
fi
|
|
108
|
-
else
|
|
109
|
-
echo "❌ Failed to install Claude Code via both native binary and npm"
|
|
110
|
-
return 1
|
|
111
|
-
fi
|
|
112
|
-
}
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# ZSH Configuration Module
|
|
4
|
-
# Handles focused ZSH configuration generation
|
|
5
|
-
|
|
6
|
-
# Function to generate basic ZSH configuration
|
|
7
|
-
generate_zsh_basic_config() {
|
|
8
|
-
cat << 'EOF'
|
|
9
|
-
# ClaudePod ZSH Configuration
|
|
10
|
-
# Path to your oh-my-zsh installation
|
|
11
|
-
export ZSH="$HOME/.oh-my-zsh"
|
|
12
|
-
|
|
13
|
-
# Set name of the theme to load
|
|
14
|
-
ZSH_THEME="powerlevel10k/powerlevel10k"
|
|
15
|
-
|
|
16
|
-
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
17
|
-
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
18
|
-
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
# Disable P10k configuration wizard
|
|
22
|
-
export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
|
|
23
|
-
|
|
24
|
-
# Suppress P10k instant prompt warnings (quiet mode)
|
|
25
|
-
export POWERLEVEL9K_INSTANT_PROMPT=quiet
|
|
26
|
-
|
|
27
|
-
# ZSH Configuration
|
|
28
|
-
CASE_SENSITIVE="false"
|
|
29
|
-
HYPHEN_INSENSITIVE="true"
|
|
30
|
-
DISABLE_AUTO_UPDATE="false"
|
|
31
|
-
DISABLE_UPDATE_PROMPT="true"
|
|
32
|
-
export UPDATE_ZSH_DAYS=7
|
|
33
|
-
DISABLE_MAGIC_FUNCTIONS="false"
|
|
34
|
-
DISABLE_LS_COLORS="false"
|
|
35
|
-
DISABLE_AUTO_TITLE="false"
|
|
36
|
-
ENABLE_CORRECTION="true"
|
|
37
|
-
COMPLETION_WAITING_DOTS="true"
|
|
38
|
-
DISABLE_UNTRACKED_FILES_DIRTY="false"
|
|
39
|
-
HIST_STAMPS="yyyy-mm-dd"
|
|
40
|
-
|
|
41
|
-
# ZSH Plugins
|
|
42
|
-
plugins=(
|
|
43
|
-
git
|
|
44
|
-
docker
|
|
45
|
-
docker-compose
|
|
46
|
-
node
|
|
47
|
-
npm
|
|
48
|
-
python
|
|
49
|
-
pip
|
|
50
|
-
vscode
|
|
51
|
-
zsh-syntax-highlighting
|
|
52
|
-
zsh-autosuggestions
|
|
53
|
-
zsh-completions
|
|
54
|
-
fast-syntax-highlighting
|
|
55
|
-
history-substring-search
|
|
56
|
-
colored-man-pages
|
|
57
|
-
command-not-found
|
|
58
|
-
extract
|
|
59
|
-
z
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
# Load Oh My Zsh
|
|
63
|
-
source $ZSH/oh-my-zsh.sh
|
|
64
|
-
|
|
65
|
-
# User configuration
|
|
66
|
-
export LANG=en_US.UTF-8
|
|
67
|
-
export EDITOR='code'
|
|
68
|
-
export ARCHFLAGS="-arch x86_64"
|
|
69
|
-
|
|
70
|
-
# History configuration
|
|
71
|
-
HISTSIZE=50000
|
|
72
|
-
SAVEHIST=50000
|
|
73
|
-
setopt HIST_EXPIRE_DUPS_FIRST
|
|
74
|
-
setopt HIST_IGNORE_DUPS
|
|
75
|
-
setopt HIST_IGNORE_ALL_DUPS
|
|
76
|
-
setopt HIST_IGNORE_SPACE
|
|
77
|
-
setopt HIST_FIND_NO_DUPS
|
|
78
|
-
setopt HIST_SAVE_NO_DUPS
|
|
79
|
-
setopt HIST_BEEP
|
|
80
|
-
setopt SHARE_HISTORY
|
|
81
|
-
|
|
82
|
-
# Path configuration
|
|
83
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
84
|
-
export PATH="/usr/local/share/npm-global/bin:$PATH"
|
|
85
|
-
|
|
86
|
-
# Node.js/NVM configuration
|
|
87
|
-
export NVM_DIR="/usr/local/share/nvm"
|
|
88
|
-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
89
|
-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
90
|
-
|
|
91
|
-
# Python configuration
|
|
92
|
-
if command -v python3 &> /dev/null; then
|
|
93
|
-
alias python=python3
|
|
94
|
-
alias pip=pip3
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
EOF
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
# Function to generate ZSH aliases
|
|
101
|
-
generate_zsh_aliases() {
|
|
102
|
-
cat << 'EOF'
|
|
103
|
-
# ClaudePod aliases
|
|
104
|
-
alias ll='ls -alF'
|
|
105
|
-
alias la='ls -A'
|
|
106
|
-
alias l='ls -CF'
|
|
107
|
-
alias gs='git status'
|
|
108
|
-
alias gd='git diff'
|
|
109
|
-
alias gc='git commit'
|
|
110
|
-
alias gco='git checkout'
|
|
111
|
-
alias gp='git push'
|
|
112
|
-
alias gl='git log --oneline --graph --decorate'
|
|
113
|
-
alias ga='git add'
|
|
114
|
-
alias gb='git branch'
|
|
115
|
-
alias gm='git merge'
|
|
116
|
-
alias gr='git rebase'
|
|
117
|
-
alias gf='git fetch'
|
|
118
|
-
alias gpl='git pull'
|
|
119
|
-
|
|
120
|
-
# Development aliases
|
|
121
|
-
alias c='code .'
|
|
122
|
-
alias cls='clear'
|
|
123
|
-
alias h='history'
|
|
124
|
-
alias ..='cd ..'
|
|
125
|
-
alias ...='cd ../..'
|
|
126
|
-
alias ....='cd ../../..'
|
|
127
|
-
alias ~='cd ~'
|
|
128
|
-
|
|
129
|
-
# Claude Code aliases with optimized configuration
|
|
130
|
-
claude() {
|
|
131
|
-
local mcp_config="/workspace/.devcontainer/config/claude/mcp.json"
|
|
132
|
-
local system_prompt_file="/workspace/.devcontainer/config/claude/system-prompt.md"
|
|
133
|
-
local system_prompt=""
|
|
134
|
-
|
|
135
|
-
# Generate sanitized system prompt if file exists
|
|
136
|
-
if [ -f "$system_prompt_file" ]; then
|
|
137
|
-
system_prompt=$(/workspace/.devcontainer/sanitize-system-prompt.sh "$system_prompt_file" 2>/dev/null || echo "")
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
# Build command with conditional arguments
|
|
141
|
-
local cmd_args=(
|
|
142
|
-
--model sonnet
|
|
143
|
-
--dangerously-skip-permissions
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
# Add MCP config if file exists
|
|
147
|
-
if [ -f "$mcp_config" ]; then
|
|
148
|
-
cmd_args+=(--mcp-config "$mcp_config")
|
|
149
|
-
fi
|
|
150
|
-
|
|
151
|
-
# Add system prompt if successfully generated
|
|
152
|
-
if [ -n "$system_prompt" ]; then
|
|
153
|
-
cmd_args+=(--append-system-prompt "$system_prompt")
|
|
154
|
-
fi
|
|
155
|
-
|
|
156
|
-
# Execute claude with all arguments
|
|
157
|
-
command claude "${cmd_args[@]}" "$@"
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
alias claude-help='claude --help'
|
|
161
|
-
alias claude-mcp='claude mcp list'
|
|
162
|
-
alias claude-version='claude --version'
|
|
163
|
-
alias claude-basic='command claude' # Access original claude without optimizations
|
|
164
|
-
|
|
165
|
-
EOF
|
|
166
|
-
|
|
167
|
-
# Add Docker aliases conditionally
|
|
168
|
-
cat << 'EOF'
|
|
169
|
-
# Docker aliases (if docker is available)
|
|
170
|
-
if command -v docker &> /dev/null; then
|
|
171
|
-
alias d='docker'
|
|
172
|
-
alias dc='docker-compose'
|
|
173
|
-
alias dps='docker ps'
|
|
174
|
-
alias dpsa='docker ps -a'
|
|
175
|
-
alias di='docker images'
|
|
176
|
-
alias drm='docker rm'
|
|
177
|
-
alias drmi='docker rmi'
|
|
178
|
-
fi
|
|
179
|
-
|
|
180
|
-
EOF
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
# Function to generate ZSH utility functions
|
|
184
|
-
generate_zsh_functions() {
|
|
185
|
-
cat << 'EOF'
|
|
186
|
-
# Useful functions
|
|
187
|
-
# Extract various archive formats
|
|
188
|
-
extract() {
|
|
189
|
-
if [ -f $1 ]; then
|
|
190
|
-
case $1 in
|
|
191
|
-
*.tar.bz2) tar xjf $1 ;;
|
|
192
|
-
*.tar.gz) tar xzf $1 ;;
|
|
193
|
-
*.bz2) bunzip2 $1 ;;
|
|
194
|
-
*.rar) unrar e $1 ;;
|
|
195
|
-
*.gz) gunzip $1 ;;
|
|
196
|
-
*.tar) tar xf $1 ;;
|
|
197
|
-
*.tbz2) tar xjf $1 ;;
|
|
198
|
-
*.tgz) tar xzf $1 ;;
|
|
199
|
-
*.zip) unzip $1 ;;
|
|
200
|
-
*.Z) uncompress $1 ;;
|
|
201
|
-
*.7z) 7z x $1 ;;
|
|
202
|
-
*) echo "'$1' cannot be extracted via extract()" ;;
|
|
203
|
-
esac
|
|
204
|
-
else
|
|
205
|
-
echo "'$1' is not a valid file"
|
|
206
|
-
fi
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
# Create directory and cd into it
|
|
210
|
-
mkcd() {
|
|
211
|
-
mkdir -p "$1" && cd "$1"
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
# Find process by name
|
|
215
|
-
findp() {
|
|
216
|
-
ps aux | grep -v grep | grep "$1"
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
# Quick HTTP server
|
|
220
|
-
serve() {
|
|
221
|
-
local port="${1:-8000}"
|
|
222
|
-
python3 -m http.server "$port"
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
EOF
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
# Function to generate ZSH welcome and final configuration
|
|
229
|
-
generate_zsh_welcome() {
|
|
230
|
-
cat << 'EOF'
|
|
231
|
-
# Load Powerlevel10k configuration
|
|
232
|
-
if [[ -r ~/.p10k.zsh ]]; then
|
|
233
|
-
source ~/.p10k.zsh
|
|
234
|
-
fi
|
|
235
|
-
|
|
236
|
-
# Auto-suggestions configuration
|
|
237
|
-
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#666666"
|
|
238
|
-
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
|
239
|
-
ZSH_AUTOSUGGEST_USE_ASYNC=true
|
|
240
|
-
|
|
241
|
-
# Syntax highlighting configuration
|
|
242
|
-
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
|
243
|
-
|
|
244
|
-
# Welcome message
|
|
245
|
-
if [[ -n "$ZSH_VERSION" ]]; then
|
|
246
|
-
echo "🚀 Welcome to ClaudePod!"
|
|
247
|
-
echo "💡 Type 'claude' to start using Claude Code"
|
|
248
|
-
echo "📋 Run 'claude mcp list' to see available MCP servers"
|
|
249
|
-
fi
|
|
250
|
-
EOF
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
# Main function to create enhanced .zshrc using focused generators
|
|
254
|
-
create_zshrc() {
|
|
255
|
-
echo "📝 Creating enhanced .zshrc configuration..."
|
|
256
|
-
|
|
257
|
-
# Backup existing .zshrc if it exists
|
|
258
|
-
if [ -f "$HOME/.zshrc" ]; then
|
|
259
|
-
cp "$HOME/.zshrc" "$HOME/.zshrc.backup.$(date +%s)" 2>/dev/null || true
|
|
260
|
-
fi
|
|
261
|
-
|
|
262
|
-
# Generate complete .zshrc using focused components
|
|
263
|
-
{
|
|
264
|
-
generate_zsh_basic_config
|
|
265
|
-
generate_zsh_aliases
|
|
266
|
-
generate_zsh_functions
|
|
267
|
-
generate_zsh_welcome
|
|
268
|
-
} > "$HOME/.zshrc"
|
|
269
|
-
|
|
270
|
-
echo "✅ Enhanced .zshrc created"
|
|
271
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# ClaudePod Shared Utilities
|
|
4
|
-
# Common functions used across multiple setup scripts
|
|
5
|
-
|
|
6
|
-
# Function to retry a command with exponential backoff
|
|
7
|
-
# Usage: retry_command <max_attempts> <delay_seconds> <command> [args...]
|
|
8
|
-
# Example: retry_command 3 5 npm install -g some-package
|
|
9
|
-
retry_command() {
|
|
10
|
-
local max_attempts=${1:-3}
|
|
11
|
-
local delay=${2:-5}
|
|
12
|
-
shift 2
|
|
13
|
-
local attempt=1
|
|
14
|
-
|
|
15
|
-
while [ $attempt -le $max_attempts ]; do
|
|
16
|
-
if "$@"; then
|
|
17
|
-
return 0
|
|
18
|
-
fi
|
|
19
|
-
echo "⚠️ Command failed (attempt $attempt/$max_attempts): $*"
|
|
20
|
-
if [ $attempt -lt $max_attempts ]; then
|
|
21
|
-
echo " Retrying in ${delay}s..."
|
|
22
|
-
sleep $delay
|
|
23
|
-
fi
|
|
24
|
-
((attempt++))
|
|
25
|
-
done
|
|
26
|
-
return 1
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
# Function to add directory to PATH without duplication
|
|
30
|
-
# Usage: add_to_path <directory>
|
|
31
|
-
# Example: add_to_path "/home/node/.local/bin"
|
|
32
|
-
add_to_path() {
|
|
33
|
-
local dir="$1"
|
|
34
|
-
case ":$PATH:" in
|
|
35
|
-
*":$dir:"*)
|
|
36
|
-
# Directory already in PATH
|
|
37
|
-
return 0
|
|
38
|
-
;;
|
|
39
|
-
*)
|
|
40
|
-
# Add directory to PATH
|
|
41
|
-
export PATH="$dir:$PATH"
|
|
42
|
-
;;
|
|
43
|
-
esac
|
|
44
|
-
}
|