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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05ce65a24427505768d5edd395ace486c9f7ede88a7abcb42770dce4138a319e
|
|
4
|
+
data.tar.gz: 400a1efafd35cddf6993ba3298830f13eaa1e3cb4502540191e638cb17b22b66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bef68ebcadc6a178a697592e2e92b09d8307d6bd789171a21eedb2b3296b23071fe761caf762dfe6e2e399ed76dcc028d232190ae8ce5652c9387337a9c6a39
|
|
7
|
+
data.tar.gz: f43e0362780a85166435f572ad42a38654d62f9acc66401e5c229bfd6f27605d75844ee232d3f334fbb8414a0b2d6686b2164a10eb4ebe4ef90b54a021bbf163
|
|
@@ -9,6 +9,17 @@ user-invocable: true
|
|
|
9
9
|
|
|
10
10
|
This skill helps users create well-structured, semantic git commits by analyzing changes and suggesting appropriate commit messages.
|
|
11
11
|
|
|
12
|
+
## ⚠️ CRITICAL REQUIREMENT: SINGLE-LINE COMMITS ONLY
|
|
13
|
+
|
|
14
|
+
**ALL commit messages created by this skill MUST be single-line only.**
|
|
15
|
+
|
|
16
|
+
- ✅ DO: `git commit -m "feat: add user authentication"`
|
|
17
|
+
- ❌ DON'T: Multi-line commits with body text
|
|
18
|
+
- ❌ DON'T: Multiple `-m` flags
|
|
19
|
+
- ❌ DON'T: Commit messages with `\n` or additional paragraphs
|
|
20
|
+
|
|
21
|
+
Keep commits concise and focused. If more detail is needed, suggest adding it separately in PR descriptions or documentation.
|
|
22
|
+
|
|
12
23
|
## Overview
|
|
13
24
|
|
|
14
25
|
This skill automates the process of reviewing git changes and creating meaningful, conventional commits following the semantic commit format (feat/fix/chore/test).
|
|
@@ -62,12 +73,14 @@ Based on the analysis, generate commit messages following the conventional commi
|
|
|
62
73
|
- `style`: Code style changes (formatting, whitespace)
|
|
63
74
|
- `perf`: Performance improvements
|
|
64
75
|
|
|
65
|
-
**
|
|
76
|
+
**CRITICAL GUIDELINES**:
|
|
77
|
+
- **MUST BE SINGLE-LINE**: Commit messages MUST be a single line only. DO NOT create multi-line commit messages.
|
|
66
78
|
- Keep messages concise (ideally under 50 characters)
|
|
67
79
|
- Use imperative mood ("add feature" not "added feature")
|
|
68
80
|
- Don't end with a period
|
|
69
81
|
- Be specific but brief
|
|
70
82
|
- One logical change per commit
|
|
83
|
+
- If more detail is needed, suggest adding it in PR description or commit body separately, but the initial commit MUST be single-line
|
|
71
84
|
|
|
72
85
|
**Examples**:
|
|
73
86
|
- `feat: add user authentication`
|
|
@@ -120,10 +133,16 @@ For each approved commit:
|
|
|
120
133
|
# Stage specific files
|
|
121
134
|
git add <file1> <file2> ...
|
|
122
135
|
|
|
123
|
-
# Create commit with message
|
|
136
|
+
# Create commit with SINGLE-LINE message only
|
|
124
137
|
git commit -m "<type>: <description>"
|
|
125
138
|
```
|
|
126
139
|
|
|
140
|
+
**IMPORTANT**:
|
|
141
|
+
- Use ONLY `git commit -m "single line message"` format
|
|
142
|
+
- DO NOT use multi-line commits with additional body text
|
|
143
|
+
- DO NOT use `-m` flag multiple times
|
|
144
|
+
- Keep the commit message as a single, concise line
|
|
145
|
+
|
|
127
146
|
Provide feedback after each commit:
|
|
128
147
|
- Confirm successful commit
|
|
129
148
|
- Show commit hash
|
|
@@ -151,8 +170,12 @@ git diff <file>
|
|
|
151
170
|
# Stage files
|
|
152
171
|
git add <file>
|
|
153
172
|
|
|
154
|
-
# Create commit
|
|
155
|
-
git commit -m "
|
|
173
|
+
# Create commit (SINGLE-LINE only)
|
|
174
|
+
git commit -m "type: single line description"
|
|
175
|
+
|
|
176
|
+
# NEVER use multi-line format like:
|
|
177
|
+
# git commit -m "title" -m "body" ❌ DON'T DO THIS
|
|
178
|
+
# git commit -m "title\n\nbody" ❌ DON'T DO THIS
|
|
156
179
|
|
|
157
180
|
# View commit history
|
|
158
181
|
git log --oneline -n 5
|
|
@@ -203,10 +226,12 @@ Next steps: Review with 'git log' or push with 'git push'
|
|
|
203
226
|
## Best Practices
|
|
204
227
|
|
|
205
228
|
### Commit Message Rules
|
|
229
|
+
- **MUST be single-line only** - Never use multi-line commit messages
|
|
206
230
|
- Start with lowercase (except proper nouns)
|
|
207
231
|
- Use present tense imperative
|
|
208
232
|
- Be specific but concise
|
|
209
233
|
- Focus on "what" and "why", not "how"
|
|
234
|
+
- Maximum 72 characters for the single line
|
|
210
235
|
|
|
211
236
|
### Commit Organization
|
|
212
237
|
- One logical change per commit
|
data/.clackyrules
CHANGED
|
@@ -25,7 +25,8 @@ It provides chat functionality and autonomous AI agent capabilities with tool us
|
|
|
25
25
|
- **IMPORTANT**: All code comments must be written in English
|
|
26
26
|
- Add descriptive comments for complex logic
|
|
27
27
|
- Use clear, self-documenting code with English naming
|
|
28
|
-
- **IMPORTANT**: Always use inline `private` with method definitions (e.g., `private def method_name`). Do NOT use standalone `private` keyword
|
|
28
|
+
- **IMPORTANT**: Always use inline `private` with instance method definitions (e.g., `private def method_name`). Do NOT use standalone `private` keyword
|
|
29
|
+
- **IMPORTANT**: For class methods (`def self.method_name`), do NOT use `private`. Class methods should be public
|
|
29
30
|
|
|
30
31
|
### Architecture Patterns
|
|
31
32
|
- Tools inherit from `Clacky::Tools::Base`
|
|
@@ -45,6 +46,7 @@ It provides chat functionality and autonomous AI agent capabilities with tool us
|
|
|
45
46
|
- **IMPORTANT**: When developing new features, write RSpec tests as needed and ensure they pass
|
|
46
47
|
- **DO NOT** write custom test scripts unless explicitly requested by the user
|
|
47
48
|
- **DO NOT** create markdown documentation unless explicitly requested by the user
|
|
49
|
+
- **IMPORTANT**: When testing clacky commands or debugging, always use `bundle exec ruby bin/clacky` instead of the global `clacky` command. The global command loads the system-installed gem version (e.g., `openclacky-0.7.0`), not your local development code
|
|
48
50
|
|
|
49
51
|
### Tool Development
|
|
50
52
|
When adding new tools:
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,107 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.7.1] - 2026-02-24
|
|
11
|
+
|
|
12
|
+
This release brings significant user experience improvements, new interaction modes, and enhanced agent capabilities.
|
|
13
|
+
|
|
14
|
+
### 🎯 Major Features
|
|
15
|
+
|
|
16
|
+
**Subagent System**
|
|
17
|
+
- Deploy subagent for parallel task execution
|
|
18
|
+
- Subagent mode with invoke_skill tool and code-explorer skill integration
|
|
19
|
+
- Environment variable support and model type system
|
|
20
|
+
|
|
21
|
+
**Command Experience**
|
|
22
|
+
- Tab completion for slash commands
|
|
23
|
+
- Ctrl+O toggle expand in diff view
|
|
24
|
+
- JSON mode for structured output
|
|
25
|
+
- Streamlined command selection workflow with improved filtering
|
|
26
|
+
|
|
27
|
+
**Agent Improvements**
|
|
28
|
+
- Idle compression with auto-trigger (180s timer)
|
|
29
|
+
- Improved interrupt handling for tool execution
|
|
30
|
+
- Preview display for edit and write tools in auto-approve mode
|
|
31
|
+
- Enable preview display in auto-approve mode
|
|
32
|
+
|
|
33
|
+
**Configuration UI**
|
|
34
|
+
- Auto-save to config modal
|
|
35
|
+
- Improved model management UI
|
|
36
|
+
- Better error handling and validation
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
- Quick start guides in English and Chinese
|
|
40
|
+
- Config example and tests for AgentConfig
|
|
41
|
+
|
|
42
|
+
### Improved
|
|
43
|
+
- Refactored agent architecture (split agent.rb, moved file locations)
|
|
44
|
+
- Simplified thread management in chat command
|
|
45
|
+
- Dynamic width ratio instead of fixed MAX_CONTENT_WIDTH
|
|
46
|
+
- API error messages with HTML detection and truncation
|
|
47
|
+
- Help command handling
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- Removed deprecated Config class (replaced by AgentConfig)
|
|
51
|
+
- Removed confirm_edits permission mode
|
|
52
|
+
- Removed keep_recent_messages configuration
|
|
53
|
+
- Removed default model value
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- Use ToolCallError instead of generic Error in tool registry
|
|
57
|
+
- Handle AgentInterrupted exception during idle compression
|
|
58
|
+
- Handle XML tag contamination in JSON tool parameters
|
|
59
|
+
- Prevent modal flickering on validation failure
|
|
60
|
+
- Update agent client when switching models to prevent stale config
|
|
61
|
+
- Update is_safe_operation to not use removed editing_tool? method
|
|
62
|
+
|
|
63
|
+
### More
|
|
64
|
+
- Optimize markdown horizontal rule rendering
|
|
65
|
+
- Add debug logging throughout codebase
|
|
66
|
+
|
|
67
|
+
## [0.7.0] - 2026-02-06
|
|
68
|
+
|
|
69
|
+
This is a major release with significant improvements to skill system, conversation memory management, and user experience.
|
|
70
|
+
|
|
71
|
+
### 🎯 Major Features
|
|
72
|
+
|
|
73
|
+
**Skill System**
|
|
74
|
+
- Complete skill framework allowing users to extend AI capabilities with custom workflows
|
|
75
|
+
- Skills can be invoked using shorthand syntax (e.g., `/commit`, `/gem-release`)
|
|
76
|
+
- Support for user-created skills in `.clacky/skills/` directory
|
|
77
|
+
- Built-in skills: commit (smart Git helper), gem-release (automated publishing)
|
|
78
|
+
|
|
79
|
+
**Memory Compression**
|
|
80
|
+
- Intelligent message compression to handle long conversations efficiently
|
|
81
|
+
- LLM-based compression strategy that preserves context while reducing tokens
|
|
82
|
+
- Automatic compression triggered based on message count and token usage
|
|
83
|
+
- Significant reduction in API costs for extended sessions
|
|
84
|
+
|
|
85
|
+
**Configuration Improvements**
|
|
86
|
+
- API key validation on startup with helpful prompts
|
|
87
|
+
- Interactive configuration UI with modal components
|
|
88
|
+
- Source tracking for configuration (file, environment, defaults)
|
|
89
|
+
- Better error messages and user guidance
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
- Request user feedback tool for interactive prompts during execution
|
|
93
|
+
- Version display in welcome banner
|
|
94
|
+
- File size limits for file_reader tool to prevent performance issues
|
|
95
|
+
- Debug logging throughout the codebase
|
|
96
|
+
|
|
97
|
+
### Improved
|
|
98
|
+
- CLI output formatting and readability
|
|
99
|
+
- Error handling with comprehensive debug information
|
|
100
|
+
- Test coverage with 367 passing tests
|
|
101
|
+
- Tool call output optimization for cleaner logs
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
- Simplified CLI architecture by removing unused code
|
|
105
|
+
- Enhanced modal component with new configuration features
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
- Message compression edge cases
|
|
109
|
+
- Various test spec improvements
|
|
110
|
+
|
|
10
111
|
## [0.6.4] - 2026-02-03
|
|
11
112
|
|
|
12
113
|
### Added
|
|
@@ -176,7 +277,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
176
277
|
|
|
177
278
|
### Added
|
|
178
279
|
- **Agent Mode**: Autonomous AI agent with tool execution capabilities
|
|
179
|
-
- **Built-in Tools**:
|
|
280
|
+
- **Built-in Tools**:
|
|
180
281
|
- `safe_shell` - Safe shell command execution with security checks
|
|
181
282
|
- `file_reader` - Read file contents
|
|
182
283
|
- `write` - Create/overwrite files with diff preview
|
|
@@ -188,7 +289,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
188
289
|
- `todo_manager` - Task planning and tracking
|
|
189
290
|
- `run_project` - Project dev server management
|
|
190
291
|
- **Session Management**: Save, resume, and list conversation sessions
|
|
191
|
-
- **Permission Modes**:
|
|
292
|
+
- **Permission Modes**:
|
|
192
293
|
- `auto_approve` - Automatically execute all tools
|
|
193
294
|
- `confirm_safes` - Auto-execute safe operations, confirm risky ones
|
|
194
295
|
- `confirm_edits` - Confirm file edits only
|
data/README.md
CHANGED
|
@@ -1,75 +1,66 @@
|
|
|
1
1
|
# OpenClacky
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
[](https://github.com/clacky-ai/open-clacky/actions)
|
|
4
|
+
[](https://rubygems.org/gems/openclacky)
|
|
5
|
+
[](https://www.ruby-lang.org)
|
|
6
|
+
[](https://rubygems.org/gems/openclacky)
|
|
7
|
+
[](LICENSE.txt)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- 🤖 Autonomous AI agent with tool use capabilities
|
|
9
|
-
- 📝 Enhanced input with multi-line support and Unicode (Chinese, etc.)
|
|
10
|
-
- 🖼️ Paste images from clipboard (macOS/Linux)
|
|
11
|
-
- 🚀 Single-message mode for quick queries
|
|
12
|
-
- 🔐 Secure API key management
|
|
13
|
-
- 📝 Multi-turn conversation support
|
|
14
|
-
- 🎨 Colorful terminal output
|
|
15
|
-
- 🌐 OpenAI-compatible API support (OpenAI, Gitee AI, DeepSeek, etc.)
|
|
16
|
-
- 🛠️ Rich built-in tools: file operations, web search, code execution, and more
|
|
17
|
-
- ⚡ Prompt caching support for Claude models (reduces costs up to 90%)
|
|
9
|
+
OpenClacky = Lovable + Supabase
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
**OpenClacky** is a CLI tool for building full-stack web applications — no technical background required. We spent months crafting a **Rails for AI** full-stack architecture that is fully production-ready, with one-click deployment, isolated dev/production environments, and automatic backups.
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
OpenClacky's goal is to deliver the best balance of **AI quality, AI cost, and AI speed**.
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
## Quick start
|
|
24
16
|
|
|
25
17
|
```bash
|
|
26
|
-
|
|
18
|
+
$ openclacky
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
- `/config` — Set your API key, model, and base URL
|
|
22
|
+
- `/new <project-name>` — Create a new project
|
|
23
|
+
- Type your requirements and start building
|
|
24
|
+
|
|
25
|
+
## Why OpenClacky?
|
|
26
|
+
|
|
27
|
+
| | **Claude Code** | **Lovable + Supabase** | **OpenClacky** |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| **Target Users** | Professional developers | Non-technical users | Non-technical users |
|
|
30
|
+
| **Tech Stack** | Any | React + Supabase | Rails (full-stack) |
|
|
31
|
+
| **Full-Stack Integration** | ❌ DIY | ⚠️ Frontend/backend split | ✅ Unified full-stack |
|
|
32
|
+
| **Production-Ready** | ❌ Manual setup | ⚠️ Relies on third-party | ✅ Built-in |
|
|
33
|
+
| **One-Click Deploy** | ❌ | ⚠️ Platform lock-in | ✅ Deploy anywhere |
|
|
34
|
+
| **Dev/Prod Isolation** | ❌ | ❌ | ✅ Automatic |
|
|
35
|
+
| **Automatic Backups** | ❌ | ⚠️ Paid feature | ✅ Built-in |
|
|
36
|
+
| **AI Cost Control** | ❌ Pay per token | ❌ Subscription | ✅ Optimally balanced |
|
|
37
|
+
| **Data Ownership** | ✅ | ❌ Platform-owned | ✅ Fully yours |
|
|
38
|
+
| **Interface** | Terminal | Web UI | Terminal |
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
## Features
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
- [x] `/new <project-name>` — Scaffold a full-stack Rails web app in seconds
|
|
43
|
+
- [x] **Skills system** — Specialized AI workflows for deploy, frontend design, PDF, PPTX, and more
|
|
44
|
+
- [x] **Cost monitoring & compression** — Real-time cost tracking, automatic message compression (up to 90% savings)
|
|
45
|
+
- [x] **One-click deployment** — Ship to production with a single command (with Clacky CDE)
|
|
46
|
+
- [x] **Autonomous AI agent** — Multi-step task execution with undo/redo
|
|
47
|
+
- [x] **Multi-provider support** — OpenAI, Anthropic, DeepSeek, and any OpenAI-compatible API
|
|
48
|
+
- [ ] **Time Machine** — Visual history to rewind and branch any point in your project *(coming soon)*
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
brew tap clacky-ai/openclacky
|
|
41
|
-
brew install openclacky
|
|
42
|
-
```
|
|
50
|
+
## Installation
|
|
43
51
|
|
|
44
|
-
### Method
|
|
52
|
+
### Method 1: One-line Install (Recommended)
|
|
45
53
|
|
|
46
54
|
```bash
|
|
47
|
-
|
|
55
|
+
/bin/bash -c "$(curl -sSL https://raw.githubusercontent.com/clacky-ai/open-clacky/main/scripts/install.sh)"
|
|
48
56
|
```
|
|
49
57
|
|
|
50
|
-
### Method
|
|
58
|
+
### Method 2: RubyGems
|
|
51
59
|
|
|
52
|
-
|
|
53
|
-
git clone https://github.com/clacky-ai/open-clacky.git
|
|
54
|
-
cd open-clacky
|
|
55
|
-
bundle install
|
|
56
|
-
bin/clacky
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### System Requirements
|
|
60
|
-
|
|
61
|
-
- **Ruby**: >= 3.1.0 (automatically handled by Homebrew)
|
|
62
|
-
- **OS**: macOS, Linux, or Windows (WSL)
|
|
63
|
-
|
|
64
|
-
### Uninstallation
|
|
60
|
+
**Requirements:** Ruby >= 3.1.0
|
|
65
61
|
|
|
66
62
|
```bash
|
|
67
|
-
|
|
68
|
-
curl -sSL https://raw.githubusercontent.com/clacky-ai/open-clacky/main/scripts/uninstall.sh | bash
|
|
69
|
-
|
|
70
|
-
# Or manually
|
|
71
|
-
brew uninstall openclacky # If installed via Homebrew
|
|
72
|
-
gem uninstall openclacky # If installed via gem
|
|
63
|
+
gem install openclacky
|
|
73
64
|
```
|
|
74
65
|
|
|
75
66
|
## Configuration
|
|
@@ -77,141 +68,59 @@ gem uninstall openclacky # If installed via gem
|
|
|
77
68
|
Before using Clacky, you need to configure your settings:
|
|
78
69
|
|
|
79
70
|
```bash
|
|
80
|
-
|
|
71
|
+
$ openclacky
|
|
72
|
+
|
|
73
|
+
- /config
|
|
81
74
|
```
|
|
82
75
|
|
|
83
76
|
You'll be prompted to enter:
|
|
84
77
|
- **API Key**: Your API key from any OpenAI-compatible provider
|
|
85
|
-
- **Model**: Model name
|
|
86
|
-
- **Base URL**: OpenAI-compatible API endpoint
|
|
87
|
-
|
|
88
|
-
To view your current configuration:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
clacky config show
|
|
92
|
-
```
|
|
78
|
+
- **Model**: Model name
|
|
79
|
+
- **Base URL**: OpenAI-compatible API endpoint
|
|
93
80
|
|
|
94
81
|
## Usage
|
|
95
82
|
|
|
96
|
-
###
|
|
97
|
-
|
|
98
|
-
Run an autonomous AI agent in interactive mode. The agent can use tools to complete tasks and runs in a continuous loop, allowing you to have multi-turn conversations with tool use capabilities.
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Start interactive agent (will prompt for tasks)
|
|
102
|
-
clacky agent
|
|
103
|
-
|
|
104
|
-
# Start with an initial task, then continue interactively
|
|
105
|
-
clacky agent "Create a README.md file for my project"
|
|
106
|
-
|
|
107
|
-
# Auto-approve all tool executions
|
|
108
|
-
clacky agent --mode=auto_approve
|
|
109
|
-
|
|
110
|
-
# Work in a specific project directory
|
|
111
|
-
clacky agent --path /path/to/project
|
|
112
|
-
|
|
113
|
-
#### Permission Modes
|
|
114
|
-
|
|
115
|
-
- `auto_approve` - Automatically execute all tools (use with caution)
|
|
116
|
-
- `confirm_safes` - Auto-approve read-only tools, confirm edits
|
|
117
|
-
- `plan_only` - Generate plan without executing
|
|
118
|
-
|
|
119
|
-
#### Agent Options
|
|
83
|
+
### Scenario 1: Create a new web app
|
|
120
84
|
|
|
121
85
|
```bash
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
86
|
+
$ openclacky
|
|
87
|
+
> /new my-blog
|
|
88
|
+
# OpenClacky scaffolds a full-stack Rails app in seconds
|
|
89
|
+
# > Add a posts page with title, content, and author fields
|
|
90
|
+
# > Deploy to production
|
|
91
|
+
# > exit
|
|
125
92
|
```
|
|
126
93
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
The agent includes intelligent cost control features:
|
|
130
|
-
|
|
131
|
-
- **Automatic Message Compression**: When conversation history grows beyond 100 messages, the agent automatically compresses older messages into a summary, keeping only the system prompt and the most recent 20 messages. This dramatically reduces token costs for long-running tasks (achieves ~60% compression ratio).
|
|
132
|
-
|
|
133
|
-
- **Compression Settings**:
|
|
134
|
-
- `enable_compression`: Enable/disable automatic compression (default: true)
|
|
135
|
-
- `keep_recent_messages`: Number of recent messages to preserve (default: 20)
|
|
136
|
-
- Compression triggers at: ~100 messages (keep_recent_messages + 80)
|
|
137
|
-
|
|
138
|
-
### List Available Tools
|
|
139
|
-
|
|
140
|
-
View all built-in tools:
|
|
94
|
+
### Scenario 2: Build a feature in an existing project
|
|
141
95
|
|
|
142
96
|
```bash
|
|
143
|
-
|
|
97
|
+
$ cd ~/my-project && openclacky
|
|
98
|
+
# > Add user authentication with email and password
|
|
99
|
+
# > Write tests for the auth flow
|
|
100
|
+
# > exit
|
|
144
101
|
```
|
|
145
102
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- **todo_manager** - Manage TODO items for task planning and tracking
|
|
149
|
-
- **file_reader** - Read file contents
|
|
150
|
-
- **write** - Create or overwrite files
|
|
151
|
-
- **edit** - Make precise edits to existing files
|
|
152
|
-
- **glob** - Find files by pattern matching
|
|
153
|
-
- **grep** - Search file contents with regex
|
|
154
|
-
- **shell** - Execute shell commands
|
|
155
|
-
- **web_search** - Search the web for information
|
|
156
|
-
- **web_fetch** - Fetch and parse web page content
|
|
157
|
-
|
|
158
|
-
### Available Commands
|
|
103
|
+
### Scenario 3: Ask questions about your codebase
|
|
159
104
|
|
|
160
105
|
```bash
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
clacky version # Show clacky version
|
|
166
|
-
clacky help # Show help information
|
|
106
|
+
$ openclacky
|
|
107
|
+
# > How does the payment module work?
|
|
108
|
+
# > Where is the user session managed?
|
|
109
|
+
# > exit
|
|
167
110
|
```
|
|
168
111
|
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
### Agent Examples
|
|
112
|
+
## Install from Source
|
|
172
113
|
|
|
173
114
|
```bash
|
|
174
|
-
|
|
175
|
-
clacky
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
# > Now add more items to the TODO list
|
|
179
|
-
# > exit
|
|
180
|
-
|
|
181
|
-
# Auto-approve mode for trusted operations
|
|
182
|
-
clacky agent --mode=auto_approve --path ~/my-project
|
|
183
|
-
# > Count all lines of code
|
|
184
|
-
# > Create a summary report
|
|
185
|
-
# > exit
|
|
186
|
-
|
|
187
|
-
# Using TODO manager for complex tasks
|
|
188
|
-
clacky agent "Implement a new feature with user authentication"
|
|
189
|
-
# Agent will:
|
|
190
|
-
# 1. Use todo_manager to create a task plan
|
|
191
|
-
# 2. Add todos: "Research current auth patterns", "Design auth flow", etc.
|
|
192
|
-
# 3. Complete each todo step by step
|
|
193
|
-
# 4. Mark todos as completed as work progresses
|
|
194
|
-
# > exit
|
|
115
|
+
git clone https://github.com/clacky-ai/open-clacky.git
|
|
116
|
+
cd open-clacky
|
|
117
|
+
bundle install
|
|
118
|
+
bin/clacky
|
|
195
119
|
```
|
|
196
120
|
|
|
197
121
|
## Development
|
|
198
122
|
|
|
199
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/
|
|
200
|
-
|
|
201
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
202
|
-
|
|
203
|
-
### Testing Agent Features
|
|
204
|
-
|
|
205
|
-
After making changes to agent-related functionality (tools, system prompts, agent logic, etc.), test with this command:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
# Test agent with a complex multi-step task using auto-approve mode
|
|
209
|
-
echo "Create a simple calculator project with index.html, style.css, and script.js files" | \
|
|
210
|
-
bin/clacky agent --mode=auto_approve --path=tmp --max-iterations=20
|
|
211
|
-
|
|
212
|
-
# Expected: Agent should plan tasks (add TODOs), execute them (create files),
|
|
213
|
-
# and track progress (mark TODOs as completed)
|
|
214
|
-
```
|
|
123
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/clacky` for an interactive prompt that will allow you to experiment.
|
|
215
124
|
|
|
216
125
|
## Contributing
|
|
217
126
|
|
data/bin/clarky
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Display typo correction message
|
|
4
|
+
warn "\nNote: 'clarky' appears to be a typo!"
|
|
5
|
+
warn "The correct command is 'clacky'"
|
|
6
|
+
|
|
7
|
+
warn "\nRedirecting to the correct command...\n\n"
|
|
8
|
+
|
|
9
|
+
# Redirect to clacky
|
|
10
|
+
clacky_path = File.expand_path("clacky", __dir__)
|
|
11
|
+
exec(clacky_path, *ARGV)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# OpenClacky 使用指南
|
|
2
|
+
|
|
3
|
+
## 安装
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
gem install openclacky
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
**系统要求:** Ruby >= 3.1
|
|
10
|
+
|
|
11
|
+
## 快速开始
|
|
12
|
+
|
|
13
|
+
### 1. 启动 Clacky
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
clacky
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. 配置 API Key(首次使用)
|
|
20
|
+
|
|
21
|
+
在聊天界面中输入:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
/config
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
然后按提示设置你的 API key:
|
|
28
|
+
- **OpenAI**:从 https://platform.openai.com/api-keys 获取
|
|
29
|
+
- **Anthropic**:从 https://console.anthropic.com/ 获取
|
|
30
|
+
- **MiniMax**:国内推荐,https://platform.minimaxi.com/
|
|
31
|
+
- **OpenRouter**:聚合多个 AI 模型,https://openrouter.ai/
|
|
32
|
+
|
|
33
|
+
### 3. 开始对话
|
|
34
|
+
|
|
35
|
+
直接在聊天框输入你的问题或需求:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
帮我写一个解析 CSV 文件的 Ruby 脚本
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
创建一个网页爬虫提取文章标题
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 核心功能
|
|
46
|
+
|
|
47
|
+
### 🎯 自主代理模式
|
|
48
|
+
Clacky 可以自动执行复杂任务,内置多种工具:
|
|
49
|
+
- **文件操作**:读取、写入、编辑、搜索文件
|
|
50
|
+
- **网页访问**:浏览网页、搜索信息
|
|
51
|
+
- **代码执行**:运行 shell 命令、测试代码
|
|
52
|
+
- **项目管理**:Git 操作、测试、部署
|
|
53
|
+
|
|
54
|
+
### 🔌 技能系统
|
|
55
|
+
使用简写命令调用强大的技能:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/commit # 智能 Git 提交助手
|
|
59
|
+
/gem-release # 自动化 gem 发布流程
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
你还可以在 `.clacky/skills/` 目录创建自己的技能!
|
|
63
|
+
|
|
64
|
+
### 💬 智能记忆管理
|
|
65
|
+
- **自动压缩**长对话内容
|
|
66
|
+
- **保留上下文**同时降低 token 成本
|
|
67
|
+
- **智能总结**对话历史
|
|
68
|
+
|
|
69
|
+
### ⚙️ 简单配置
|
|
70
|
+
- 交互式设置向导
|
|
71
|
+
- 支持多个 API 提供商
|
|
72
|
+
- 成本追踪和使用限制
|
|
73
|
+
- 常用场景的智能默认值
|
|
74
|
+
|
|
75
|
+
## 聊天中的常用命令
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/config # 配置 API 设置
|
|
79
|
+
/help # 显示可用命令
|
|
80
|
+
/skills # 列出可用技能
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 为什么选择 OpenClacky?
|
|
84
|
+
|
|
85
|
+
✅ **安装简单** - 一条命令安装,立即开始对话
|
|
86
|
+
✅ **功能强大** - 自主执行复杂任务
|
|
87
|
+
✅ **可扩展** - 为你的工作流创建自定义技能
|
|
88
|
+
✅ **省钱高效** - 智能记忆压缩节省 token 费用
|
|
89
|
+
✅ **多平台** - 支持 OpenAI、Anthropic、MiniMax、OpenRouter 等
|
|
90
|
+
✅ **质量保证** - 367+ 测试用例确保可靠性
|
|
91
|
+
|
|
92
|
+
## 了解更多
|
|
93
|
+
|
|
94
|
+
- GitHub:https://github.com/clacky-ai/open-clacky
|
|
95
|
+
- 问题反馈:https://github.com/clacky-ai/open-clacky/issues
|
|
96
|
+
- 当前版本:0.7.0
|