Skip to content

Commit 7ce309d

Browse files
committed
feat: add enabled/disabled toggle for tools in tools.yaml
- Add 'enabled' key to tools.yaml to show/hide tools from menus - Tools with enabled: false are hidden from interactive menus - Default is true (backward compatible) - Disabled Zed, Qoder, Neovate as they are still under development Changes: - code_assistant_manager/tools/registry.py: Add is_enabled() and get_enabled_tools() methods - code_assistant_manager/tools/__init__.py: Filter disabled tools in get_registered_tools() - code_assistant_manager/tools.yaml: Add enabled key to all tools - Update docs: README.md, README_zh.md, DEVELOPER_GUIDE.md, API_DOCUMENTATION.md, UPGRADE_FUNCTIONALITY.md - Fix CodeBuddy prompt sync support in feature matrix
1 parent d4ebcd9 commit 7ce309d

File tree

9 files changed

+108
-13
lines changed

9 files changed

+108
-13
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ CAM supports **13 AI coding assistants**:
6262

6363
| Feature | Claude | Codex | Gemini | Qwen | CodeBuddy | Droid | Copilot |
6464
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
65-
| **Agent** Management ||||||| |
66-
| **Prompt** Syncing ||||| |||
65+
| **Agent** Management ||||||| |
66+
| **Prompt** Syncing ||||| |||
6767
| **Skill** Installation ||||||||
6868
| **Plugin** Support ||||||||
6969
| **MCP** Integration ||||||||
7070

7171
**MCP Integration** is supported across all 13 assistants including: Claude, Codex, Gemini, Qwen, Copilot, CodeBuddy, Droid, iFlow, Zed, Qoder, Neovate, Crush, and Cursor.
7272

73+
> **Note:** Some tools (Zed, Qoder, Neovate) are disabled by default in the menu as they are still under development. You can enable them in `tools.yaml` by setting `enabled: true`.
74+
7375
## Installation
7476

7577
```bash

README_zh.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ CAM 支持 **13 个 AI 编码助手**:
6262

6363
| 功能 | Claude | Codex | Gemini | Qwen | CodeBuddy | Droid | Copilot |
6464
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
65-
| **代理**管理 ||||||| |
66-
| **提示词**同步 ||||| |||
65+
| **代理**管理 ||||||| |
66+
| **提示词**同步 ||||| |||
6767
| **技能**安装 ||||||||
6868
| **插件**支持 ||||||||
6969
| **MCP** 集成 ||||||||
7070

7171
**MCP 集成**支持所有 13 个助手,包括:Claude、Codex、Gemini、Qwen、Copilot、CodeBuddy、Droid、iFlow、Zed、Qoder、Neovate、Crush 和 Cursor。
7272

73+
> **注意:** 部分工具(Zed、Qoder、Neovate)默认在菜单中隐藏,因为它们仍在开发中。您可以在 `tools.yaml` 中设置 `enabled: true` 来启用它们。
74+
7375
## 安装
7476

7577
```bash

code_assistant_manager/prompts/codebuddy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def tool_name(self) -> str:
1111

1212
@property
1313
def _default_user_prompt_path(self) -> Optional[Path]:
14-
# CodeBuddy does not support a user-level prompt file
14+
# CodeBuddy supports a user-level prompt file (handled in get_prompt_file_path)
1515
return None
1616

1717
@property

code_assistant_manager/tools.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
tools:
22
gemini-cli:
3+
enabled: true
34
install_cmd: npm install -g @google/gemini-cli@latest
45
cli_command: gemini
56
description: "Google Gemini CLI"
@@ -19,6 +20,7 @@ tools:
1920
- "~/.gemini/settings.json (security section removed if present before launch)"
2021

2122
openai-codex:
23+
enabled: true
2224
install_cmd: npm install -g @openai/codex@latest
2325
cli_command: codex
2426
description: "OpenAI Codex CLI"
@@ -52,6 +54,7 @@ tools:
5254
- "-p custom"
5355

5456
qwen-code:
57+
enabled: true
5558
install_cmd: npm install -g @qwen-code/qwen-code@latest
5659
cli_command: qwen
5760
description: "Qwen Code CLI"
@@ -79,6 +82,7 @@ tools:
7982
injected: []
8083

8184
claude-code:
85+
enabled: true
8286
install_cmd: curl -fsSL https://claude.ai/install.sh | bash
8387
cli_command: claude
8488
description: "Claude Code CLI"
@@ -113,6 +117,7 @@ tools:
113117
injected: []
114118

