@kaitranntt/ccs 2.4.5 → 2.4.6

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/README.md CHANGED
@@ -191,35 +191,6 @@ graph LR
191
191
  - **Context Preservation**: Your workflow remains uninterrupted
192
192
  - **Seamless Integration**: Works exactly like native Claude CLI
193
193
 
194
- ### Task Delegation
195
-
196
- > **🚧 Work in Progress**: This feature is experimental and not fully tested. Use with caution.
197
-
198
- CCS includes intelligent task delegation via the `/ccs` meta-command:
199
-
200
- **Install CCS commands:**
201
- ```bash
202
- ccs --install # Install /ccs command to Claude CLI
203
- ```
204
-
205
- **Use task delegation:**
206
- ```bash
207
- # After running ccs --install, you can use:
208
- /ccs glm /plan "add user authentication"
209
- /ccs glm /code "implement auth endpoints"
210
- /ccs glm /ask "explain this error"
211
- ```
212
-
213
- **Remove when not needed:**
214
- ```bash
215
- ccs --uninstall # Remove /ccs command from Claude CLI
216
- ```
217
-
218
- **Benefits**:
219
- - ✅ Save tokens by delegating simple tasks to cheaper models
220
- - ✅ Use right model for each task automatically
221
- - ✅ Seamless integration with existing workflows
222
- - ✅ Clean installation and removal when needed
223
194
 
224
195
  ---
225
196
 
@@ -229,8 +200,6 @@ ccs --uninstall # Remove /ccs command from Claude CLI
229
200
  ccs # Use Claude subscription (default)
230
201
  ccs glm # Use GLM fallback
231
202
  ccs --version # Show CCS version and install location
232
- ccs --install # Install CCS commands and skills to ~/.claude/
233
- ccs --uninstall # Remove CCS commands and skills from ~/.claude/
234
203
  ```
235
204
 
236
205
  ---
package/README.vi.md CHANGED
@@ -190,35 +190,6 @@ graph LR
190
190
  - **Bảo Toàn Context**: Workflow của bạn không bị gián đoạn
191
191
  - **Tích Hợp Liền Mạch**: Hoạt động chính xác như Claude CLI native
192
192
 
193
- ### Delegation Tác Vụ
194
-
195
- > **🚧 Đang phát triển**: Tính năng này đang trong giai đoạn thử nghiệm và chưa được kiểm tra đầy đủ. Sử dụng với cẩn thận.
196
-
197
- CCS bao gồm delegation tác vụ thông minh qua meta-command `/ccs`:
198
-
199
- **Cài đặt lệnh CCS:**
200
- ```bash
201
- ccs --install # Cài đặt lệnh /ccs vào Claude CLI
202
- ```
203
-
204
- **Sử dụng delegation tác vụ:**
205
- ```bash
206
- # Sau khi chạy ccs --install, bạn có thể dùng:
207
- /ccs glm /plan "add user authentication"
208
- /ccs glm /code "implement auth endpoints"
209
- /ccs glm /ask "explain this error"
210
- ```
211
-
212
- **Gỡ bỏ khi không cần:**
213
- ```bash
214
- ccs --uninstall # Gỡ bỏ lệnh /ccs khỏi Claude CLI
215
- ```
216
-
217
- **Lợi ích**:
218
- - ✅ Tiết kiệm tokens bằng cách delegation tác vụ đơn giản cho model rẻ hơn
219
- - ✅ Dùng đúng model cho từng tác vụ tự động
220
- - ✅ Tích hợp liền mạch với workflows hiện có
221
- - ✅ Cài đặt và gỡ bỏ sạch sẽ khi cần
222
193
 
223
194
  ---
224
195
 
@@ -228,8 +199,6 @@ ccs --uninstall # Gỡ bỏ lệnh /ccs khỏi Claude CLI
228
199
  ccs # Dùng Claude subscription (mặc định)
229
200
  ccs glm # Dùng GLM fallback
230
201
  ccs --version # Hiển thị phiên bản CCS và vị trí cài đặt
231
- ccs --install # Cài đặt lệnh và kỹ năng CCS vào ~/.claude/
232
- ccs --uninstall # Gỡ bỏ lệnh và kỹ năng CCS khỏi ~/.claude/
233
202
  ```
