openclacky 0.7.0 → 0.7.2
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.
- checksums.yaml +4 -4
- data/.clacky/skills/commit/SKILL.md +29 -4
- data/.clackyrules +3 -1
- data/CHANGELOG.md +103 -2
- data/README.md +70 -161
- data/bin/clarky +11 -0
- data/docs/HOW-TO-USE-CN.md +96 -0
- data/docs/HOW-TO-USE.md +94 -0
- data/docs/config.example.yml +27 -0
- data/docs/deploy_subagent_design.md +540 -0
- data/docs/time_machine_design.md +247 -0
- data/docs/why-openclacky.md +0 -1
- data/lib/clacky/agent/cost_tracker.rb +180 -0
- data/lib/clacky/agent/llm_caller.rb +54 -0
- data/lib/clacky/{message_compressor.rb → agent/message_compressor.rb} +12 -36
- data/lib/clacky/agent/message_compressor_helper.rb +534 -0
- data/lib/clacky/agent/session_serializer.rb +152 -0
- data/lib/clacky/agent/skill_manager.rb +138 -0
- data/lib/clacky/agent/system_prompt_builder.rb +96 -0
- data/lib/clacky/agent/time_machine.rb +199 -0
- data/lib/clacky/agent/tool_executor.rb +434 -0
- data/lib/clacky/{tool_registry.rb → agent/tool_registry.rb} +1 -1
- data/lib/clacky/agent.rb +260 -1370
- data/lib/clacky/agent_config.rb +447 -10
- data/lib/clacky/cli.rb +275 -98
- data/lib/clacky/client.rb +12 -2
- data/lib/clacky/default_skills/code-explorer/SKILL.md +34 -0
- data/lib/clacky/default_skills/deploy/SKILL.md +13 -0
- data/lib/clacky/default_skills/deploy/scripts/rails_deploy.rb +383 -0
- data/lib/clacky/default_skills/deploy/tools/check_health.rb +116 -0
- data/lib/clacky/default_skills/deploy/tools/execute_deployment.rb +174 -0
- data/lib/clacky/default_skills/deploy/tools/fetch_runtime_logs.rb +67 -0
- data/lib/clacky/default_skills/deploy/tools/list_services.rb +80 -0
- data/lib/clacky/default_skills/deploy/tools/report_deploy_status.rb +67 -0
- data/lib/clacky/default_skills/deploy/tools/set_deploy_variables.rb +138 -0
- data/lib/clacky/default_skills/new/SKILL.md +2 -2
- data/lib/clacky/json_ui_controller.rb +195 -0
- data/lib/clacky/providers.rb +107 -0
- data/lib/clacky/skill.rb +48 -7
- data/lib/clacky/skill_loader.rb +7 -0
- data/lib/clacky/tools/edit.rb +105 -48
- data/lib/clacky/tools/file_reader.rb +44 -73
- data/lib/clacky/tools/invoke_skill.rb +89 -0
- data/lib/clacky/tools/list_tasks.rb +54 -0
- data/lib/clacky/tools/redo_task.rb +41 -0
- data/lib/clacky/tools/safe_shell.rb +1 -1
- data/lib/clacky/tools/shell.rb +74 -62
- data/lib/clacky/tools/trash_manager.rb +1 -1
- data/lib/clacky/tools/undo_task.rb +32 -0
- data/lib/clacky/tools/web_fetch.rb +2 -1
- data/lib/clacky/ui2/components/command_suggestions.rb +13 -3
- data/lib/clacky/ui2/components/inline_input.rb +23 -2
- data/lib/clacky/ui2/components/input_area.rb +65 -21
- data/lib/clacky/ui2/components/modal_component.rb +199 -62
- data/lib/clacky/ui2/layout_manager.rb +75 -25
- data/lib/clacky/ui2/line_editor.rb +23 -2
- data/lib/clacky/ui2/markdown_renderer.rb +31 -10
- data/lib/clacky/ui2/screen_buffer.rb +2 -0
- data/lib/clacky/ui2/ui_controller.rb +316 -37
- data/lib/clacky/ui2.rb +2 -0
- data/lib/clacky/ui_interface.rb +50 -0
- data/lib/clacky/utils/arguments_parser.rb +31 -3
- data/lib/clacky/utils/file_processor.rb +13 -18
- data/lib/clacky/version.rb +1 -1
- data/lib/clacky.rb +19 -9
- data/scripts/install.sh +274 -97
- data/scripts/uninstall.sh +12 -12
- metadata +40 -13
- data/.clacky/skills/test-skill/SKILL.md +0 -15
- data/lib/clacky/compression/base.rb +0 -231
- data/lib/clacky/compression/standard.rb +0 -339
- data/lib/clacky/config.rb +0 -117
- /data/lib/clacky/{hook_manager.rb → agent/hook_manager.rb} +0 -0
- /data/lib/clacky/{progress_indicator.rb → ui2/progress_indicator.rb} +0 -0
- /data/lib/clacky/{thinking_verbs.rb → ui2/thinking_verbs.rb} +0 -0
- /data/lib/clacky/{gitignore_parser.rb → utils/gitignore_parser.rb} +0 -0
- /data/lib/clacky/{model_pricing.rb → utils/model_pricing.rb} +0 -0
- /data/lib/clacky/{trash_directory.rb → utils/trash_directory.rb} +0 -0
data/lib/clacky.rb
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "clacky/version"
|
|
4
|
-
require_relative "clacky/config"
|
|
5
4
|
require_relative "clacky/client"
|
|
6
|
-
require_relative "clacky/message_compressor"
|
|
7
5
|
require_relative "clacky/skill"
|
|
8
6
|
require_relative "clacky/skill_loader"
|
|
9
7
|
|
|
10
8
|
# Agent system
|
|
11
|
-
require_relative "clacky/model_pricing"
|
|
12
9
|
require_relative "clacky/agent_config"
|
|
13
|
-
require_relative "clacky/
|
|
14
|
-
require_relative "clacky/tool_registry"
|
|
15
|
-
require_relative "clacky/thinking_verbs"
|
|
16
|
-
require_relative "clacky/progress_indicator"
|
|
10
|
+
require_relative "clacky/providers"
|
|
17
11
|
require_relative "clacky/session_manager"
|
|
18
|
-
|
|
12
|
+
|
|
13
|
+
# Agent modules
|
|
14
|
+
require_relative "clacky/agent/message_compressor"
|
|
15
|
+
require_relative "clacky/agent/hook_manager"
|
|
16
|
+
require_relative "clacky/agent/tool_registry"
|
|
17
|
+
|
|
18
|
+
# UI modules
|
|
19
|
+
require_relative "clacky/ui2/thinking_verbs"
|
|
20
|
+
require_relative "clacky/ui2/progress_indicator"
|
|
21
|
+
|
|
22
|
+
# Utils
|
|
23
|
+
require_relative "clacky/utils/model_pricing"
|
|
24
|
+
require_relative "clacky/utils/gitignore_parser"
|
|
19
25
|
require_relative "clacky/utils/limit_stack"
|
|
20
26
|
require_relative "clacky/utils/path_helper"
|
|
21
27
|
require_relative "clacky/utils/file_ignore_helper"
|
|
@@ -34,12 +40,16 @@ require_relative "clacky/tools/run_project"
|
|
|
34
40
|
require_relative "clacky/tools/safe_shell"
|
|
35
41
|
require_relative "clacky/tools/trash_manager"
|
|
36
42
|
require_relative "clacky/tools/request_user_feedback"
|
|
43
|
+
require_relative "clacky/tools/invoke_skill"
|
|
44
|
+
require_relative "clacky/tools/undo_task"
|
|
45
|
+
require_relative "clacky/tools/redo_task"
|
|
46
|
+
require_relative "clacky/tools/list_tasks"
|
|
37
47
|
require_relative "clacky/agent"
|
|
38
48
|
|
|
39
49
|
require_relative "clacky/cli"
|
|
40
50
|
|
|
41
51
|
module Clacky
|
|
52
|
+
class AgentInterrupted < Exception; end # Inherit from Exception to bypass rescue StandardError
|
|
42
53
|
class AgentError < StandardError; end
|
|
43
|
-
class AgentInterrupted < StandardError; end
|
|
44
54
|
class ToolCallError < AgentError; end # Raised when tool call fails due to invalid parameters
|
|
45
55
|
end
|
data/scripts/install.sh
CHANGED
|
@@ -42,6 +42,17 @@ detect_os() {
|
|
|
42
42
|
*) OS=Unknown;;
|
|
43
43
|
esac
|
|
44
44
|
print_info "Detected OS: $OS"
|
|
45
|
+
|
|
46
|
+
# Detect Linux distribution
|
|
47
|
+
if [ "$OS" = "Linux" ]; then
|
|
48
|
+
if [ -f /etc/os-release ]; then
|
|
49
|
+
. /etc/os-release
|
|
50
|
+
DISTRO=$ID
|
|
51
|
+
print_info "Detected Linux distribution: $DISTRO"
|
|
52
|
+
else
|
|
53
|
+
DISTRO=unknown
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
# Check if command exists
|
|
@@ -60,7 +71,7 @@ check_ruby() {
|
|
|
60
71
|
if command_exists ruby; then
|
|
61
72
|
RUBY_VERSION=$(ruby -e 'puts RUBY_VERSION' 2>/dev/null)
|
|
62
73
|
print_info "Found Ruby version: $RUBY_VERSION"
|
|
63
|
-
|
|
74
|
+
|
|
64
75
|
if version_ge "$RUBY_VERSION" "3.1.0"; then
|
|
65
76
|
print_success "Ruby version is compatible (>= 3.1.0)"
|
|
66
77
|
return 0
|
|
@@ -74,45 +85,18 @@ check_ruby() {
|
|
|
74
85
|
fi
|
|
75
86
|
}
|
|
76
87
|
|
|
77
|
-
# Install via Homebrew
|
|
78
|
-
install_via_homebrew() {
|
|
79
|
-
print_step "Installing via Homebrew..."
|
|
80
|
-
|
|
81
|
-
if ! command_exists brew; then
|
|
82
|
-
print_error "Homebrew is not installed"
|
|
83
|
-
print_info "Install Homebrew from: https://brew.sh"
|
|
84
|
-
return 1
|
|
85
|
-
fi
|
|
86
|
-
|
|
87
|
-
print_info "Adding OpenClacky tap..."
|
|
88
|
-
brew tap clacky-ai/openclacky 2>/dev/null || {
|
|
89
|
-
print_warning "Tap not found or already added, trying direct installation..."
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
print_info "Installing OpenClacky..."
|
|
93
|
-
brew install openclacky
|
|
94
|
-
|
|
95
|
-
if [ $? -eq 0 ]; then
|
|
96
|
-
print_success "OpenClacky installed successfully via Homebrew!"
|
|
97
|
-
return 0
|
|
98
|
-
else
|
|
99
|
-
print_error "Homebrew installation failed"
|
|
100
|
-
return 1
|
|
101
|
-
fi
|
|
102
|
-
}
|
|
103
|
-
|
|
104
88
|
# Install via RubyGems
|
|
105
89
|
install_via_gem() {
|
|
106
90
|
print_step "Installing via RubyGems..."
|
|
107
|
-
|
|
91
|
+
|
|
108
92
|
if ! command_exists gem; then
|
|
109
93
|
print_error "RubyGems is not available"
|
|
110
94
|
return 1
|
|
111
95
|
fi
|
|
112
|
-
|
|
96
|
+
|
|
113
97
|
print_info "Installing OpenClacky gem..."
|
|
114
98
|
gem install openclacky
|
|
115
|
-
|
|
99
|
+
|
|
116
100
|
if [ $? -eq 0 ]; then
|
|
117
101
|
print_success "OpenClacky installed successfully via gem!"
|
|
118
102
|
return 0
|
|
@@ -122,46 +106,237 @@ install_via_gem() {
|
|
|
122
106
|
fi
|
|
123
107
|
}
|
|
124
108
|
|
|
109
|
+
# Install dependencies and Ruby on macOS
|
|
110
|
+
install_macos_dependencies() {
|
|
111
|
+
print_step "Installing macOS dependencies and Ruby..."
|
|
112
|
+
echo ""
|
|
113
|
+
|
|
114
|
+
# Install Homebrew (it will automatically install Xcode Command Line Tools if needed)
|
|
115
|
+
print_info "Checking Homebrew installation..."
|
|
116
|
+
if ! command_exists brew; then
|
|
117
|
+
print_info "Installing Homebrew..."
|
|
118
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
119
|
+
|
|
120
|
+
# Add Homebrew to PATH
|
|
121
|
+
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
|
|
122
|
+
export PATH="/opt/homebrew/bin:$PATH"
|
|
123
|
+
|
|
124
|
+
print_success "Homebrew installed successfully"
|
|
125
|
+
else
|
|
126
|
+
print_success "Homebrew already installed"
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# Install build dependencies
|
|
130
|
+
print_info "Installing build dependencies..."
|
|
131
|
+
if brew install openssl@3 libyaml gmp rust; then
|
|
132
|
+
print_success "Build dependencies installed"
|
|
133
|
+
else
|
|
134
|
+
print_error "Failed to install build dependencies"
|
|
135
|
+
return 1
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# Install mise for Ruby version management
|
|
139
|
+
print_info "Installing mise..."
|
|
140
|
+
if ! command_exists mise; then
|
|
141
|
+
if curl https://mise.run | sh; then
|
|
142
|
+
# Add mise to shell
|
|
143
|
+
if [ -f ~/.zshrc ]; then
|
|
144
|
+
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.zshrc
|
|
145
|
+
fi
|
|
146
|
+
if [ -f ~/.bash_profile ]; then
|
|
147
|
+
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bash_profile
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
151
|
+
eval "$(~/.local/bin/mise activate bash)"
|
|
152
|
+
|
|
153
|
+
print_success "mise installed successfully"
|
|
154
|
+
else
|
|
155
|
+
print_error "Failed to install mise"
|
|
156
|
+
return 1
|
|
157
|
+
fi
|
|
158
|
+
else
|
|
159
|
+
print_success "mise already installed"
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
# Install Ruby 3 via mise
|
|
163
|
+
print_info "Installing Ruby 3 via mise..."
|
|
164
|
+
if ~/.local/bin/mise use -g ruby@3; then
|
|
165
|
+
# Reload mise
|
|
166
|
+
eval "$(~/.local/bin/mise activate bash)"
|
|
167
|
+
print_success "Ruby 3 installed successfully"
|
|
168
|
+
else
|
|
169
|
+
print_error "Failed to install Ruby 3"
|
|
170
|
+
return 1
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
# Verify Ruby installation
|
|
174
|
+
if check_ruby; then
|
|
175
|
+
return 0
|
|
176
|
+
else
|
|
177
|
+
print_error "Ruby installation verification failed"
|
|
178
|
+
return 1
|
|
179
|
+
fi
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
# Install dependencies and Ruby on Ubuntu/Debian
|
|
183
|
+
install_ubuntu_dependencies() {
|
|
184
|
+
print_step "Installing Ubuntu dependencies and Ruby..."
|
|
185
|
+
echo ""
|
|
186
|
+
|
|
187
|
+
# Update package list
|
|
188
|
+
print_info "Updating package list..."
|
|
189
|
+
if sudo apt update; then
|
|
190
|
+
print_success "Package list updated"
|
|
191
|
+
else
|
|
192
|
+
print_error "Failed to update package list"
|
|
193
|
+
return 1
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# Install build dependencies
|
|
197
|
+
print_info "Installing build dependencies..."
|
|
198
|
+
if sudo apt install -y build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev git; then
|
|
199
|
+
print_success "Build dependencies installed"
|
|
200
|
+
else
|
|
201
|
+
print_error "Failed to install build dependencies"
|
|
202
|
+
return 1
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
# Install mise for Ruby version management
|
|
206
|
+
print_info "Installing mise..."
|
|
207
|
+
if ! command_exists mise; then
|
|
208
|
+
if curl https://mise.run | sh; then
|
|
209
|
+
# Add mise to shell
|
|
210
|
+
if [ -f ~/.bashrc ]; then
|
|
211
|
+
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
215
|
+
eval "$(~/.local/bin/mise activate bash)"
|
|
216
|
+
|
|
217
|
+
print_success "mise installed successfully"
|
|
218
|
+
else
|
|
219
|
+
print_error "Failed to install mise"
|
|
220
|
+
return 1
|
|
221
|
+
fi
|
|
222
|
+
else
|
|
223
|
+
print_success "mise already installed"
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
# Install Ruby 3 via mise
|
|
227
|
+
print_info "Installing Ruby 3 via mise..."
|
|
228
|
+
if ~/.local/bin/mise use -g ruby@3; then
|
|
229
|
+
# Reload mise
|
|
230
|
+
eval "$(~/.local/bin/mise activate bash)"
|
|
231
|
+
print_success "Ruby 3 installed successfully"
|
|
232
|
+
else
|
|
233
|
+
print_error "Failed to install Ruby 3"
|
|
234
|
+
return 1
|
|
235
|
+
fi
|
|
236
|
+
|
|
237
|
+
# Verify Ruby installation
|
|
238
|
+
if check_ruby; then
|
|
239
|
+
return 0
|
|
240
|
+
else
|
|
241
|
+
print_error "Ruby installation verification failed"
|
|
242
|
+
return 1
|
|
243
|
+
fi
|
|
244
|
+
}
|
|
245
|
+
|
|
125
246
|
# Suggest Ruby installation
|
|
126
247
|
suggest_ruby_installation() {
|
|
127
248
|
print_step "Ruby Installation Options"
|
|
128
249
|
echo ""
|
|
129
|
-
|
|
250
|
+
|
|
130
251
|
if [ "$OS" = "macOS" ]; then
|
|
131
|
-
print_info "
|
|
132
|
-
echo "
|
|
133
|
-
echo "
|
|
252
|
+
print_info "Automatic Installation (Recommended)"
|
|
253
|
+
echo " This script can automatically install Ruby and dependencies for you."
|
|
254
|
+
echo " Uses mise - a fast, polyglot tool version manager."
|
|
255
|
+
echo ""
|
|
256
|
+
read -p "Would you like to install Ruby and dependencies automatically? (y/n) " -n 1 -r
|
|
257
|
+
echo ""
|
|
258
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
259
|
+
install_macos_dependencies
|
|
260
|
+
return $?
|
|
261
|
+
fi
|
|
134
262
|
echo ""
|
|
135
|
-
print_info "
|
|
136
|
-
echo "
|
|
137
|
-
echo "
|
|
138
|
-
echo "
|
|
139
|
-
|
|
263
|
+
print_info "Manual Installation with mise:"
|
|
264
|
+
echo " # Install Homebrew (it will install Xcode Command Line Tools automatically)"
|
|
265
|
+
echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
|
|
266
|
+
echo ""
|
|
267
|
+
echo " # Install dependencies"
|
|
268
|
+
echo " brew install openssl@3 libyaml gmp rust"
|
|
269
|
+
echo ""
|
|
270
|
+
echo " # Install mise"
|
|
271
|
+
echo " curl https://mise.run | sh"
|
|
272
|
+
echo " echo 'eval \"\$(~/.local/bin/mise activate bash)\"' >> ~/.zshrc"
|
|
273
|
+
echo ""
|
|
274
|
+
echo " # Install Ruby 3"
|
|
275
|
+
echo " mise use -g ruby@3"
|
|
276
|
+
|
|
140
277
|
elif [ "$OS" = "Linux" ]; then
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
278
|
+
if [ "$DISTRO" = "ubuntu" ] || [ "$DISTRO" = "debian" ]; then
|
|
279
|
+
print_info "Automatic Installation (Recommended)"
|
|
280
|
+
echo " This script can automatically install Ruby and dependencies for you."
|
|
281
|
+
echo " Uses mise - a fast, polyglot tool version manager."
|
|
282
|
+
echo ""
|
|
283
|
+
read -p "Would you like to install Ruby and dependencies automatically? (y/n) " -n 1 -r
|
|
284
|
+
echo ""
|
|
285
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
286
|
+
install_ubuntu_dependencies
|
|
287
|
+
return $?
|
|
288
|
+
fi
|
|
289
|
+
echo ""
|
|
290
|
+
print_info "Manual Installation with mise (Ubuntu/Debian):"
|
|
291
|
+
echo " # Update and install dependencies"
|
|
292
|
+
echo " sudo apt update"
|
|
293
|
+
echo " sudo apt install -y build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev git"
|
|
294
|
+
echo ""
|
|
295
|
+
echo " # Install mise"
|
|
296
|
+
echo " curl https://mise.run | sh"
|
|
297
|
+
echo " echo 'eval \"\$(~/.local/bin/mise activate bash)\"' >> ~/.bashrc"
|
|
298
|
+
echo ""
|
|
299
|
+
echo " # Install Ruby 3"
|
|
300
|
+
echo " mise use -g ruby@3"
|
|
301
|
+
else
|
|
302
|
+
print_info "Manual Installation with mise (Other Linux):"
|
|
303
|
+
echo " # Install build dependencies (adjust for your distribution)"
|
|
304
|
+
echo " # Fedora/RHEL:"
|
|
305
|
+
echo " sudo dnf install -y gcc make openssl-devel libyaml-devel zlib-devel gmp-devel git rust"
|
|
306
|
+
echo ""
|
|
307
|
+
echo " # Install mise"
|
|
308
|
+
echo " curl https://mise.run | sh"
|
|
309
|
+
echo " echo 'eval \"\$(~/.local/bin/mise activate bash)\"' >> ~/.bashrc"
|
|
310
|
+
echo ""
|
|
311
|
+
echo " # Install Ruby 3"
|
|
312
|
+
echo " mise use -g ruby@3"
|
|
313
|
+
fi
|
|
314
|
+
|
|
315
|
+
elif [ "$OS" = "Windows" ]; then
|
|
316
|
+
print_info "Windows Subsystem for Linux (WSL) Installation (Recommended)"
|
|
317
|
+
echo " OpenClacky requires a Unix-like environment. We recommend using WSL."
|
|
318
|
+
echo ""
|
|
319
|
+
echo " 1. Open PowerShell or Windows Command Prompt in administrator mode"
|
|
320
|
+
echo " 2. Install WSL with Ubuntu 24.04:"
|
|
145
321
|
echo ""
|
|
146
|
-
|
|
147
|
-
echo " curl -sSL https://get.rvm.io | bash -s stable --ruby"
|
|
322
|
+
echo " wsl --install --distribution Ubuntu-24.04"
|
|
148
323
|
echo ""
|
|
149
|
-
|
|
150
|
-
echo "
|
|
151
|
-
echo "
|
|
152
|
-
echo " sudo apt-get install ruby-full"
|
|
324
|
+
echo " 3. Restart your computer if prompted"
|
|
325
|
+
echo " 4. Launch Ubuntu from the Start menu"
|
|
326
|
+
echo " 5. Run this installation script again inside Ubuntu:"
|
|
153
327
|
echo ""
|
|
154
|
-
echo "
|
|
155
|
-
echo "
|
|
328
|
+
echo " curl -fsSL https://raw.githubusercontent.com/clacky-ai/open-clacky/main/scripts/install.sh | bash"
|
|
329
|
+
echo ""
|
|
330
|
+
print_info "Learn more about WSL: https://learn.microsoft.com/en-us/windows/wsl/install"
|
|
156
331
|
fi
|
|
157
|
-
|
|
332
|
+
|
|
158
333
|
echo ""
|
|
159
334
|
print_info "After installing Ruby, run this script again or use:"
|
|
160
335
|
echo " gem install openclacky"
|
|
336
|
+
echo ""
|
|
337
|
+
print_info "Learn more about mise: https://mise.jdx.dev"
|
|
161
338
|
}
|
|
162
339
|
|
|
163
|
-
|
|
164
|
-
|
|
165
340
|
# Main installation logic
|
|
166
341
|
main() {
|
|
167
342
|
echo ""
|
|
@@ -173,49 +348,45 @@ main() {
|
|
|
173
348
|
echo "║ ║"
|
|
174
349
|
echo "╚═══════════════════════════════════════════════════════════╝"
|
|
175
350
|
echo ""
|
|
176
|
-
|
|
351
|
+
|
|
177
352
|
detect_os
|
|
178
|
-
|
|
179
|
-
# Strategy 1:
|
|
180
|
-
if [ "$OS" = "macOS" ] && command_exists brew; then
|
|
181
|
-
print_info "Homebrew detected, using it for installation (recommended)"
|
|
182
|
-
if install_via_homebrew; then
|
|
183
|
-
show_post_install_info
|
|
184
|
-
exit 0
|
|
185
|
-
fi
|
|
186
|
-
print_warning "Homebrew installation failed, trying Ruby gem installation..."
|
|
187
|
-
fi
|
|
188
|
-
|
|
189
|
-
# Strategy 2: Check Ruby and install via gem
|
|
353
|
+
|
|
354
|
+
# Strategy 1: Check Ruby and install via gem
|
|
190
355
|
if check_ruby; then
|
|
191
356
|
if install_via_gem; then
|
|
192
357
|
show_post_install_info
|
|
193
358
|
exit 0
|
|
194
359
|
fi
|
|
195
360
|
fi
|
|
196
|
-
|
|
197
|
-
# Strategy
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
361
|
+
|
|
362
|
+
# Strategy 2: Install Ruby on macOS/Ubuntu or suggest options
|
|
363
|
+
if [ "$OS" = "macOS" ] || [ "$OS" = "Linux" ]; then
|
|
364
|
+
print_warning "Ruby not found or version too old"
|
|
365
|
+
echo ""
|
|
366
|
+
if suggest_ruby_installation; then
|
|
367
|
+
# Try installing via gem after Ruby installation
|
|
368
|
+
if install_via_gem; then
|
|
369
|
+
show_post_install_info
|
|
370
|
+
exit 0
|
|
371
|
+
else
|
|
372
|
+
print_error "Failed to install OpenClacky gem"
|
|
373
|
+
exit 1
|
|
374
|
+
fi
|
|
375
|
+
else
|
|
376
|
+
# User declined or installation failed
|
|
377
|
+
print_info "Ruby installation was not completed"
|
|
378
|
+
print_info "Please install Ruby manually and run: gem install openclacky"
|
|
379
|
+
print_info "For more information, visit: https://github.com/clacky-ai/open-clacky"
|
|
380
|
+
exit 1
|
|
211
381
|
fi
|
|
382
|
+
else
|
|
383
|
+
print_error "Could not install OpenClacky automatically"
|
|
384
|
+
echo ""
|
|
385
|
+
suggest_ruby_installation
|
|
386
|
+
echo ""
|
|
387
|
+
print_info "For more information, visit: https://github.com/clacky-ai/open-clacky"
|
|
388
|
+
exit 1
|
|
212
389
|
fi
|
|
213
|
-
|
|
214
|
-
suggest_ruby_installation
|
|
215
|
-
echo ""
|
|
216
|
-
|
|
217
|
-
print_info "For more information, visit: https://github.com/clacky-ai/open-clacky"
|
|
218
|
-
exit 1
|
|
219
390
|
}
|
|
220
391
|
|
|
221
392
|
# Post-installation information
|
|
@@ -227,19 +398,25 @@ show_post_install_info() {
|
|
|
227
398
|
echo "║ ║"
|
|
228
399
|
echo "╚═══════════════════════════════════════════════════════════╝"
|
|
229
400
|
echo ""
|
|
401
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
402
|
+
echo ""
|
|
403
|
+
echo " ⚠️ ${YELLOW}IMPORTANT: Please restart your terminal${NC}"
|
|
404
|
+
echo ""
|
|
405
|
+
echo " After restarting, type: ${GREEN}openclacky${NC}"
|
|
406
|
+
echo ""
|
|
407
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
408
|
+
echo ""
|
|
230
409
|
print_step "Quick Start Guide:"
|
|
231
410
|
echo ""
|
|
232
411
|
print_info "1. Configure your API key:"
|
|
233
|
-
echo "
|
|
234
|
-
echo ""
|
|
235
|
-
print_info "2. Start chatting:"
|
|
236
|
-
echo " clacky chat"
|
|
412
|
+
echo " openclacky"
|
|
413
|
+
echo " > /config"
|
|
237
414
|
echo ""
|
|
238
|
-
print_info "
|
|
239
|
-
echo "
|
|
415
|
+
print_info "2. Create a new project:"
|
|
416
|
+
echo " > /new your-project-name"
|
|
240
417
|
echo ""
|
|
241
|
-
print_info "
|
|
242
|
-
echo "
|
|
418
|
+
print_info "3. Get help:"
|
|
419
|
+
echo " > /help"
|
|
243
420
|
echo ""
|
|
244
421
|
print_success "Happy coding! 🚀"
|
|
245
422
|
echo ""
|
data/scripts/uninstall.sh
CHANGED
|
@@ -50,7 +50,7 @@ uninstall_homebrew() {
|
|
|
50
50
|
if brew list openclacky >/dev/null 2>&1; then
|
|
51
51
|
print_step "Uninstalling via Homebrew..."
|
|
52
52
|
brew uninstall openclacky
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
# Optionally untap
|
|
55
55
|
if brew tap | grep -q "clacky-ai/openclacky"; then
|
|
56
56
|
read -p "$(echo -e ${YELLOW}?${NC}) Remove Homebrew tap (clacky-ai/openclacky)? [y/N] " -n 1 -r
|
|
@@ -60,7 +60,7 @@ uninstall_homebrew() {
|
|
|
60
60
|
print_success "Tap removed"
|
|
61
61
|
fi
|
|
62
62
|
fi
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
return 0
|
|
65
65
|
fi
|
|
66
66
|
fi
|
|
@@ -82,12 +82,12 @@ uninstall_gem() {
|
|
|
82
82
|
# Remove configuration files
|
|
83
83
|
remove_config() {
|
|
84
84
|
CONFIG_DIR="$HOME/.clacky"
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
if [ -d "$CONFIG_DIR" ]; then
|
|
87
87
|
print_warning "Configuration directory found: $CONFIG_DIR"
|
|
88
88
|
read -p "$(echo -e ${YELLOW}?${NC}) Remove configuration files (including API keys)? [y/N] " -n 1 -r
|
|
89
89
|
echo
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
92
92
|
rm -rf "$CONFIG_DIR"
|
|
93
93
|
print_success "Configuration removed"
|
|
@@ -106,24 +106,24 @@ main() {
|
|
|
106
106
|
echo "║ ║"
|
|
107
107
|
echo "╚═══════════════════════════════════════════════════════════╝"
|
|
108
108
|
echo ""
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
if ! check_installation; then
|
|
111
111
|
print_warning "OpenClacky does not appear to be installed"
|
|
112
112
|
exit 0
|
|
113
113
|
fi
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
UNINSTALLED=false
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
# Try Homebrew first
|
|
118
118
|
if uninstall_homebrew; then
|
|
119
119
|
UNINSTALLED=true
|
|
120
120
|
fi
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
# Try gem
|
|
123
123
|
if uninstall_gem; then
|
|
124
124
|
UNINSTALLED=true
|
|
125
125
|
fi
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
if [ "$UNINSTALLED" = false ]; then
|
|
128
128
|
print_error "Could not automatically uninstall OpenClacky"
|
|
129
129
|
print_info "You may need to uninstall manually:"
|
|
@@ -131,12 +131,12 @@ main() {
|
|
|
131
131
|
echo " - Via RubyGems: gem uninstall openclacky"
|
|
132
132
|
exit 1
|
|
133
133
|
fi
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
print_success "OpenClacky uninstalled successfully"
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
# Ask about config removal
|
|
138
138
|
remove_config
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
echo ""
|
|
141
141
|
print_success "Uninstallation complete!"
|
|
142
142
|
print_info "Thank you for using OpenClacky 👋"
|