115119
copilot-api:
120+
enabled: true
116121
install_cmd: npm install -g @github/copilot
117122
cli_command: copilot
118123
description: "GitHub Copilot CLI"
@@ -131,6 +136,7 @@ tools:
131136
- "--banner"
132137

133138
codebuddy:
139+
enabled: true
134140
install_cmd: npm install -g "@tencent-ai/codebuddy-code@latest"
135141
cli_command: codebuddy
136142
description: "Tencent CodeBuddy CLI"
@@ -158,6 +164,7 @@ tools:
158164
- "--model {selected_model}"
159165

160166
droid:
167+
enabled: true
161168
install_cmd: curl -fsSL https://app.factory.ai/cli | sh
162169
cli_command: droid
163170
description: "Factory.ai Droid CLI"
@@ -194,6 +201,7 @@ tools:
194201
- "~/.factory/config.json containing custom_models entries with base_url, api_key, provider, and max_tokens"
195202

196203
iflow:
204+
enabled: true
197205
install_cmd: npm i -g @iflow-ai/iflow-cli
198206
cli_command: iflow
199207
description: "iFlow CLI"
@@ -221,16 +229,19 @@ tools:
221229
injected: []
222230

223231
zed:
232+
enabled: false
224233
install_cmd: curl -f https://zed.dev/install.sh | sh
225234
cli_command: zed
226235
description: "Zed Editor - to be implemented"
227236

228237
qodercli:
238+
enabled: false
229239
install_cmd: npm install -g @qoder-ai/qodercli
230240
cli_command: qodercli
231241
description: "Qoder CLI - to be implemented"
232242

233243
neovate:
244+
enabled: false
234245
install_cmd: npm i @neovate/code -g
235246
cli_command: neovate
236247
description: "Neovate Code CLI - to be implemented"
@@ -258,6 +269,7 @@ tools:
258269
- "~/.neovate/config.json containing provider configuration based on selected endpoint"
259270

260271
crush:
272+
enabled: true
261273
install_cmd: npm install -g @charmland/crush
262274
cli_command: crush
263275
description: "Charmland Crush CLI"
@@ -274,6 +286,7 @@ tools:
274286
- "~/.config/crush/crush.json containing MCP server configurations"
275287

276288
cursor-agent:
289+
enabled: true
277290
install_cmd: curl https://cursor.com/install -fsS | bash
278291
cli_command: cursor-agent
279292
description: "Cursor Agent CLI"