234
203
 
235
204
  ---
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.5
1
+ 2.4.6
package/bin/ccs.js CHANGED
@@ -4,9 +4,9 @@
4
4
  const { spawn } = require('child_process');
5
5
  const path = require('path');
6
6
  const fs = require('fs');
7
- const { error } = require('./helpers');
7
+ const { error, colored } = require('./helpers');
8
8
  const { detectClaudeCli, showClaudeNotFoundError } = require('./claude-detector');
9
- const { getSettingsPath } = require('./config-manager');
9
+ const { getSettingsPath, getConfigPath } = require('./config-manager');
10
10
 
11
11
  // Version (sync with package.json)
12
12
  const CCS_VERSION = require('../package.json').version;
@@ -26,42 +26,127 @@ function execClaude(claudeCli, args) {
26
26
 
27
27
  // Special command handlers
28
28
  function handleVersionCommand() {
29
- console.log(`CCS (Claude Code Switch) version ${CCS_VERSION}`);
29
+ // Title
30
+ console.log(colored(`CCS (Claude Code Switch) v${CCS_VERSION}`, 'bold'));
31
+ console.log('');
30
32
 
31
- // Show install location
32
- const installLocation = process.argv[1];
33
- if (installLocation) {
34
- console.log(`Installed at: ${installLocation}`);
35
- }
33
+ // Installation section
34
+ console.log(colored('Installation:', 'cyan'));
35
+
36
+ // Location
37
+ const installLocation = process.argv[1] || '(not found)';
38
+ console.log(` ${colored('Location:', 'cyan')} ${installLocation}`);
39
+
40
+ // Config path
41
+ const configPath = getConfigPath();
42
+ console.log(` ${colored('Config:', 'cyan')} ${configPath}`);
43
+ console.log('');
44
+
45
+ // Documentation
46
+ console.log(`${colored('Documentation:', 'cyan')} https://github.com/kaitranntt/ccs`);
47
+ console.log(`${colored('License:', 'cyan')} MIT`);
48
+ console.log('');
49
+
50
+ // Help hint
51
+ console.log(colored('Run \'ccs --help\' for usage information', 'yellow'));
36
52
 
37
- console.log('https://github.com/kaitranntt/ccs');
38
53
  process.exit(0);
39
54
  }
40
55
 
41
- function handleHelpCommand(remainingArgs) {
42
- const claudeCli = detectClaudeCli();
43
- if (!claudeCli) {
44
- showClaudeNotFoundError();
45
- process.exit(1);
46
- }
56
+ function handleHelpCommand() {
57
+ // Title
58
+ console.log(colored('CCS (Claude Code Switch) - Instant profile switching for Claude CLI', 'bold'));
59
+ console.log('');
60
+
61
+ // Usage
62
+ console.log(colored('Usage:', 'cyan'));
63
+ console.log(` ${colored('ccs', 'yellow')} [profile] [claude-args...]`);
64
+ console.log(` ${colored('ccs', 'yellow')} [flags]`);
65
+ console.log('');
66
+
67
+ // Description
68
+ console.log(colored('Description:', 'cyan'));
69
+ console.log(' Switch between Claude models instantly. Stop hitting rate limits.');
70
+ console.log(' Maps profile names to Claude settings files via ~/.ccs/config.json');
71
+ console.log('');
72
+
73
+ // Profile Switching
74
+ console.log(colored('Profile Switching:', 'cyan'));
75
+ console.log(` ${colored('ccs', 'yellow')} Use default profile`);
76
+ console.log(` ${colored('ccs glm', 'yellow')} Switch to GLM profile`);
77
+ console.log(` ${colored('ccs glm', 'yellow')} "debug this code" Switch to GLM and run command`);
78
+ console.log(` ${colored('ccs glm', 'yellow')} --verbose Switch to GLM with Claude flags`);
79
+ console.log('');
80
+
81
+ // Flags
82
+ console.log(colored('Flags:', 'cyan'));
83
+ console.log(` ${colored('-h, --help', 'yellow')} Show this help message`);
84
+ console.log(` ${colored('-v, --version', 'yellow')} Show version and installation info`);
85
+ console.log('');
86
+
87
+ // Configuration
88
+ console.log(colored('Configuration:', 'cyan'));
89
+ console.log(' Config File: ~/.ccs/config.json');
90
+ console.log(' Settings: ~/.ccs/*.settings.json');
91
+ console.log(' Environment: CCS_CONFIG (override config path)');
92
+ console.log('');
93
+
94
+ // Examples
95
+ console.log(colored('Examples:', 'cyan'));
96
+ console.log(' # Try without installing');
97
+ console.log(` ${colored('npx @kaitranntt/ccs glm', 'yellow')} "write tests"`);
98
+ console.log('');
99
+ console.log(' # Use default Claude subscription');
100
+ console.log(` ${colored('ccs', 'yellow')} "Review this architecture"`);
101
+ console.log('');
102
+ console.log(' # Switch to GLM for cost-effective tasks');
103
+ console.log(` ${colored('ccs glm', 'yellow')} "Write unit tests"`);
104
+ console.log('');
105
+ console.log(' # Use GLM with verbose output');
106
+ console.log(` ${colored('ccs glm', 'yellow')} --verbose "Debug error"`);
107
+ console.log('');
108
+
109
+ // Uninstall
110
+ console.log(colored('Uninstall:', 'yellow'));
111
+ console.log(' npm: npm uninstall -g @kaitranntt/ccs');
112
+ console.log(' macOS/Linux: curl -fsSL ccs.kaitran.ca/uninstall | bash');
113
+ console.log(' Windows: irm ccs.kaitran.ca/uninstall | iex');
114
+ console.log('');
115
+
116
+ // Documentation
117
+ console.log(colored('Documentation:', 'cyan'));
118
+ console.log(` GitHub: ${colored('https://github.com/kaitranntt/ccs', 'cyan')}`);
119
+ console.log(' Docs: https://github.com/kaitranntt/ccs/blob/main/README.md');
120
+ console.log(' Issues: https://github.com/kaitranntt/ccs/issues');
121
+ console.log('');
122
+
123
+ // License
124
+ console.log(`${colored('License:', 'cyan')} MIT`);
47
125
 
48
- execClaude(claudeCli, ['--help', ...remainingArgs]);
126
+ process.exit(0);
49
127
  }
50
128
 
51
129
  function handleInstallCommand() {
52
- // Implementation for --install (copy commands/skills to ~/.claude)
53
- console.log('[Installing CCS Commands and Skills]');
54
- console.log('Feature not yet implemented in Node.js standalone');
55
- console.log('Use traditional installer for now:');
56
- console.log(' curl -fsSL ccs.kaitran.ca/install | bash');
130
+ console.log('');
131
+ console.log('Feature not available');
132
+ console.log('');
133
+ console.log('The --install flag is currently under development.');
134
+ console.log('.claude/ integration testing is not complete.');
135
+ console.log('');
136
+ console.log('For updates: https://github.com/kaitranntt/ccs/issues');
137
+ console.log('');
57
138
  process.exit(0);
58
139
  }
59
140
 
60
141
  function handleUninstallCommand() {
61
- // Implementation for --uninstall (remove commands/skills from ~/.claude)
62
- console.log('[Uninstalling CCS Commands and Skills]');
63
- console.log('Feature not yet implemented in Node.js standalone');
64
- console.log('Use traditional uninstaller for now');
142
+ console.log('');
143
+ console.log('Feature not available');
144
+ console.log('');
145
+ console.log('The --uninstall flag is currently under development.');
146
+ console.log('.claude/ integration testing is not complete.');
147
+ console.log('');
148
+ console.log('For updates: https://github.com/kaitranntt/ccs/issues');
149
+ console.log('');
65
150
  process.exit(0);
66
151
  }
67
152
 
@@ -88,8 +173,7 @@ function main() {
88
173
 
89
174
  // Special case: help command
90
175
  if (firstArg === '--help' || firstArg === '-h' || firstArg === 'help') {
91
- const remainingArgs = args.slice(1);
92
- handleHelpCommand(remainingArgs);
176
+ handleHelpCommand();
93
177
  return;
94
178
  }
95
179
 
package/bin/helpers.js CHANGED
@@ -4,16 +4,38 @@ const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
6
 
7
- // Color formatting (TTY-aware)
8
- const useColors = process.stderr.isTTY && !process.env.NO_COLOR;
9
- const colors = useColors ? {
10
- red: '\x1b[0;31m',
11
- yellow: '\x1b[1;33m',
12
- cyan: '\x1b[0;36m',
13
- green: '\x1b[0;32m',
14
- bold: '\x1b[1m',
15
- reset: '\x1b[0m'
16
- } : { red: '', yellow: '', cyan: '', green: '', bold: '', reset: '' };
7
+ // TTY-aware color detection (matches lib/ccs bash logic)
8
+ function getColors() {
9
+ const forcedColors = process.env.FORCE_COLOR;
10
+ const noColor = process.env.NO_COLOR;
11
+ const isTTY = process.stdout.isTTY === true; // Must be explicitly true
12
+
13
+ const useColors = forcedColors || (isTTY && !noColor);
14
+
15
+ if (useColors) {
16
+ return {
17
+ red: '\x1b[0;31m',
18
+ yellow: '\x1b[1;33m',
19
+ cyan: '\x1b[0;36m',
20
+ green: '\x1b[0;32m',
21
+ bold: '\x1b[1m',
22
+ reset: '\x1b[0m'
23
+ };
24
+ }
25
+
26
+ return { red: '', yellow: '', cyan: '', green: '', bold: '', reset: '' };
27
+ }
28
+
29
+
30
+ // Colors object (dynamic)
31
+ const colors = getColors();
32
+
33
+ // Helper: Apply color to text (returns plain text if colors disabled)
34
+ function colored(text, colorName = 'reset') {
35
+ const currentColors = getColors();
36
+ const color = currentColors[colorName] || '';
37
+ return color ? `${color}${text}${currentColors.reset}` : text;
38
+ }
17
39
 
18
40
  // Simple error formatting
19
41
  function error(message) {
@@ -44,6 +66,7 @@ function expandPath(pathStr) {
44
66
 
45
67
  module.exports = {
46
68
  colors,
69
+ colored,
47
70
  error,
48
71
  expandPath
49
72
  };
package/lib/ccs CHANGED
@@ -2,7 +2,7 @@
2
2
  set -euo pipefail
3
3
 
4
4
  # Version (updated by scripts/bump-version.sh)
5
- CCS_VERSION="2.4.5"
5
+ CCS_VERSION="2.4.6"
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  readonly CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}"
8
8
 
@@ -52,9 +52,7 @@ show_help() {
52
52
  echo -e "${CYAN}Flags:${RESET}"
53
53
  echo -e " ${YELLOW}-h, --help${RESET} Show this help message"
54
54
  echo -e " ${YELLOW}-v, --version${RESET} Show version and installation info"
55
- echo -e " ${YELLOW}--install${RESET} Install CCS commands to Claude CLI"
56
- echo -e " ${YELLOW}--uninstall${RESET} Remove CCS commands from Claude CLI"
57
- echo ""
55
+ echo ""
58
56
  echo -e "${CYAN}Configuration:${RESET}"
59
57
  echo -e " Config File: ~/.ccs/config.json"
60
58
  echo -e " Settings: ~/.ccs/*.settings.json"
@@ -70,10 +68,7 @@ show_help() {
70
68
  echo -e " # Use GLM with verbose output"
71
69
  echo -e " ${YELLOW}ccs glm${RESET} --verbose \"Debug error\""
72
70
  echo ""
73
- echo -e " # Install CCS task delegation"
74
- echo -e " ${YELLOW}ccs${RESET} --install"
75
- echo ""
76
- echo -e "${YELLOW}Uninstall:${RESET}"
71
+ echo -e "${YELLOW}Uninstall:${RESET}"
77
72
  echo -e " macOS/Linux: curl -fsSL ccs.kaitran.ca/uninstall | bash"
78
73
  echo -e " Windows: irm ccs.kaitran.ca/uninstall | iex"
79
74
  echo -e " npm: npm uninstall -g @kaitranntt/ccs"
@@ -122,8 +117,10 @@ Solutions:
122
117
  Restart your terminal after installation."
123
118
  }
124
119
 
125
- # Installation function for commands and skills
126
- install_commands_and_skills() {
120
+ # WIP: .claude/ integration testing incomplete
121
+ # Feature disabled until testing complete
122
+ # install_commands_and_skills() {
123
+ : <<'COMMENTED_OUT'
127
124
  # Try both possible locations for .claude directory
128
125
  local source_dir=""
129
126
  local possible_dirs=(
@@ -227,10 +224,13 @@ Solution:
227
224
  echo ""
228
225
  echo "You can now use the /ccs command in Claude CLI for task delegation."
229
226
  echo "Example: /ccs glm /plan 'add user authentication'"
230
- }
227
+ COMMENTED_OUT
228
+ # }
231
229
 
232
- # Uninstallation function for commands and skills
233
- uninstall_commands_and_skills() {
230
+ # WIP: .claude/ integration testing incomplete
231
+ # Feature disabled until testing complete
232
+ # uninstall_commands_and_skills() {
233
+ : <<'COMMENTED_OUT'
234
234
  local target_dir="$HOME/.claude"
235
235
  local removed_count=0
236
236
  local not_found_count=0
@@ -307,7 +307,8 @@ uninstall_commands_and_skills() {
307
307
  echo ""
308
308
  echo "The /ccs command is no longer available in Claude CLI."
309
309
  echo "To reinstall: ccs --install"
310
- }
310
+ COMMENTED_OUT
311
+ # }
311
312
 
312
313
  show_version() {
313
314
  echo -e "${BOLD}CCS (Claude Code Switch) v${CCS_VERSION}${RESET}"
@@ -344,14 +345,28 @@ fi
344
345
 
345
346
  # Special case: install command (check BEFORE profile detection)
346
347
  if [[ $# -gt 0 ]] && [[ "${1}" == "--install" ]]; then
347
- install_commands_and_skills
348
- exit $?
348
+ echo ""
349
+ echo "Feature not available"
350
+ echo ""
351
+ echo "The --install flag is currently under development."
352
+ echo ".claude/ integration testing is not complete."
353
+ echo ""
354
+ echo "For updates: https://github.com/kaitranntt/ccs/issues"
355
+ echo ""
356
+ exit 0
349
357
  fi
350
358
 
351
359
  # Special case: uninstall command (check BEFORE profile detection)
352
360
  if [[ $# -gt 0 ]] && [[ "${1}" == "--uninstall" ]]; then
353
- uninstall_commands_and_skills
354
- exit $?
361
+ echo ""
362
+ echo "Feature not available"
363
+ echo ""
364
+ echo "The --uninstall flag is currently under development."
365
+ echo ".claude/ integration testing is not complete."
366
+ echo ""
367
+ echo "For updates: https://github.com/kaitranntt/ccs/issues"
368
+ echo ""
369
+ exit 0
355
370
  fi
356
371
 
357
372
  # Smart profile detection: if first arg starts with '-', it's a flag not a profile
package/lib/ccs.ps1 CHANGED
@@ -104,9 +104,7 @@ function Show-Help {
104
104
  Write-ColorLine "Flags:" "Cyan"
105
105
  Write-ColorLine " -h, --help Show this help message" "Yellow"
106
106
  Write-ColorLine " -v, --version Show version and installation info" "Yellow"
107
- Write-ColorLine " --install Install CCS commands to Claude CLI" "Yellow"
108
- Write-ColorLine " --uninstall Remove CCS commands from Claude CLI" "Yellow"
109
- Write-Host ""
107
+ Write-Host ""
110
108
  Write-ColorLine "Configuration:" "Cyan"
111
109
  Write-Host " Config File: ~/.ccs/config.json"
112
110
  Write-Host " Settings: ~/.ccs/*.settings.json"
@@ -122,10 +120,7 @@ function Show-Help {
122
120
  Write-Host " # Use GLM with verbose output"
123
121
  Write-ColorLine " ccs glm --verbose 'Debug error'" "Yellow"
124
122
  Write-Host ""
125
- Write-Host " # Install CCS task delegation"
126
- Write-ColorLine " ccs --install" "Yellow"
127
- Write-Host ""
128
- Write-ColorLine "Uninstall:" "Cyan"
123
+ Write-ColorLine "Uninstall:" "Cyan"
129
124
  Write-Host " macOS/Linux: curl -fsSL ccs.kaitran.ca/uninstall | bash"
130
125
  Write-Host " Windows: irm ccs.kaitran.ca/uninstall | iex"
131
126
  Write-Host " npm: npm uninstall -g @kaitranntt/ccs"
@@ -139,7 +134,7 @@ function Show-Help {
139
134
  }
140
135
 
141
136
  # Version (updated by scripts/bump-version.sh)
142
- $CcsVersion = "2.4.5"
137
+ $CcsVersion = "2.4.6"
143
138
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
144
139
  $ConfigFile = if ($env:CCS_CONFIG) { $env:CCS_CONFIG } else { "$env:USERPROFILE\.ccs\config.json" }
145
140
 
@@ -230,13 +225,27 @@ if ($Help) {
230
225
 
231
226
  # Special case: install command (check BEFORE profile detection)
232
227
  if ($FirstArg -eq "--install") {
233
- Write-Host "Installation not implemented in this test version" -ForegroundColor Yellow
228
+ Write-Host ""
229
+ Write-Host "Feature not available" -ForegroundColor Yellow
230
+ Write-Host ""
231
+ Write-Host "The --install flag is currently under development."
232
+ Write-Host ".claude/ integration testing is not complete."
233
+ Write-Host ""
234
+ Write-Host "For updates: https://github.com/kaitranntt/ccs/issues"
235
+ Write-Host ""
234
236
  exit 0
235
237
  }
236
238
 
237
239
  # Special case: uninstall command (check BEFORE profile detection)
238
240
  if ($FirstArg -eq "--uninstall") {
239
- Write-Host "Uninstallation not implemented in this test version" -ForegroundColor Yellow
241
+ Write-Host ""
242
+ Write-Host "Feature not available" -ForegroundColor Yellow
243
+ Write-Host ""
244
+ Write-Host "The --uninstall flag is currently under development."
245
+ Write-Host ".claude/ integration testing is not complete."
246
+ Write-Host ""
247
+ Write-Host "For updates: https://github.com/kaitranntt/ccs/issues"
248
+ Write-Host ""
240
249
  exit 0
241
250
  }
242
251
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "2.4.5",
3
+ "version": "2.4.6",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",