-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathr
More file actions
executable file
·76 lines (65 loc) · 2.14 KB
/
Copy pathr
File metadata and controls
executable file
·76 lines (65 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
# Run script for PyClaudeCli - builds if needed then runs console
# Source common utilities
source "$(dirname "$0")/Scripts/common.sh"
check_project_root
print_header "PyClaudeCli Run System" "Smart build and console launcher"
# Check if we need to build
declare NEED_BUILD=false
# Check if build directory exists
if [[ ! -d "build" ]]; then
log_info "Build directory not found, building..."
NEED_BUILD=true
fi
# Check if any source files are newer than build artifacts
if [[ -d "build" ]]; then
if is_newer "ask/utils/variables.py" "build/Makefile" || \
is_newer "ask/bindings/VariableApi.cpp" "build/Makefile" || \
is_newer "CMakeLists.txt" "build/Makefile"; then
log_info "Source files updated, rebuilding..."
NEED_BUILD=true
fi
fi
# Build if needed
if [[ "$NEED_BUILD" == "true" ]]; then
log_build "Running build script..."
./b
fi
# Check available consoles and start the best one
if command_exists python3; then
log_run "Starting Python interactive mode..."
python3 -c "
import sys
sys.path.append('.')
from ask.utils.variables import VariableManager
from ask.modes.interactive import InteractiveMode
from ask.api.client import ClaudeClient
print('\n🚀 PyClaudeCli Variable System Loaded')
print('\nAvailable imports:')
print(' - VariableManager: Variable management system')
print(' - InteractiveMode: Interactive CLI mode')
print(' - ClaudeClient: Claude API client')
print('\nExample usage:')
print(' vm = VariableManager()')
print(' vm.process_input(\"name=John\")')
print(' vm.process_input(\"Hello name!\")')
print('\nType exit() or Ctrl+D to quit\n')
# Create global instances for convenience
vm = VariableManager()
globals()['vm'] = vm
globals()['VariableManager'] = VariableManager
globals()['InteractiveMode'] = InteractiveMode
globals()['ClaudeClient'] = ClaudeClient
import code
code.interact(local=globals(), banner='')
"
elif command_exists v8console; then
log_run "Starting v8console..."
v8console
elif command_exists node; then
log_run "Starting Node.js REPL..."
node
else
log_error "No suitable console found (python3, v8console, or node)"
exit 1
fi