code_assistant_manager/tools/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,19 @@ def select_model(
9090

9191

9292
def get_registered_tools() -> Dict[str, Type[CLITool]]:
93-
"""Return mapping of command name to tool class by discovering CLITool subclasses."""
93+
"""Return mapping of command name to tool class by discovering CLITool subclasses.
94+
95+
Only returns tools that are enabled in tools.yaml (enabled: true or not specified).
96+
Tools with enabled: false are hidden from menus.
97+
"""
9498
tools: Dict[str, Type[CLITool]] = {}
9599
for cls in CLITool.__subclasses__():
96100
name = getattr(cls, "command_name", None)
101+
tool_key = getattr(cls, "tool_key", None)
97102
if name:
98-
tools[name] = cls
103+
# Check if tool is enabled in registry
104+
# Use tool_key if available, otherwise fall back to command_name
105+
key_to_check = tool_key or name
106+
if TOOL_REGISTRY.is_enabled(key_to_check):
107+
tools[name] = cls
99108
return tools

code_assistant_manager/tools/registry.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import os
33
from pathlib import Path
4-
from typing import Dict, Optional
4+
from typing import Dict, List, Optional
55

66
import yaml
77

@@ -99,5 +99,33 @@ def get_install_command(self, tool_key: str) -> Optional[str]:
9999
return install_cmd.strip()
100100
return None
101101

102+
def is_enabled(self, tool_key: str) -> bool:
103+
"""Check if a tool is enabled in tools.yaml.
104+
105+
Args:
106+
tool_key: The tool key to check
107+
108+
Returns:
109+
True if enabled (default), False if explicitly disabled
110+
"""
111+
tool = self.get_tool(tool_key)
112+
if not tool:
113+
return True # Unknown tools are enabled by default
114+
# Default to True if 'enabled' key is not present
115+
return tool.get("enabled", True)
116+
117+
def get_enabled_tools(self) -> List[str]:
118+
"""Get list of all enabled tool keys.
119+
120+
Returns:
121+
List of tool keys that are enabled
122+
"""
123+
self._ensure_loaded()
124+
return [
125+
key
126+
for key, config in self._tools.items()
127+
if isinstance(config, dict) and config.get("enabled", True)
128+
]
129+
102130

103131
TOOL_REGISTRY = ToolRegistry()

docs/API_DOCUMENTATION.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,24 @@ Return the install command for a tool if defined.
326326
**Returns:**
327327
- `Optional[str]`: Install command or None
328328

329+
##### `is_enabled(tool_key: str)`
330+
Check if a tool is enabled in tools.yaml.
331+
332+
**Parameters:**
333+
- `tool_key` (str): Tool key to check
334+
335+
**Returns:**
336+
- `bool`: True if enabled (default), False if explicitly disabled
337+
338+
##### `get_enabled_tools()`
339+
Get list of all enabled tool keys.
340+
341+
**Parameters:**
342+
- None
343+
344+
**Returns:**
345+
- `List[str]`: List of tool keys that are enabled
346+
329347
#### `CLITool`
330348
Base class for CLI tools.
331349

@@ -499,4 +517,4 @@ All modules follow consistent error handling patterns:
499517
1. **Caching**: Model lists are cached with configurable TTL
500518
2. **Lazy Loading**: Configuration and tools are loaded only when needed
501519
3. **Efficient Parsing**: Optimized parsing for different output formats
502-
4. **Resource Management**: Proper cleanup of temporary files and resources
520+
4. **Resource Management**: Proper cleanup of temporary files and resources

docs/DEVELOPER_GUIDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ Add the tool configuration to `tools.yaml`:
137137

138138
```yaml
139139
newtool-key:
140+
enabled: true # Set to false to hide from menus
140141
install_cmd: npm install -g newtool
141142
cli_command: newtool
143+
description: "New Tool description"
142144
env:
143145
exported:
144146
NEWTOOL_API_KEY: "Resolved API key"
@@ -148,6 +150,24 @@ newtool-key:
148150
list_models_cmd: "Command to list models"
149151
```
150152
153+
### Tool Visibility (enabled/disabled)
154+
155+
Tools can be shown or hidden from the interactive menu using the `enabled` key in `tools.yaml`:
156+
157+
- `enabled: true` (default) - Tool appears in menus and can be launched
158+
- `enabled: false` - Tool is hidden from menus (useful for tools under development)
159+
160+
If the `enabled` key is not specified, it defaults to `true` for backward compatibility.
161+
162+
Example - disabling a tool:
163+
```yaml
164+
my-experimental-tool:
165+
enabled: false # Hidden from menu
166+
install_cmd: npm install -g my-tool
167+
cli_command: mytool
168+
description: "Experimental tool - not ready yet"
169+
```
170+
151171
## Configuration System
152172

153173
The configuration system uses JSON format with two main sections:

docs/UPGRADE_FUNCTIONALITY.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ If the user selects "Yes, upgrade to latest version", the system:
3232
The install commands are defined in the `tools.yaml` file for each tool. For example:
3333
```yaml
3434
claude-code:
35+
enabled: true # Set to false to hide from menus
3536
install_cmd: npm install -g @anthropic-ai/claude-code@latest
3637
cli_command: claude
3738
description: "Claude Code CLI"
@@ -53,6 +54,7 @@ claude-code:
5354
- **Transparent**: Shows the exact command being executed
5455
- **Robust**: Handles upgrade failures gracefully
5556
- **Configurable**: Install commands are defined in `tools.yaml`
57+
- **Visibility Control**: Tools can be shown/hidden from menus using the `enabled` key
5658

5759
## Supported Tools
5860

@@ -64,9 +66,10 @@ All tools defined in `tools.yaml` with an `install_cmd` field support upgrade fu
6466
- Tencent CodeBuddy CLI
6567
- Factory.ai Droid CLI
6668
- iFlow CLI
67-
- Zed Editor
68-
- Qoder CLI
69-
- Neovate Code CLI
69+
- Crush CLI
70+
- Cursor Agent CLI
71+
72+
Note: Some tools (Zed, Qoder, Neovate) are disabled by default (`enabled: false`) as they are still under development.
7073

7174
## Testing
7275

@@ -76,4 +79,4 @@ The upgrade functionality is tested with comprehensive unit tests that verify:
7679
- Proper command execution
7780
- User interaction flows
7881

79-
Tests can be found in `tests/test_upgrade_functionality.py`.
82+
Tests can be found in `tests/test_upgrade_functionality.py`.

0 commit comments

Comments
 (0)